Re: [PATCH] drm/amd/display: use vmalloc for struct dc_state

2024-06-26 Thread Mario Limonciello
On 6/26/2024 16:45, Alex Deucher wrote: This is a big structure so use vmalloc as malloc can fail when there is memory pressure. vmalloc can be a bit slower, but I think it's fine for this context and better to handle memory pressure more nicely. Reviewed-by: Mario Limonciello Closes: ht

Re: [PATCH v2] drm/amd/display: Fix null pointer deref in dcn20_resource.c

2024-06-26 Thread Rodrigo Siqueira Jordao
On 6/26/24 4:28 PM, Aurabindo Pillai wrote: Changes in v2: detailed description about the how the issue is reproduced, and remove an extraneous else keyword. Just remove this 'Changes in v2' part, with this change: Reviewed-by: Rodrigo Siqueira Fixes a hang thats triggered when MPV is r

[PATCH v2] drm/amd/display: Fix null pointer deref in dcn20_resource.c

2024-06-26 Thread Aurabindo Pillai
Changes in v2: detailed description about the how the issue is reproduced, and remove an extraneous else keyword. Fixes a hang thats triggered when MPV is run on a DCN401 dGPU: mpv --hwdec=vaapi --vo=gpu --hwdec-codecs=all and then enabling fullscreen playback (double click on the video) The fo

[pull] amdgpu drm-fixes-6.10

2024-06-26 Thread Alex Deucher
Hi Dave, Sima, Fixes for 6.10. The following changes since commit f2661062f16b2de5d7b6a5c42a9a5c96326b8454: Linux 6.10-rc5 (2024-06-23 17:08:54 -0400) are available in the Git repository at: https://gitlab.freedesktop.org/agd5f/linux.git tags/amd-drm-fixes-6.10-2024-06-26 for you to fetc

[PATCH] drm/amd/display: use vmalloc for struct dc_state

2024-06-26 Thread Alex Deucher
This is a big structure so use vmalloc as malloc can fail when there is memory pressure. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3454 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletion

Re: [PATCH 07/13] drm/amdgpu: add amdgpu_framebuffer::gfx12_dcc

2024-06-26 Thread Alex Deucher
On Wed, Jun 26, 2024 at 2:42 PM Marek Olšák wrote: > > amdgpu_framebuffer doesn't have tiling_flags, so we need this. Maybe move this patch before patch 13? It took me a while to see where this was used. Either that or maybe mention where it will get used in the later patch. With that fixed, th

Re: [PATCH 05/13] drm/amdgpu: remove AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_* definitions

2024-06-26 Thread Aurabindo Pillai
Reviewed-by: Aurabindo Pillai On 6/26/24 2:31 PM, Marek Olšák wrote: They were added accidentally. Signed-off-by: Marek Olšák --- include/uapi/drm/drm_fourcc.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index d0063ac6

Re: [PATCH 13/13] drm/amdgpu: rewrite convert_tiling_flags_to_modifier_gfx12

2024-06-26 Thread Aurabindo Pillai
Reviewed-by: Aurabindo Pillai On 6/26/24 2:31 PM, Marek Olšák wrote: There were multiple bugs, like checking SWIZZLE_MODE before checking GFX12_SWIZZLE_MODE, which has undefined behavior. The function had no effect before (it always returned -EINVAL). Signed-off-by: Marek Olšák --- drivers

Re: [PATCH 12/13] drm/amdgpu/display: add all gfx12 modifiers

2024-06-26 Thread Aurabindo Pillai
Reviewed-by: Aurabindo Pillai On 6/26/24 2:31 PM, Marek Olšák wrote: Signed-off-by: Marek Olšák --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

Re: [PATCH 11/13] drm/amdgpu/display: set plane attributes for gfx12 correctly

2024-06-26 Thread Aurabindo Pillai
On 6/26/24 2:31 PM, Marek Olšák wrote: It used gfx9 flags, which has undefined behavior on gfx12. Signed-off-by: Marek Olšák --- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 50 ++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/displa

Re: [PATCH 10/13] drm/amdgpu/display: handle gfx12 in amdgpu_dm_plane_format_mod_supported

2024-06-26 Thread Aurabindo Pillai
Reviewed-by: Aurabindo Pillai On 6/26/24 2:31 PM, Marek Olšák wrote: All this code has undefined behavior on GFX12 and shouldn't be executed. Signed-off-by: Marek Olšák --- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 47 ++- 1 file changed, 25 insertions(+), 22 deletion

Re: [PATCH 06/13] drm/amdgpu/display: handle gfx12 in dm_check_cursor_fb

2024-06-26 Thread Aurabindo Pillai
Reviewed-by: Aurabindo Pillai On 6/26/24 2:31 PM, Marek Olšák wrote: Checking SWIZZLE_MODE has undefined behavior on gfx12. Signed-off-by: Marek Olšák --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/g

Re: [PATCH] drm/amdgpu/jpeg5: Add support for DPG mode

2024-06-26 Thread David Wu
On 2024-06-24 13:58, Sonny Jiang wrote: From: Sonny Jiang Add DPG support for JPEG 5.0 Signed-off-by: Sonny Jiang Reviewed-by: David (Ming Qiang) Wu tested fine as well - thanks! --- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 31 + drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 159

Re: [PATCH] drm/amd/display: Fix null pointer deref in dcn20_resource.c

2024-06-26 Thread Rodrigo Siqueira Jordao
On 6/26/24 11:16 AM, Aurabindo Pillai wrote: Fixes a hang that has the following calltrace: [ 181.843989] BUG: kernel NULL pointer dereference, address: [ 181.843997] #PF: supervisor instruction fetch in kernel mode [ 181.844003] #PF: error_code(0x0010) - not-present page

[PATCH 12/13] drm/amdgpu/display: add all gfx12 modifiers

2024-06-26 Thread Marek Olšák
Signed-off-by: Marek Olšák --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index e13938e01b7

[PATCH 13/13] drm/amdgpu: rewrite convert_tiling_flags_to_modifier_gfx12

2024-06-26 Thread Marek Olšák
There were multiple bugs, like checking SWIZZLE_MODE before checking GFX12_SWIZZLE_MODE, which has undefined behavior. The function had no effect before (it always returned -EINVAL). Signed-off-by: Marek Olšák --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 45 + 1 file ch

[PATCH 10/13] drm/amdgpu/display: handle gfx12 in amdgpu_dm_plane_format_mod_supported

2024-06-26 Thread Marek Olšák
All this code has undefined behavior on GFX12 and shouldn't be executed. Signed-off-by: Marek Olšák --- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 47 ++- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

[PATCH 09/13] drm/amdgpu: handle gfx12 in amdgpu_display_verify_sizes

2024-06-26 Thread Marek Olšák
It verified GFX9-11 swizzle modes on GFX12, which has undefined behavior. Signed-off-by: Marek Olšák --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 27 - include/uapi/drm/drm_fourcc.h | 2 ++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/dri

[PATCH 08/13] drm/amdgpu: don't use amdgpu_lookup_format_info on gfx12

2024-06-26 Thread Marek Olšák
It only uses fields for GFX9-11 related to the separate DCC buffer, which doesn't exist in GFX12. Signed-off-by: Marek Olšák --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/

[PATCH 07/13] drm/amdgpu: add amdgpu_framebuffer::gfx12_dcc

2024-06-26 Thread Marek Olšák
amdgpu_framebuffer doesn't have tiling_flags, so we need this. amdgpu_display_get_fb_info never gets NULL parameters, so checking for NULL was useless. Signed-off-by: Marek Olšák --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 15 --- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h|

[PATCH 11/13] drm/amdgpu/display: set plane attributes for gfx12 correctly

2024-06-26 Thread Marek Olšák
It used gfx9 flags, which has undefined behavior on gfx12. Signed-off-by: Marek Olšák --- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 50 ++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/d

[PATCH 06/13] drm/amdgpu/display: handle gfx12 in dm_check_cursor_fb

2024-06-26 Thread Marek Olšák
Checking SWIZZLE_MODE has undefined behavior on gfx12. Signed-off-by: Marek Olšák --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amd

[PATCH 05/13] drm/amdgpu: remove AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_* definitions

2024-06-26 Thread Marek Olšák
They were added accidentally. Signed-off-by: Marek Olšák --- include/uapi/drm/drm_fourcc.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index d0063ac6e09f..4168445fbb8b 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include

[PATCH 03/13] drm/amdgpu/gfx12: remove superfluous cache flags

2024-06-26 Thread Marek Olšák
If any INV flags are needed, they should be executed via ACQUIRE_MEM before INDIRECT_BUFFER. GLM flags are also removed because the hw ignores them. Signed-off-by: Marek Olšák Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 6 -- 1 file changed, 6 deletions(-) diff

[PATCH 04/13] drm/amdgpu/gfx12: remove GDS leftovers

2024-06-26 Thread Marek Olšák
GDS doesn't exist in gfx12. The incomplete packet allows userspace to hang the hw from the kernel. Signed-off-by: Marek Olšák Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 16 1 file changed, 16 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_

[PATCH 02/13] drm/amdgpu/gfx11: remove superfluous cache flags

2024-06-26 Thread Marek Olšák
If any INV flags are needed, they should be executed via ACQUIRE_MEM before INDIRECT_BUFFER. Signed-off-by: Marek Olšák Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v1

[PATCH 01/13] drm/amdgpu: check for LINEAR_ALIGNED correctly in check_tiling_flags_gfx6

2024-06-26 Thread Marek Olšák
Signed-off-by: Marek Olšák --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index cfec85563bc6..3c5fb907bdd9 100644 --- a/drivers/gpu/drm

Re: [PATCH] drm/amd/display: Add null check before access structs

2024-06-26 Thread Aurabindo Pillai
Thanks for the fix, I'll apply this. On 6/26/24 9:06 AM, Ma Ke wrote: In enable_phantom_plane, we should better check null pointer before accessing various structs. Fixes: 09a4ec5da92c ("drm/amd/display: Refactor dc_state interface") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/dm

[PATCH] drm/amd/display: Fix null pointer deref in dcn20_resource.c

2024-06-26 Thread Aurabindo Pillai
Fixes a hang that has the following calltrace: [ 181.843989] BUG: kernel NULL pointer dereference, address: [ 181.843997] #PF: supervisor instruction fetch in kernel mode [ 181.844003] #PF: error_code(0x0010) - not-present page [ 181.844009] PGD 0 P4D 0 [ 181.844020] Oops: 00

Re: [PATCH 1/3] drm/dp_mst: Fix all mstb marked as not probed after suspend/resume

2024-06-26 Thread Lyude Paul
Thanks! Reviewed-by: Lyude Paul On Wed, 2024-06-26 at 16:48 +0800, Wayne Lin wrote: > [Why] > After supend/resume, with topology unchanged, observe that > link_address_sent of all mstb are marked as false even the topology > probing > is done without any error. > > It is caused by wrongly also

Re: [PATCH 2/3] drm/dp_mst: Skip CSN if topology probing is not done yet

2024-06-26 Thread Lyude Paul
Some comments down below: On Wed, 2024-06-26 at 16:48 +0800, Wayne Lin wrote: > [Why] > During resume, observe that we receive CSN event before we start > topology > probing. Handling CSN at this moment based on uncertain topology is > unnecessary. > > [How] > Add checking condition in drm_dp_mst

Re: [PATCH v5] drm/display: split DSC helpers from DP helpers

2024-06-26 Thread Thomas Zimmermann
Hi Am 23.06.24 um 00:44 schrieb Dmitry Baryshkov: Currently the DRM DSC functions are selected by the DRM_DISPLAY_DP_HELPER Kconfig symbol. This is not optimal, since the DSI code (both panel and host drivers) end up selecting the seemingly irrelevant DP helpers. Split the DSC code to be guarded

Re: [PATCH v5] drm/display: split DSC helpers from DP helpers

2024-06-26 Thread Rodrigo Vivi
On Sun, Jun 23, 2024 at 01:44:19AM +0300, Dmitry Baryshkov wrote: > Currently the DRM DSC functions are selected by the > DRM_DISPLAY_DP_HELPER Kconfig symbol. This is not optimal, since the DSI > code (both panel and host drivers) end up selecting the seemingly > irrelevant DP helpers. Split the D

[PATCH v2] drm/amdkfd: Correct svm prange overlapping handling at svm_range_set_attr ioctl

2024-06-26 Thread Xiaogang . Chen
From: Xiaogang Chen When user adds new vm range that has overlapping with existing svm pranges current kfd creats a cloned pragne and split it, then replaces original prange by it. That destroy original prange locks and the cloned prange locks do not inherit original prange lock contexts. This ma

Re: [PATCH v3 0/7] drm/radeon: remove load callback

2024-06-26 Thread Thomas Zimmermann
Hi Am 24.06.24 um 17:10 schrieb Wu Hoi Pok: Changes between v1 and v3: 1. add "ddev->dev_private = rdev;" 2. include a cover letter A cover letter should briefly say what the patchset is about. BTW it's not clear to me why you need to modify radeon_dev.dev for removing the load callback. It

Re: [PATCH v3 2/7] drm/radeon: rdev->ddev to rdev_to_drm(rdev) 1

2024-06-26 Thread Thomas Zimmermann
Hi please squash patches 2 to 7 into a single patch that goes first. Am 24.06.24 um 17:10 schrieb Wu Hoi Pok: Please refer to patch 1. That's not a commit message. Once a patchset landed, no one will know what patch 1 was. Best regards Thomas Signed-off-by: Wu Hoi Pok --- drivers/gpu

Re: [PATCH v3 1/7] drm/radeon: remove load callback

2024-06-26 Thread Thomas Zimmermann
Hi Am 24.06.24 um 17:10 schrieb Wu Hoi Pok: Remove ".load" callback form "kms_driver", and move "struct drm_device" into radeon_device. Patch 2 to 7 follows up with changing the way of accessing drm_device, from "rdev->ddev" to "rdev_to_drm(rdev)" which is "&rdev->ddev". This is not going to b

Re: [PATCH v2] drm/radeon: check bo_va->bo is non-NULL before using it

2024-06-26 Thread Alex Deucher
On Wed, Jun 26, 2024 at 6:54 AM Christian König wrote: > > Am 25.06.24 um 19:44 schrieb Alex Deucher: > > On Tue, Jun 25, 2024 at 10:32 AM Pierre-Eric Pelloux-Prayer > > wrote: > >> The call to radeon_vm_clear_freed might clear bo_va->bo, so > >> we have to check it before dereferencing it. > >>

Re: [PATCH] drm/radeon: fix null pointer dereference in radeon_add_common_modes

2024-06-26 Thread Markus Elfring
> In radeon_add_common_modes(), the return value of drm_cvt_mode() is > assigned to mode, which will lead to a possible NULL pointer dereference > on failure of drm_cvt_mode(). Add a check to avoid npd. 1. Can a wording approach (like the following) be a better change description? A null point

[PATCH] drm/amd/display: Add null check before access structs

2024-06-26 Thread Ma Ke
In enable_phantom_plane, we should better check null pointer before accessing various structs. Fixes: 09a4ec5da92c ("drm/amd/display: Refactor dc_state interface") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [PATCH v2] drm/radeon: check bo_va->bo is non-NULL before using it

2024-06-26 Thread Christian König
Am 25.06.24 um 19:44 schrieb Alex Deucher: On Tue, Jun 25, 2024 at 10:32 AM Pierre-Eric Pelloux-Prayer wrote: The call to radeon_vm_clear_freed might clear bo_va->bo, so we have to check it before dereferencing it. Signed-off-by: Pierre-Eric Pelloux-Prayer Acked-by: Alex Deucher Should I

[PATCH 3/3] drm/amd/display: Solve mst monitors blank out problem after resume

2024-06-26 Thread Wayne Lin
[Why] In dm resume, we firstly restore dc state and do the mst resume for topology probing thereafter. If we change dpcd DP_MSTM_CTRL value after LT in mst reume, it will cause light up problem on the hub. [How] Revert the commit 202dc359adda ("drm/amd/display: Defer handling mst up request in res

[PATCH 2/3] drm/dp_mst: Skip CSN if topology probing is not done yet

2024-06-26 Thread Wayne Lin
[Why] During resume, observe that we receive CSN event before we start topology probing. Handling CSN at this moment based on uncertain topology is unnecessary. [How] Add checking condition in drm_dp_mst_handle_up_req() to skip handling CSN if the topology is yet to be probed. Cc: Lyude Paul Cc:

[PATCH 1/3] drm/dp_mst: Fix all mstb marked as not probed after suspend/resume

2024-06-26 Thread Wayne Lin
[Why] After supend/resume, with topology unchanged, observe that link_address_sent of all mstb are marked as false even the topology probing is done without any error. It is caused by wrongly also include "ret == 0" case as a probing failure case. [How] Remove inappropriate checking conditions.

[PATCH 0/3] Fix mst daisy chain light up issue after resume

2024-06-26 Thread Wayne Lin
Under DP mst daisy chain configuration, unplug one chained monitor during suspend and then resume, observe left connected monitor not light up. After analyzing, seems it's due to changing dpcd DP_MSTM_CTRL value after LT during reume. We used to defer handling UP request by disabling DP_UP_REQ_EN

Re: [PATCH 1/6] drm/amdgpu: allow ioctls to opt-out of runtime pm

2024-06-26 Thread Daniel Vetter
On Tue, Jun 25, 2024 at 09:07:12AM +0200, Pierre-Eric Pelloux-Prayer wrote: > > Le 20/06/2024 à 15:36, Christian König a écrit : > > Am 20.06.24 um 15:06 schrieb Pierre-Eric Pelloux-Prayer: > > > Le 19/06/2024 à 11:26, Christian König a écrit : > > > > Am 18.06.24 um 17:23 schrieb Pierre-Eric Pell

[PATCH] drm/radeon: fix null pointer dereference in radeon_add_common_modes

2024-06-26 Thread Ma Ke
In radeon_add_common_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/radeon/radeon_connectors.c | 2 ++ 1 file changed, 2 inser