[PATCH RFC v3 3/7] drm/display: dp: use new DCPD access helpers

2025-03-06 Thread Dmitry Baryshkov
From: Dmitry Baryshkov Switch drm_dp_helper.c to use new set of DPCD read / write helpers. Reviewed-by: Lyude Paul Acked-by: Jani Nikula Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dp_helper.c | 296 +--- 1 file changed, 116 insertions(+), 180

[PATCH] drm/amdgpu: format old RAS eeprom data into V3 version

2025-03-06 Thread Tao Zhou
Clear old data and save it in V3 format. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 .../gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c| 26 ++- .../gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h| 1 + 3 files changed, 20 insertions(+), 12 deleti

Re: [PATCH v3 4/4] drm/amdgpu: fix warning and errors caused by duplicated defines in sid.h

2025-03-06 Thread Alexandre Demers
On Thu, Mar 6, 2025 at 10:17 AM Alex Deucher wrote: > > On Wed, Mar 5, 2025 at 8:57 PM Alexandre Demers > wrote: > > > > Let's finish the cleanup in sid.h to calm down things after wiring it into > > dce_v6_0.c. > > > > This is a bigger cleanup. > > Many defines found under sid.h have already bee

[PATCH RFC v3 2/7] drm/display: dp: change drm_dp_dpcd_read_link_status() return value

2025-03-06 Thread Dmitry Baryshkov
From: Dmitry Baryshkov drm_dp_dpcd_read_link_status() follows the "return error code or number of bytes read" protocol, with the code returning less bytes than requested in case of some errors. However most of the drivers interpreted that as "return error code in case of any error". Switch drm_dp

[PATCH RFC v3 7/7] drm/display: dp-tunnel: use new DCPD access helpers

2025-03-06 Thread Dmitry Baryshkov
From: Dmitry Baryshkov Switch drm_dp_tunnel.c to use new set of DPCD read / write helpers. Reviewed-by: Lyude Paul Acked-by: Jani Nikula Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dp_tunnel.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) d

[PATCH RFC v3 4/7] drm/display: dp-aux-dev: use new DCPD access helpers

2025-03-06 Thread Dmitry Baryshkov
From: Dmitry Baryshkov Switch drm_dp_aux_dev.c to use new set of DPCD read / write helpers. Acked-by: Jani Nikula Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dp_aux_dev.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/displ

[PATCH RFC v3 0/7] drm/display: dp: add new DPCD access functions

2025-03-06 Thread Dmitry Baryshkov
Existing DPCD access functions return an error code or the number of bytes being read / write in case of partial access. However a lot of drivers either (incorrectly) ignore partial access or mishandle error codes. In other cases this results in a boilerplate code which compares returned value with

[PATCH RFC v3 5/7] drm/display: dp-cec: use new DCPD access helpers

2025-03-06 Thread Dmitry Baryshkov
From: Dmitry Baryshkov Switch drm_dp_cec.c to use new set of DPCD read / write helpers. Reviewed-by: Lyude Paul Acked-by: Jani Nikula Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dp_cec.c | 37 ++-- 1 file changed, 18 insertions(+), 19 delet

[PATCH v3 3/3] drm/amdkfd: Add support for more per-process flag

2025-03-06 Thread Harish Kasiviswanathan
Add support for more per-process flags starting with option to configure MFMA precision for gfx 9.5 v2: Change flag name to KFD_PROC_FLAG_MFMA_HIGH_PRECISION Remove unused else condition v3: Bump the KFD API version Signed-off-by: Harish Kasiviswanathan Reviewed-by: Felix Kuehling --- driv

RE: [PATCH v4] drm/amdgpu: Fix the race condition for draining retry fault

2025-03-06 Thread Deng, Emily
[AMD Official Use Only - AMD Internal Distribution Only] From: Chen, Xiaogang Sent: Friday, March 7, 2025 1:01 AM To: Deng, Emily ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH v4] drm/amdgpu: Fix the race condition for draining retry fault Thanks for catch up and fix this race conditio

[PATCH] drm: amdkfd: Replace (un)register_chrdev() by (unregister/alloc)_chrdev_region()

2025-03-06 Thread Salah Triki
Replace (un)register_chrdev() by (unregister/alloc)_chrdev_region() as they are deprecated since kernel 2.6. alloc_chrdev_region() generates a dev_t value, so replace the kfd_char_dev_major int variable by the kfd_char_dev_id dev_t variable and drop the MKDEV() call. Initialize a cdev structure and

Re: [PATCH 05/11] drm/amdgpu/mes: update hqd masks when disable_kq is set

2025-03-06 Thread Khatri, Sunil
Reviewed-by: Sunil Khatri On 3/6/2025 2:17 AM, Alex Deucher wrote: Make all resources available to user queues. Suggested-by: Sunil Khatri Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/driv

Re: [PATCH 06/11] drm/amdgpu/mes: make more vmids available when disable_kq=1

2025-03-06 Thread Khatri, Sunil
Reviewed-by: Sunil Khatri On 3/6/2025 2:17 AM, Alex Deucher wrote: If we don't have kernel queues, the vmids can be used by the MES for user queues. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 +- drivers/gpu/

Re: [PATCH 03/11] drm/amdgpu/gfx: add generic handling for disable_kq

2025-03-06 Thread Khatri, Sunil
On 3/6/2025 6:36 AM, Felix Kuehling wrote: On 2025-03-05 15:47, Alex Deucher wrote: Add proper checks for disable_kq functionality in gfx helper functions.  Add special logic for families that require the clear state setup. Signed-off-by: Alex Deucher ---   drivers/gpu/drm/amd/amdgpu/amdgpu

Re: [PATCH] drm/amdgpu: Fix annotation for dce_v6_0_line_buffer_adjust function

2025-03-06 Thread Alex Deucher
On Wed, Mar 5, 2025 at 11:45 AM Srinivasan Shanmugam wrote: > > Updated description for the 'other_mode' parameter. This parameter is > used to determine the display mode of another display controller that > may be sharing the line buffer. > > Cc: Ken Wang > Cc: Christian König > Cc: Alex Deuche

Re: [PATCH 11/11] drm/amdgpu/sdma7: add support for disable_kq

2025-03-06 Thread Khatri, Sunil
Reviewed-by: Sunil Khatri On 3/6/2025 2:17 AM, Alex Deucher wrote: When the parameter is set, disable user submissions to kernel queues. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

Re: [PATCH] drm/amdgpu/vcn: fix idle work handler for VCN 2.5

2025-03-06 Thread Alex Deucher
Ping? Thanks, Alex On Wed, Mar 5, 2025 at 2:42 PM Alex Deucher wrote: > > VCN 2.5 uses the PG callback to enable VCN DPM which is > a global state. As such, we need to make sure all instances > are in the same state. > > v2: switch to a ref count (Lijo) > v3: switch to its own idle work handle

Re: [PATCH v3 1/4] drm/amdgpu: add or move defines for DCE6 in sid.h

2025-03-06 Thread Alex Deucher
On Wed, Mar 5, 2025 at 9:08 PM Alexandre Demers wrote: > > For coherence with DCE8 et DCE10, add or move some values under sid.h. > > Signed-off-by: Alexandre Demers This change doesn't build. Please adjust the order of the patches as needed to make sure they all build. Alex > --- > drivers/

Re: [PATCH v3 2/4] drm/amdgpu: add defines for pin_offsets in DCE8

2025-03-06 Thread Alex Deucher
Applied. Thanks. On Wed, Mar 5, 2025 at 9:08 PM Alexandre Demers wrote: > > Define pin_offsets values in the same way it is done in DCE8 > > Signed-off-by: Alexandre Demers > --- > drivers/gpu/drm/amd/amdgpu/cikd.h | 9 + > drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 14 +++---

Re: [PATCH 08/11] drm/amdgpu/gfx12: add support for disable_kq

2025-03-06 Thread Khatri, Sunil
Reviewed-by: Sunil Khatri On 3/6/2025 2:17 AM, Alex Deucher wrote: Plumb in support for disabling kernel queues. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 114 ++--- 1 file changed, 65 insertions(+), 49 deletions(-) diff --git a/drivers/g

Re: [PATCH 10/11] drm/amdgpu/sdma6: add support for disable_kq

2025-03-06 Thread Khatri, Sunil
Reviewed-by: Sunil Khatri On 3/6/2025 2:17 AM, Alex Deucher wrote: When the parameter is set, disable user submissions to kernel queues. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

Re: [PATCH 09/11] drm/amdgpu/sdma: add flag for tracking disable_kq

2025-03-06 Thread Khatri, Sunil
Reviewed-by: Sunil Khatri On 3/6/2025 2:17 AM, Alex Deucher wrote: For SDMA, we still need kernel queues for paging so they need to be initialized, but we no not want to accept submissions from userspace when disable_kq is set. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdg

[PATCH] drm/amd/display: fix missing .is_two_pixels_per_container

2025-03-06 Thread Aliaksei Urbanski
Starting from 6.11, AMDGPU driver, while being loaded with amdgpu.dc=1, due to lack of .is_two_pixels_per_container function in dce60_tg_funcs, causes a NULL pointer dereference on PCs with old GPUs, such as R9 280X. So this fix adds missing .is_two_pixels_per_container to dce60_tg_funcs. Reporte

Re: [PATCH v4] drm/amdgpu: Fix the race condition for draining retry fault

2025-03-06 Thread Felix Kuehling
On 2025-03-06 1:03, Emily Deng wrote: > Issue: > In the scenario where svm_range_restore_pages is called, but > svm->checkpoint_ts > has not been set and the retry fault has not been drained, > svm_range_unmap_from_cpu > is triggered and calls svm_range_free. Meanwhile, svm_range_restore_pages

[PATCH] drm/amdgpu: add initial documentation for debugfs files

2025-03-06 Thread Alex Deucher
Describes what debugfs files are available and what they are used for. v2: fix some typos (Mark Glines) v3: Address comments from Siqueira and Kent Signed-off-by: Alex Deucher --- Documentation/gpu/amdgpu/debugfs.rst | 210 + Documentation/gpu/amdgpu/debugging.rst |

[PATCH 3/3] drm/amdkfd: Add support for more per-process flag

2025-03-06 Thread Amber Lin
From: Harish Kasiviswanathan Add support for more per-process flags starting with option to configure MFMA precision for gfx 9.5 v2: Change flag name to KFD_PROC_FLAG_MFMA_HIGH_PRECISION Remove unused else condition Signed-off-by: Harish Kasiviswanathan Reviewed-by: Felix Kuehling --- dr

[PATCH 1/3] drm/amdkfd: Set per-process flags only once cik/vi

2025-03-06 Thread Amber Lin
From: Harish Kasiviswanathan Set per-process static sh_mem config only once during process initialization. Move all static changes from update_qpd() which is called each time a queue is created to set_cache_memory_policy() which is called once during process initialization. set_cache_memory_poli

[PATCH 2/3] drm/amdkfd: Set per-process flags only once for gfx9/10/11/12

2025-03-06 Thread Amber Lin
From: Harish Kasiviswanathan Define set_cache_memory_policy() for these asics and move all static changes from update_qpd() which is called each time a queue is created to set_cache_memory_policy() which is called once during process initialization Signed-off-by: Harish Kasiviswanathan --- ...

Re: [PATCH 02/11] drm/amdgpu: add ring flag for no user submissions

2025-03-06 Thread Alex Deucher
On Thu, Mar 6, 2025 at 2:48 AM Khatri, Sunil wrote: > > > On 3/6/2025 2:17 AM, Alex Deucher wrote: > > This would be set by IPs which only accept submissions > > from the kernel, not userspace, such as when kernel > > queues are disabled. Don't expose the rings to userspace > > and reject any subm

Re: [PATCH v2] drm/amd: Fail initialization earlier when DC is disabled

2025-03-06 Thread Mario Limonciello
On 3/6/2025 14:11, Alex Deucher wrote: On Thu, Mar 6, 2025 at 2:31 PM Mario Limonciello wrote: On 3/6/2025 13:19, Alex Deucher wrote: On Thu, Mar 6, 2025 at 1:58 PM Mario Limonciello wrote: Modern APU and dGPU require DC support to be able to light up the display. If DC support has been d

Re: [PATCH v2] drm/amd: Fail initialization earlier when DC is disabled

2025-03-06 Thread Alex Deucher
On Thu, Mar 6, 2025 at 2:31 PM Mario Limonciello wrote: > > On 3/6/2025 13:19, Alex Deucher wrote: > > On Thu, Mar 6, 2025 at 1:58 PM Mario Limonciello > > wrote: > >> > >> Modern APU and dGPU require DC support to be able to light up the > >> display. If DC support has been disabled either by k

[PATCH 08/11] drm/amdgpu/gfx12: add support for disable_kq

2025-03-06 Thread Alex Deucher
Plumb in support for disabling kernel queues. v2: use ring counts per Felix' suggestion Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 96 -- 1 file changed, 58 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c

Re: [PATCH v4 1/3] drm/amdkfd: Set per-process flags only once cik/vi

2025-03-06 Thread Amber Lin
Reviewed-by: Amber Lin Regards, Amber On 3/6/25 14:52, Harish Kasiviswanathan wrote: Set per-process static sh_mem config only once during process initialization. Move all static changes from update_qpd() which is called each time a queue is created to set_cache_memory_policy() which is called

[PATCH v3] drm/amd: Fail initialization earlier when DC is disabled

2025-03-06 Thread Mario Limonciello
Modern APU and dGPU require DC support to be able to light up the display. If DC support has been disabled either by kernel config or by kernel command line the screen will visibly freeze when the driver finishes early init. As it's known before early init is done whether DC support is required d

Re: [PATCH v4 2/3] drm/amdkfd: Set per-process flags only once for gfx9/10/11/12

2025-03-06 Thread Amber Lin
Reviewed-by: Amber Lin Regards, Amber On 3/6/25 14:52, Harish Kasiviswanathan wrote: Define set_cache_memory_policy() for these asics and move all static changes from update_qpd() which is called each time a queue is created to set_cache_memory_policy() which is called once during process init

Re: [PATCH 0/4] drm/amd/display: move from kzalloc(size * nr, ...) to kcalloc(nr, size, ...)

2025-03-06 Thread Alex Hung
This series LGTM too. Reviewed-by: Alex Hung On 2/27/25 16:16, Ethan Carter Edwards wrote: We are trying to get rid of all multiplications from allocation functions to prevent integer overflows. Here the multiplications are probably safe, but using kcalloc() is more appropriate and improves re

[PATCH V2 00/11] Add disable kernel queue support

2025-03-06 Thread Alex Deucher
To better evaluate user queues, add a module parameter to disable kernel queues. With this set kernel queues are disabled and only user queues are available. This frees up hardware resources for use in user queues which would otherwise be used by kernel queues and provides a way to validate user

[PATCH 10/11] drm/amdgpu/sdma6: add support for disable_kq

2025-03-06 Thread Alex Deucher
When the parameter is set, disable user submissions to kernel queues. Reviewed-by: Sunil Khatri Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdm

[PATCH 02/11] drm/amdgpu: add ring flag for no user submissions

2025-03-06 Thread Alex Deucher
This would be set by IPs which only accept submissions from the kernel, not userspace, such as when kernel queues are disabled. Don't expose the rings to userspace and reject any submissions in the CS IOCTL. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 driv

[PATCH 06/11] drm/amdgpu/mes: make more vmids available when disable_kq=1

2025-03-06 Thread Alex Deucher
If we don't have kernel queues, the vmids can be used by the MES for user queues. Reviewed-by: Sunil Khatri Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 2 +- 3 files cha

[PATCH 05/11] drm/amdgpu/mes: update hqd masks when disable_kq is set

2025-03-06 Thread Alex Deucher
Make all resources available to user queues. Suggested-by: Sunil Khatri Reviewed-by: Sunil Khatri Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers

[PATCH 09/11] drm/amdgpu/sdma: add flag for tracking disable_kq

2025-03-06 Thread Alex Deucher
For SDMA, we still need kernel queues for paging so they need to be initialized, but we no not want to accept submissions from userspace when disable_kq is set. Reviewed-by: Sunil Khatri Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 1 + 1 file changed, 1 insertion(

[PATCH] drm/amd: Keep display off while going into S4

2025-03-06 Thread Mario Limonciello
When userspace invokes S4 the flow is: 1) amdgpu_pmops_prepare() 2) amdgpu_pmops_freeze() 3) Create hibernation image 4) amdgpu_pmops_thaw() 5) Write out image to disk 6) Turn off system Then on resume amdgpu_pmops_restore() is called. This flow has a problem that because amdgpu_pmops_thaw() is

Re: [PATCH] drm/amd/amdgpu: Add missing GC 11.5.0 register

2025-03-06 Thread Alex Deucher
On Thu, Mar 6, 2025 at 1:20 PM Tom St Denis wrote: > > Adds register needed for debugging purposes. > > Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/include/asic_reg/gc/gc_11_5_0_offset.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/g

[PATCH 01/11] drm/amdgpu: add parameter to disable kernel queues

2025-03-06 Thread Alex Deucher
On chips that support user queues, setting this option will disable kernel queues to be used to validate user queues without kernel queues. Reviewed-by: Sunil Khatri Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 9 ++

Re: [PATCH v2] drm/amd: Fail initialization earlier when DC is disabled

2025-03-06 Thread Alex Deucher
On Thu, Mar 6, 2025 at 1:58 PM Mario Limonciello wrote: > > Modern APU and dGPU require DC support to be able to light up the > display. If DC support has been disabled either by kernel config > or by kernel command line the screen will visibly freeze when the > driver finishes early init. > > As

Re: [PATCH v2] drm/amd: Fail initialization earlier when DC is disabled

2025-03-06 Thread Mario Limonciello
On 3/6/2025 13:19, Alex Deucher wrote: On Thu, Mar 6, 2025 at 1:58 PM Mario Limonciello wrote: Modern APU and dGPU require DC support to be able to light up the display. If DC support has been disabled either by kernel config or by kernel command line the screen will visibly freeze when the d

[pull] amdgpu, amdkfd, radeon drm-fixes-6.14

2025-03-06 Thread Alex Deucher
Hi Dave, Simona, Fixes for 6.14. The following changes since commit 7eb172143d5508b4da468ed59ee857c6e5e01da6: Linux 6.14-rc5 (2025-03-02 11:48:20 -0800) are available in the Git repository at: https://gitlab.freedesktop.org/agd5f/linux.git tags/amd-drm-fixes-6.14-2025-03-06 for you to fe

[PATCH] drm/amdkfd: clear F8_MODE for gfx950

2025-03-06 Thread Amber Lin
From: Alex Sierra Default F8_MODE should be OCP format on gfx950. Signed-off-by: Alex Sierra Reviewed-by: Harish Kasiviswanathan Signed-off-by: Amber Lin --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

[PATCH] drm/amd/amdgpu: Add missing GC 11.5.0 register

2025-03-06 Thread Tom St Denis
Adds register needed for debugging purposes. Signed-off-by: Tom St Denis --- drivers/gpu/drm/amd/include/asic_reg/gc/gc_11_5_0_offset.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/include/asic_reg/gc/gc_11_5_0_offset.h b/drivers/gpu/drm/amd/include/asic_reg/gc/gc_1

[PATCH v3 2/3] drm/amdkfd: Set per-process flags only once for gfx9/10/11/12

2025-03-06 Thread Harish Kasiviswanathan
Define set_cache_memory_policy() for these asics and move all static changes from update_qpd() which is called each time a queue is created to set_cache_memory_policy() which is called once during process initialization Signed-off-by: Harish Kasiviswanathan --- .../amd/amdkfd/kfd_device_queue_ma

[PATCH v4 3/3] drm/amdkfd: Add support for more per-process flag

2025-03-06 Thread Harish Kasiviswanathan
Add support for more per-process flags starting with option to configure MFMA precision for gfx 9.5 v2: Change flag name to KFD_PROC_FLAG_MFMA_HIGH_PRECISION Remove unused else condition v3: Bump the KFD API version v4: Missed SH_MEM_CONFIG__PRECISION_MODE__SHIFT define. Added it. Signed-off-

[PATCH v4 2/3] drm/amdkfd: Set per-process flags only once for gfx9/10/11/12

2025-03-06 Thread Harish Kasiviswanathan
Define set_cache_memory_policy() for these asics and move all static changes from update_qpd() which is called each time a queue is created to set_cache_memory_policy() which is called once during process initialization Signed-off-by: Harish Kasiviswanathan --- .../amd/amdkfd/kfd_device_queue_ma