[PATCH 2/2] drm/amdgpu: add module parameter choose runtime method

2020-11-20 Thread Likun Gao
From: Likun Gao Default runtime logic not changed. Provide an alternative runtime method. (set 1 to use BACO; 2 to use BAMACO) When set reset_method to 4, it will use BACO or BAMACO for gpu reset, according to runtime value. Signed-off-by: Likun Gao --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

RE: [PATCH 2/2] drm/amdgpu: add module parameter choose runtime method

2020-11-20 Thread Feng, Kenneth
[AMD Official Use Only - Internal Distribution Only] Series is Reviewed-by: Kenneth Feng Best Regards Kenneth -Original Message- From: Gao, Likun Sent: Friday, November 20, 2020 3:59 PM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Feng, Kenneth ; Gao, Likun Subject: [PATC

[PATCH] drm/amd/display: Avoid HDCP initialization in devices without output

2020-11-20 Thread Rodrigo Siqueira
The HDCP feature requires at least one connector attached to the device; however, some GPUs do not have a physical output, making the HDCP initialization irrelevant. This patch disables HDCP initialization when the graphic card does not have output. Signed-off-by: Rodrigo Siqueira --- drivers/gp

Re: [PATCH] drm/amd/display: Avoid HDCP initialization in devices without output

2020-11-20 Thread Deucher, Alexander
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Siqueira, Rodrigo Sent: Friday, November 20, 2020 8:59 AM To: amd-gfx@lists.freedesktop.org Cc: Wentland, Harry ; Deucher, Alexander Subject: [PATCH] drm/amd/display: Avoid HDCP

[PATCH] drm/amdgpu: only register VGA devices with the VGA arbiter

2020-11-20 Thread Alex Deucher
We only need to arbitrate VGA access on VGA compatible devices. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev

RE: [PATCH] drm/amdgpu: only register VGA devices with the VGA arbiter

2020-11-20 Thread Xu, Feifei
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Feifei Xu -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Friday, November 20, 2020 10:55 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: [PATCH] drm/amdgpu: only register VGA device

[PATCH 1/1] drm/amdgpu: use generic DMA API

2020-11-20 Thread Nirmoy Das
Use generic DMA api instead of bus-specific API. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index e01e681d2a60..ea5

Re: [PATCH 1/1] drm/amdgpu: use generic DMA API

2020-11-20 Thread Nirmoy
Sorry, I missed pci_dma_mapping_error() :/ I will resend. Nirmoy On 11/20/20 4:41 PM, Nirmoy Das wrote: Use generic DMA api instead of bus-specific API. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] drm/amdgpu: only register VGA devices with the VGA arbiter

2020-11-20 Thread Christian König
Reviewed-by: Christian König Am 20.11.20 um 16:04 schrieb Xu, Feifei: [AMD Official Use Only - Internal Distribution Only] Reviewed-by: Feifei Xu -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Friday, November 20, 2020 10:55 PM To: amd-gfx@lists.freedesktop.org Cc:

[PATCH 1/2] drm/amdgpu: use generic DMA API

2020-11-20 Thread Nirmoy Das
Use generic DMA api instead of bus-specific API. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index e01e681d2a60.

[PATCH 2/2] drm/radeon: use generic DMA API

2020-11-20 Thread Nirmoy Das
Use generic DMA api instead of bus-specific API. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/radeon/radeon_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 7f384ffe848a..a5588

Re: [PATCH 2/2] drm/radeon: use generic DMA API

2020-11-20 Thread Alex Deucher
Series is: Reviewed-by: Alex Deucher On Fri, Nov 20, 2020 at 11:04 AM Nirmoy Das wrote: > > Use generic DMA api instead of bus-specific API. > > Signed-off-by: Nirmoy Das > --- > drivers/gpu/drm/radeon/radeon_device.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a

[PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
Hi all, This series aims to fix almost all remaining fall-through warnings in order to enable -Wimplicit-fallthrough for Clang. In preparation to enable -Wimplicit-fallthrough for Clang, explicitly add multiple break/goto/return/fallthrough statements instead of just letting the code fall through

[PATCH 005/141] drm/radeon: Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple fallthrough pseudo-keyword macros, as replacement for /* fall through */ comments. Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings. Link

[PATCH 004/141] drm/amdgpu: Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/am

[PATCH 028/141] drm/amd/display: Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/am

[PATCH 078/141] drm/amd/pm: Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break statement instead of letting the code fall through to the next case, and a fallthrough pseudo-keyword as a replacement for a /* fall through */ comment, Notice that Clang doesn't recogn

[bugreport] Renoir laptop freezes after "waking up" from suspend, WARNING: CPU: 0 PID: 4573 at drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:2548

2020-11-20 Thread honza-bugzilla
Hello, I noticed following bug, I followed https://www.kernel.org/doc/html/latest/admin-guide/reporting-bugs.html Please let me know if additional info or patch testing is needed (I'm not subscribed to the list, so please include me in the reponse). [1.] One line summary of the problem: Lapto

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Joe Perches
On Fri, 2020-11-20 at 12:21 -0600, Gustavo A. R. Silva wrote: > Hi all, > > This series aims to fix almost all remaining fall-through warnings in > order to enable -Wimplicit-fallthrough for Clang. > > In preparation to enable -Wimplicit-fallthrough for Clang, explicitly > add multiple break/goto

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Jakub Kicinski
On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: > This series aims to fix almost all remaining fall-through warnings in > order to enable -Wimplicit-fallthrough for Clang. > > In preparation to enable -Wimplicit-fallthrough for Clang, explicitly > add multiple break/goto/return/fallt

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
Hi, On 11/20/20 12:53, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: >> This series aims to fix almost all remaining fall-through warnings in >> order to enable -Wimplicit-fallthrough for Clang. >> >> In preparation to enable -Wimplicit-fallthrough for Cla

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Kees Cook
On Fri, Nov 20, 2020 at 10:53:44AM -0800, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: > > This series aims to fix almost all remaining fall-through warnings in > > order to enable -Wimplicit-fallthrough for Clang. > > > > In preparation to enable -Wimplici

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Gustavo A. R. Silva
On 11/20/20 12:28, Joe Perches wrote: > On Fri, 2020-11-20 at 12:21 -0600, Gustavo A. R. Silva wrote: >> Hi all, >> >> This series aims to fix almost all remaining fall-through warnings in >> order to enable -Wimplicit-fallthrough for Clang. >> >> In preparation to enable -Wimplicit-fallthrough

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Jakub Kicinski
On Fri, 20 Nov 2020 11:30:40 -0800 Kees Cook wrote: > On Fri, Nov 20, 2020 at 10:53:44AM -0800, Jakub Kicinski wrote: > > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: > > > This series aims to fix almost all remaining fall-through warnings in > > > order to enable -Wimplicit-fall

[PATCH 4/4] drm/amd/display: don't expose rotation prop for cursor plane

2020-11-20 Thread Simon Ser
Setting any rotation on the cursor plane is ignored by amdgpu. Because of DCE/DCN design, it's not possible to rotate the cursor. Instead of displaying the wrong result, stop advertising the rotation property for the cursor plane. Now that we check all cursor plane properties in amdgpu_dm_atomic_c

[PATCH 1/4] drm/amd/display: add cursor FB size check

2020-11-20 Thread Simon Ser
This patch expands the cursor checks added in "drm/amd/display: add basic atomic check for cursor plane" to also include a FB size check. Without this patch, setting a FB smaller than max_cursor_size with an invalid width would result in amdgpu error messages and a fallback to a 64-byte width:

[PATCH 2/4] drm/amd/display: disallow cropping for cursor plane

2020-11-20 Thread Simon Ser
Looking at handle_cursor_update, it doesn't seem like src_{x,y,w,h} are picked up by DC. I also tried to change these parameters via a test KMS client, and amdgpu ignored them. Instead of displaying the wrong result, reject the atomic commit. Signed-off-by: Simon Ser Cc: Alex Deucher Cc: Harry W

[PATCH 0/4] drm/amd/display: add cursor plane checks

2020-11-20 Thread Simon Ser
This series adds checks for all cursor plane properties. This avoids accepting configurations that we won't be able to display. I've tested this series against various scenarios using a hacked up wlroots [1]. [1]: https://github.com/emersion/wlroots/commits/amdgpu-cursor-invalid Simon Ser (4):

[PATCH 3/4] drm/amd/display: check cursor scaling

2020-11-20 Thread Simon Ser
Don't allow user-space to set different scaling parameters for the cursor plane and for the primary plane. Because of DCE/DCN design, it's not possible to have a mismatch. The old check in dm_update_plane_state is superseded by this new check. Signed-off-by: Simon Ser Cc: Alex Deucher Cc: Harry

[PATCH 00/18] DC 3.2.113 Patches, November 20, 2020

2020-11-20 Thread Rodrigo Siqueira
This DC patchset brings improvements in multiple areas. In summary, we highlight: * Power features and optimizations * Code cleanup * Enable stutter for DCN3.01 * Bug fixes Best Regards Aric Cyr (1): drm/amd/display: 3.2.113 Ashley Thomas (1): drm/amd/display: Source minimum HBlank support

[PATCH 01/18] drm/amd/display: add i2c speed arbitration for dc_i2c and hdcp_i2c

2020-11-20 Thread Rodrigo Siqueira
From: Charlene Liu [why] HDCP 1.4 failed on SL8800 SW w/a test driver use. [how] slower down the HW i2c speed when used by HW i2c. this request: each acquired_i2c_engine setup the i2c speed needed. and set the I2c engine for HDCP use at release_engine. this covers SW using HW I2c engine and HDC

[PATCH 08/18] drm/amd/display: change hw sequence

2020-11-20 Thread Rodrigo Siqueira
From: Sherry [Why] t9 delay func is called twice after setting power off, the unexpected action results in a doubling of the added 140ms t9 delay [How] If the backlight has been turned off, does not turn it off again Signed-off-by: Sherry Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira --

[PATCH 03/18] drm/amd/display: Update panel register

2020-11-20 Thread Rodrigo Siqueira
From: Chris Park [Why] Incorrect panel register settings are applied for power sequence because the register macro is not defined in resource. [How] Implement same register space to future resource files. Signed-off-by: Chris Park Reviewed-by: Joshua Aberback Acked-by: Rodrigo Siqueira ---

[PATCH 14/18] drm/amd/display: Add GAMCOR memory shutdown support

2020-11-20 Thread Rodrigo Siqueira
From: Jacky Liao [Why] The GAMCOR memory blocks should be powered down when they're not in use. This will reduce power consumption. [How] Write to GAMCOR_MEM_PWR_FORCE to put memory to shutdown when GAMCOR is not used. Signed-off-by: Jacky Liao Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueir

[PATCH 04/18] drm/amd/display: Enable stutter for dcn3.01.

2020-11-20 Thread Rodrigo Siqueira
From: Yongqiang Sun [Why & How] Enable stutter for DCN3.01. Signed-off-by: Yongqiang Sun Reviewed-by: Harry Wentland Acked-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn301

[PATCH 05/18] drm/amd/display: Add DMCU memory low power support

2020-11-20 Thread Rodrigo Siqueira
From: Jacky Liao [Why] On some platforms, DMCU is no longer used. In these cases, some DMCU memory should be completely powered off to save power. [How] 1. Set DMCU_ERAM_MEM_PWR_FORCE to shutdown memory when DMCU is not in use 2. Added a debug option to allow this behaviour to be turned off 3

[PATCH 18/18] drm/amd/display: init soc bounding box for dcn3.01.

2020-11-20 Thread Rodrigo Siqueira
From: Yongqiang Sun [Why & How] Update init soc bounding box and bw bounding box for DCN3.01. Remove pp smu interface which isn't used. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Rodrigo Siqueira --- .../amd/display/dc/dcn301/dcn301_resource.c | 118 +-

[PATCH 17/18] drm/amd/display: To update backlight restore mechanism

2020-11-20 Thread Rodrigo Siqueira
From: Camille Cho [Why] Cached backlight is never being updated since panel_cntl specific registers were moved from abm to panel_cntl. [How] Update cached backlight in set_abm_immediate_disable as what we used to do. Also, update the priority of backlight restore mechanism so that cached backlig

[PATCH 10/18] drm/amd/display: Add BLNDGAM memory shutdown support

2020-11-20 Thread Rodrigo Siqueira
From: Jacky Liao [Why] The BLNDGAM memory blocks should be powered down when they're not in use. This will reduce power consumption. [How] 1. Write to BLNDGAM_MEM_PWR_FORCE to put memory to shutdown when BLNDGAM is not used. 2. Added a debug option to allow this behaviour to be turned off Si

[PATCH 15/18] drm/amd/display: enable pipe power gating by default

2020-11-20 Thread Rodrigo Siqueira
From: Sung Joon Kim [why] ASIC requirement. [how] Make disable_*_power_gate to false. Signed-off-by: Sung Joon Kim Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH 07/18] drm/amd/display: expose clk_mgr functions for reuse

2020-11-20 Thread Rodrigo Siqueira
From: Eric Yang Signed-off-by: Eric Yang Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira --- .../gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 8 .../gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.h | 10 ++ 2 files changed, 14 insertions(+), 4 deletions(

[PATCH 06/18] drm/amd/display: intermittent underflow observed when PIP is toggled in Full screen

2020-11-20 Thread Rodrigo Siqueira
From: Tashfique Abdullah [Why] The MPCC may change and request data when the pipes are switching from 2 to 1 or 1 to 2. During the switch there is a possibility of underflow and flicker/missing data. [How] During VBlank the MPCC won't request data. The trick is to delay and wait on VBlank, ONLY

[PATCH 13/18] drm/amd/display: remove macro which is in header already

2020-11-20 Thread Rodrigo Siqueira
From: Yongqiang Sun [Why & How] Remove temp macro since the enum is in header file already. Signed-off-by: Yongqiang Sun Reviewed-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/

[PATCH 16/18] drm/amd/display: 3.2.113

2020-11-20 Thread Rodrigo Siqueira
From: Aric Cyr Signed-off-by: Aric Cyr Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 115468d3f793..68

[PATCH 02/18] drm/amd/display: Source minimum HBlank support

2020-11-20 Thread Rodrigo Siqueira
From: Ashley Thomas [Why] Some sink devices wish to have access to the minimum HBlank supported by the ASIC. [How] Make the ASIC minimum HBlank available in Source Device information address 0x340. Signed-off-by: Ashley Thomas Reviewed-by: Anthony Koo Reviewed-by: Wenjing Liu Acked-by: Rodri

[PATCH 11/18] drm/amd/display: Add internal display info

2020-11-20 Thread Rodrigo Siqueira
From: Yongqiang Sun [Why & How] Get internal display info from vbios and pass it to dmub fw to determine if multiple display optmization is needed. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Anthony Koo Acked-by: Aric Cyr Acked-by: Rodrigo Siqueira --- .../drm/amd/displ

[PATCH 09/18] drm/amd/display: Clear sticky vsc sdp error bit

2020-11-20 Thread Rodrigo Siqueira
From: Wyatt Wood [Why] Need to clear sticky error bits generated during hpd irq from receiver. [How] Clear sticky vsc sdp error bit. Signed-off-by: Wyatt Wood Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 3 ++- 1 file changed, 2

[PATCH 12/18] drm/amd/display: Check multiple internal displays for power optimization.

2020-11-20 Thread Rodrigo Siqueira
From: Yongqiang Sun [Why & How] only apply multiple display power optimization in case there are more than one internal display. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Anthony Koo Acked-by: Aric Cyr Acked-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/core/

Re: [PATCH 1/4] drm/amd/display: add cursor FB size check

2020-11-20 Thread Alex Deucher
On Fri, Nov 20, 2020 at 3:19 PM Simon Ser wrote: > > This patch expands the cursor checks added in "drm/amd/display: add basic > atomic check for cursor plane" to also include a FB size check. Without > this patch, setting a FB smaller than max_cursor_size with an invalid > width would result in a

Re: [PATCH 1/4] drm/amd/display: add cursor FB size check

2020-11-20 Thread Alex Deucher
On Fri, Nov 20, 2020 at 3:50 PM Alex Deucher wrote: > > On Fri, Nov 20, 2020 at 3:19 PM Simon Ser wrote: > > > > This patch expands the cursor checks added in "drm/amd/display: add basic > > atomic check for cursor plane" to also include a FB size check. Without > > this patch, setting a FB small

Re: [PATCH 0/4] drm/amd/display: add cursor plane checks

2020-11-20 Thread Alex Deucher
On Fri, Nov 20, 2020 at 3:19 PM Simon Ser wrote: > > This series adds checks for all cursor plane properties. This avoids > accepting configurations that we won't be able to display. > > I've tested this series against various scenarios using a hacked up > wlroots [1]. > > [1]: https://github.com/

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Kees Cook
On Fri, Nov 20, 2020 at 11:51:42AM -0800, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 11:30:40 -0800 Kees Cook wrote: > > On Fri, Nov 20, 2020 at 10:53:44AM -0800, Jakub Kicinski wrote: > > > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: > > > > This series aims to fix almost all

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Miguel Ojeda
Hi Gustavo, On Fri, Nov 20, 2020 at 7:21 PM Gustavo A. R. Silva wrote: > > Hi all, > > This series aims to fix almost all remaining fall-through warnings in > order to enable -Wimplicit-fallthrough for Clang. Thanks for this. Since this warning is reliable in both/all compilers and we are event

Re: [PATCH 004/141] drm/amdgpu: Fix fall-through warnings for Clang

2020-11-20 Thread Alex Deucher
On Fri, Nov 20, 2020 at 1:24 PM Gustavo A. R. Silva wrote: > > In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple > warnings by explicitly adding multiple break statements instead of just > letting the code fall through to the next case. > > Link: https://github.com/KSPP/linux

Re: [PATCH 005/141] drm/radeon: Fix fall-through warnings for Clang

2020-11-20 Thread Alex Deucher
On Fri, Nov 20, 2020 at 1:24 PM Gustavo A. R. Silva wrote: > > In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple > warnings by explicitly adding multiple fallthrough pseudo-keyword macros, > as replacement for /* fall through */ comments. > > Notice that Clang doesn't recogni

Re: [PATCH 028/141] drm/amd/display: Fix fall-through warnings for Clang

2020-11-20 Thread Alex Deucher
On Fri, Nov 20, 2020 at 1:28 PM Gustavo A. R. Silva wrote: > > In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple > warnings by explicitly adding multiple break statements instead of just > letting the code fall through to the next case. > > Link: https://github.com/KSPP/linux

Re: [PATCH 078/141] drm/amd/pm: Fix fall-through warnings for Clang

2020-11-20 Thread Alex Deucher
On Fri, Nov 20, 2020 at 1:35 PM Gustavo A. R. Silva wrote: > > In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple > of warnings by explicitly adding a break statement instead of letting > the code fall through to the next case, and a fallthrough pseudo-keyword > as a replaceme

[PATCH v3 00/12] RFC Support hot device unplug in amdgpu

2020-11-20 Thread Andrey Grodzovsky
Until now extracting a card either by physical extraction (e.g. eGPU with thunderbolt connection or by emulation through syfs -> /sys/bus/pci/devices/device_id/remove) would cause random crashes in user apps. The random crashes in apps were mostly due to the app having mapped a device backed B

[PATCH v3 01/12] drm: Add dummy page per device or GEM object

2020-11-20 Thread Andrey Grodzovsky
Will be used to reroute CPU mapped BO's page faults once device is removed. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/drm_file.c | 8 drivers/gpu/drm/drm_prime.c | 10 ++ include/drm/drm_file.h | 2 ++ include/drm/drm_gem.h | 2 ++ 4 files changed, 22 i

[PATCH v3 02/12] drm: Unamp the entire device address space on device unplug

2020-11-20 Thread Andrey Grodzovsky
Invalidate all BOs CPU mappings once device is removed. v3: Move the code from TTM into drm_dev_unplug Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/drm_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 13068fd..d550f

[PATCH v3 06/12] drm/sched: Cancel and flush all oustatdning jobs before finish.

2020-11-20 Thread Andrey Grodzovsky
To avoid any possible use after free. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/scheduler/sched_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index da24c4e..c3f0bd0 100644 --- a/drivers/gp

[PATCH v3 04/12] drm/ttm: Set dma addr to null after freee

2020-11-20 Thread Andrey Grodzovsky
Fixes oops. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index b40a467..b0df328 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/

[PATCH v3 03/12] drm/ttm: Remap all page faults to per process dummy page.

2020-11-20 Thread Andrey Grodzovsky
On device removal reroute all CPU mappings to dummy page per drm_file instance or imported GEM object. v3: Remove loop to find DRM file and instead access it by vma->vm_file->private_data. Move dummy page installation into a separate function. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/dr

[PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-20 Thread Andrey Grodzovsky
It's needed to drop iommu backed pages on device unplug before device's IOMMU group is released. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/ttm/ttm_tt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 1ccf1ef..29248a

[PATCH v3 08/12] drm/amdgpu: Split amdgpu_device_fini into early and late

2020-11-20 Thread Andrey Grodzovsky
Some of the stuff in amdgpu_device_fini such as HW interrupts disable and pending fences finilization must be done right away on pci_remove while most of the stuff which relates to finilizing and releasing driver data structures can be kept until drm_driver.release hook is called, i.e. when the las

[PATCH v3 09/12] drm/amdgpu: Add early fini callback

2020-11-20 Thread Andrey Grodzovsky
Use it to call disply code dependent on device->drv_data before it's set to NULL on device unplug Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 20 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++-- drivers/gpu/drm

[PATCH v3 10/12] drm/amdgpu: Avoid sysfs dirs removal post device unplug

2020-11-20 Thread Andrey Grodzovsky
Avoids NULL ptr due to kobj->sd being unset on device removal. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/am

[PATCH v3 07/12] drm/sched: Prevent any job recoveries after device is unplugged.

2020-11-20 Thread Andrey Grodzovsky
No point to try recovery if device is gone, it's meaningless. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_sched.c | 3 ++- drivers/gpu/drm/lima/lima_sched.c | 3 ++- drivers/gpu/drm/panfrost/panfrost_job.c

[PATCH v3 11/12] drm/amdgpu: Register IOMMU topology notifier per device.

2020-11-20 Thread Andrey Grodzovsky
Handle all DMA IOMMU gropup related dependencies before the group is removed. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 5 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 46 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2

[PATCH v3 12/12] drm/amdgpu: Fix a bunch of sdma code crash post device unplug

2020-11-20 Thread Andrey Grodzovsky
We can't allocate and submit IBs post device unplug. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index fdbe7