RE: [PATCH] drm/amdgpu: fix vbios fetching for SR-IOV

2024-09-25 Thread Wang, Yang(Kevin)
[AMD Official Use Only - AMD Internal Distribution Only] Reviewed-by: Yang Wang Tested-by: Yang Wang Best Regards, Kevin -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: 2024年9月26日 2:20 To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: [PATCH] drm/amdg

Re: [PATCH 0/7] Add support for dynamic NPS switch

2024-09-25 Thread Lazar, Lijo
Thanks, Lijo On 9/24/2024 11:26 AM, Lijo Lazar wrote: > This series adds supports for dynamic NPS switch on GC v9.4.3/9.4.4 SOC > variants. > > In order to do dynamic NPS switch a sysfs interface is provided to request a > new > NPS mode. If the device is part of a hive, all hive devices are

RE: [PATCH 4/4] drm/amdgpu/sdma5.2: implement ring reset callback for sdma5.2

2024-09-25 Thread Zhu, Jiadong
[AMD Official Use Only - AMD Internal Distribution Only] > -Original Message- > From: Alex Deucher > Sent: Tuesday, September 24, 2024 9:41 PM > To: Zhu, Jiadong > Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander > > Subject: Re: [PATCH 4/4] drm/amdgpu/sdma5.2: implement ring reset

[PATCH v2 02/08] drm/amdgpu: screen freeze and userq driver crash

2024-09-25 Thread Arunpravin Paneer Selvam
Screen freeze and userq fence driver crash while playing Xonotic v2: (Christian) - There is change that fence might signal in between testing and grabbing the lock. Hence we can move the lock above the if..else check and use the dma_fence_is_signaled_locked(). Signed-off-by: Arunp

[PATCH v2 01/08] drm/amdgpu: Implement userqueue signal/wait IOCTL

2024-09-25 Thread Arunpravin Paneer Selvam
This patch introduces new IOCTL for userqueue secure semaphore. The signal IOCTL called from userspace application creates a drm syncobj and array of bo GEM handles and passed in as parameter to the driver to install the fence into it. The wait IOCTL gets an array of drm syncobjs, finds the fence

[PATCH v2 04/08] drm/amdgpu: Enable userq fence interrupt support

2024-09-25 Thread Arunpravin Paneer Selvam
Add support to handle the userqueue protected fence signal hardware interrupt. Create a xarray which maps the doorbell index to the fence driver address. This would help to retrieve the fence driver information when an userq fence interrupt is triggered. Firmware sends the doorbell offset value an

[PATCH v2 03/08] drm/amdgpu: Add wait IOCTL timeline syncobj support

2024-09-25 Thread Arunpravin Paneer Selvam
Add user fence wait IOCTL timeline syncobj support. v2:(Christian) - handle dma_fence_wait() return value. - shorten the variable name syncobj_timeline_points a bit. - move num_points up to avoid padding issues. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_use

[PATCH v2 06/08] drm/amdgpu: Add few optimizations to userq fence driver

2024-09-25 Thread Arunpravin Paneer Selvam
Add few optimizations to userq fence driver. v1:(Christian): - Remove unnecessary comments. - In drm_exec_init call give num_bo_handles as last parameter it would making allocation of the array more efficient - Handle return value of __xa_store() and improve the error handling of amd

[PATCH v2 05/08] drm/amdgpu: Remove the MES self test

2024-09-25 Thread Arunpravin Paneer Selvam
Remove MES self test as this conflicts the userqueue fence interrupts. v2:(Christian) - remove the amdgpu_mes_self_test() function and any now unused code. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 - drivers/gpu/dr

[PATCH v2 08/08] drm/amdgpu: add vm root BO lock before accessing the vm

2024-09-25 Thread Arunpravin Paneer Selvam
Add a vm root BO lock before accessing the userqueue VM. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/g

[PATCH v2 07/08] drm/amdgpu: Add the missing error handling for xa_store() call

2024-09-25 Thread Arunpravin Paneer Selvam
Add the missing error handling for xa_store() call in the function amdgpu_userq_fence_driver_alloc(). Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/a

Re: [PATCH v2] drm/amdgpu/gfx9: Convert `//` to `/* ... */` in cleaner shader code

2024-09-25 Thread Felix Kuehling
On 2024-09-04 07:03, Christian König wrote: It could be that the automated testing tools will run amok on that. I need to ask Felix for details but I think the code for the CWSR trap handlers were converted to C style comments as well because of that. I'm not aware of that. I see both comme

Re: [PATCH] drm/amd: Taint the kernel when enabling overdrive

2024-09-25 Thread Mario Limonciello
On 9/25/2024 15:09, Alex Deucher wrote: On Wed, Sep 25, 2024 at 4:05 PM Mario Limonciello wrote: Some distributions have been patching amdgpu to enable overdrive by default which may compromise stability. Furthermore when bug reports are brought upstream it's not obvious that the system has b

Re: [PATCH] drm/amd: Taint the kernel when enabling overdrive

2024-09-25 Thread Alex Deucher
On Wed, Sep 25, 2024 at 4:12 PM Mario Limonciello wrote: > > On 9/25/2024 15:09, Alex Deucher wrote: > > On Wed, Sep 25, 2024 at 4:05 PM Mario Limonciello > > wrote: > >> > >> Some distributions have been patching amdgpu to enable overdrive by > >> default which may compromise stability. Further

[PATCH] drm/amd: Taint the kernel when enabling overdrive

2024-09-25 Thread Mario Limonciello
Some distributions have been patching amdgpu to enable overdrive by default which may compromise stability. Furthermore when bug reports are brought upstream it's not obvious that the system has been tampered with. When overdrive is enabled taint the kernel and leave a critical message in the log

Re: [PATCH] drm/amd: Taint the kernel when enabling overdrive

2024-09-25 Thread Alex Deucher
On Wed, Sep 25, 2024 at 4:05 PM Mario Limonciello wrote: > > Some distributions have been patching amdgpu to enable overdrive by > default which may compromise stability. Furthermore when bug reports > are brought upstream it's not obvious that the system has been tampered > with. > > When overdr

Re: [PATCH v11 24/28] drm/amdgpu: resume gfx userqueues

2024-09-25 Thread Sharma, Shashank
On 17/09/2024 14:30, Christian König wrote: Am 09.09.24 um 22:06 schrieb Shashank Sharma: This patch adds support for userqueue resume. What it typically does is this: - adds a new delayed work for resuming all the queues. - schedules this delayed work from the suspend work. - validates the BO

Re: [PATCH v11 23/28] drm/amdgpu: suspend gfx userqueues

2024-09-25 Thread Sharma, Shashank
On 17/09/2024 13:58, Christian König wrote: Am 09.09.24 um 22:06 schrieb Shashank Sharma: This patch adds suspend support for gfx userqueues. It typically does the following: - adds an enable_signaling function for the eviction fence, so that it    can trigger the userqueue suspend, - adds a d

Re: [PATCH v11 00/28] AMDGPU usermode queues

2024-09-25 Thread Sharma, Shashank
On 19/09/2024 18:59, Alex Deucher wrote: On Mon, Sep 9, 2024 at 4:07 PM Shashank Sharma wrote: This patch series introduces base code of AMDGPU usermode queues for gfx workloads. Usermode queues is a method of GPU workload submission into the graphics hardware without any interaction with ker

Re: [PATCH 1/2] drm/amdgpu: update the handle ptr in dump_ip_state

2024-09-25 Thread Christian König
Am 25.09.24 um 05:51 schrieb Sunil Khatri: Update the ptr handle to amdgpu_ip_block ptr in all the functions. Signed-off-by: Sunil Khatri Both patches look like a straightforward cleanup to me. Feel free to add Reviewed-by: Christian König to the series. Thanks, Christian. --- driver

Re: [PATCH v11 21/28] drm/amdgpu: add gfx eviction fence helpers

2024-09-25 Thread Sharma, Shashank
Hey Christian, On 16/09/2024 16:14, Christian König wrote: Am 09.09.24 um 22:06 schrieb Shashank Sharma: This patch adds basic eviction fence framework for the gfx buffers. The idea is to: - One eviction fence is created per gfx process, at kms_open. - This fence is attached to all the gem buff

Re: radeon ARUBA NULL pointer dereference

2024-09-25 Thread Ewan Milne
I think we are seeing a similar problem w/qla2xxx panicing at boot: commit 1868f9d0260e9afaf7c6436d14923ae12eaea465 (HEAD -> master, origin/master, origin/HEAD) Merge: 056f8c437dc3 96319dacaf15 Author: Linus Torvalds Date: Fri Sep 20 19:34:00 2024 -0700 Merge tag 'for-linux-6.12-ofs1' of g

Re: [PATCH v3 1/6] drm: add DRM_SET_NAME ioctl

2024-09-25 Thread Dmitry Osipenko
On 9/23/24 21:18, Dmitry Osipenko wrote: > On 9/23/24 21:09, Dmitry Osipenko wrote: >>> Sure, I can do that if others prefer this way too. >> Note that in the other email I suggested to use strndup_user(), that >> will remove the name-length limitation, but then the name var will >> remain to be a

Re: [PATCH 0/5] AMDGPU deadcode

2024-09-25 Thread Dr. David Alan Gilbert
* Alex Deucher (alexdeuc...@gmail.com) wrote: > On Sun, Sep 22, 2024 at 9:43 PM wrote: > > > > From: "Dr. David Alan Gilbert" > > > > Hi, > > This is a bunch of deadcode removal in amdgpu; > > some of the functions are ones which were previously > > used but haven't been for a while, others are

Re: [PATCH 2/8] drm/sched: Always wake up correct scheduler in drm_sched_entity_push_job

2024-09-25 Thread Tvrtko Ursulin
On 24/09/2024 14:55, Christian König wrote: I've pushed the first to drm-misc-next, but that one here fails to apply cleanly. This appears due 440d52b370b0 ("drm/sched: Fix dynamic job-flow control race") in drm-misc-fixes. In theory 1-3 from my series are fixes. Should they also go to dr

Re: [PATCH 2/8] drm/sched: Always wake up correct scheduler in drm_sched_entity_push_job

2024-09-25 Thread Tvrtko Ursulin
On 24/09/2024 15:20, Christian König wrote: Am 24.09.24 um 16:12 schrieb Tvrtko Ursulin: On 24/09/2024 14:55, Christian König wrote: I've pushed the first to drm-misc-next, but that one here fails to apply cleanly. This appears due 440d52b370b0 ("drm/sched: Fix dynamic job-flow control ra

NULL pointer dereference after ib test on ring 7 succeeded

2024-09-25 Thread Arthur Marsh
After rebuilding current Linus git head with: dma-mapping: report unlimited DMA addressing in IOMMU DMA path b348b6d17fd1d5d89b86db602f02bea54a754bd8 applied, the radeon module load gets further before hitting another NULL pointer dereference: [ 17.777472] [drm] radeon kernel modesetting enabl

Re: [PATCH v2] drm/amdgpu: add dce6 drm_panic support

2024-09-25 Thread Jocelyn Falempe
On 24/09/2024 16:02, Alex Deucher wrote: On Fri, Sep 20, 2024 at 11:36 AM Jocelyn Falempe wrote: On 17/09/2024 15:21, Alex Deucher wrote: On Mon, Aug 12, 2024 at 2:10 AM Lu Yao wrote: Add support for the drm_panic module, which displays a pretty user friendly message on the screen when a L

Re: [PATCH v2] drm/amdgpu: add dce6 drm_panic support

2024-09-25 Thread Michel Dänzer
On 2024-09-24 16:02, Alex Deucher wrote: > On Fri, Sep 20, 2024 at 11:36 AM Jocelyn Falempe wrote: >> On 17/09/2024 15:21, Alex Deucher wrote: >>> On Mon, Aug 12, 2024 at 2:10 AM Lu Yao wrote: Add support for the drm_panic module, which displays a pretty user friendly message on th

[PATCH v1 0/9] drm/amd/pm runtime pm changes

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
This series rework how runtime power management is handled in drm/amd/pm. The main ideas are: * simplify code and reduce copy-pate of runtimepm calls * avoid waking up suspended GPU when reading debugfs files. It is similar to Mario's earlier series: https://lists.freedesktop.org/archives/amd-

[PATCH v1 2/9] drm/amd/pm: fix rpm refcount handling on error

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
pm_runtime_put_autosuspend must be called from all exit paths. Tested-by: Mario Limonciello Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_

[PATCH v1 1/9] drm/amd/pm: remove dump_pptable functions

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
They're not used. Tested-by: Mario Limonciello Signed-off-by: Pierre-Eric Pelloux-Prayer --- .../powerplay/hwmgr/vega20_processpptables.c | 574 drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h |5 - .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 433 -- .../amd/pm/swsmu/smu11

[PATCH v1 4/9] drm/amd/pm: don't update runpm last_usage on debugfs getter

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
Reading pm values from the GPU shouldn't prevent it to be suspended by resetting the last active timestamp (eg: if an background app monitors GPU sensors every second, it would prevent the autosuspend sequence to trigger). Tested-by: Mario Limonciello Signed-off-by: Pierre-Eric Pelloux-Prayer --

[PATCH v1 3/9] drm/amd/pm: use pm_runtime_resume_and_get

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
Using pm_runtime_resume_and_get over pm_runtime_get_sync is recommended. Tested-by: Mario Limonciello Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 263 ++--- 1 file changed, 89 insertions(+), 174 deletions(-) diff --git a/drivers/gp

[PATCH v1 5/9] drm/amd/pm: use pm_runtime_get_if_active for debugfs getters

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
Don't wake up the GPU for reading pm values. Instead, take a runtime powermanagement ref when trying to read it iff the GPU is already awake. This avoids spurious wake ups (eg: from applets). We use pm_runtime_get_if_in_active(ign_usage_count=true) because we care about "is the GPU awake?" not ab

[PATCH v1 7/9] drm/amd/pm: add sysfs attribute access wrappers

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
All attributes do the same thing wrt to runtime power management, so we can consolidate the handling in 2 wrappers. For some setters this will change the behavior slightly, as rpm is now done before arguments validation - so the device will be resumed even if the arguments passed in are incorrect.

[PATCH v1 8/9] drm/amd/pm: move private definitions to the .c file

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
Move stuff that's only used in amdgpu_pm.c to the top of file instead of leaving it in a .h files included in 30+ files. Tested-by: Mario Limonciello Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 98 +++ drivers/gpu/drm/amd/pm/inc/am

[PATCH v1 9/9] drm/amd/pm: use pm_runtime_get_if_active in amdgpu_debugfs_sensor_read

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
Same logic as the previous commit ("drm/amdgpu/pm: use pm_runtime_get_if_active for debugfs getters"): debugfs accesses shouldn't wake up the GPU nor preventing it to be suspended. Tested-by: Mario Limonciello Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/amdgpu/amdgpu_debug

[PATCH v1 6/9] drm/amd/pm: stop extra checks for runtime pm state

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
pm_runtime_get_if_in_use already checks if the GPU is active, so there's no need for manually checking runtimepm status: if (adev->in_suspend && !adev->in_runpm) return -EPERM; Tested-by: Mario Limonciello Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/pm/amdgpu_pm.

Re: [PATCH v7 09/10] drm/amd/display: remove dc_edid handler from dm_helpers_parse_edid_caps

2024-09-25 Thread Mario Limonciello
Alex, Unfortunately I can't reproduce the regression on the APU I tried. However I do have a suspicion on a fix. Can you see if this helps? If it does, we can squash it in. diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c in

Re: 6.12-rc0/regression/bisected - 9c081c11c621 drm/amdgpu: Reorder to read EFI exported ROM first - breaks connector enumeration and discovery

2024-09-25 Thread Yanko Kaneti
On Wed, 2024-09-25 at 11:53 -0400, Alex Deucher wrote: > On Wed, Sep 25, 2024 at 11:46 AM Yanko Kaneti wrote: > > > > Hello, > > > > This commit in mainline (9c081c11c621) breaks connector enumeration and > > discovery for me here so my PC->HDMI-to-DP->monitor stops showing > > anything after a

Re: [PATCH v7 09/10] drm/amd/display: remove dc_edid handler from dm_helpers_parse_edid_caps

2024-09-25 Thread Alex Hung
Mario and Melissa, This patch causes a regrerssion on 7900 XTX in an IGT test: amd_mem_leak's connector-suspend-resume. Is this patch necessary on this series or is it independent from other patches, i.e. can it be dropped from this series until fixed?? Cheers, Alex Hung On 9/18/24 15:38,

Re: [PATCH] drm/amdgpu: simplify vram alloc logic since 2GB limitation removed

2024-09-25 Thread Alex Deucher
On Tue, Sep 24, 2024 at 10:22 AM Zhang, Yifan wrote: > > [AMD Official Use Only - AMD Internal Distribution Only] > > 2GB limitation in VRAM allocation is removed in below patch. My patch is a > follow up refine for this. The remaing_size calculation was to address the > 2GB limitation in contig

Re: [PATCH 2/2] drm/amdgpu: init saw registers for mmhub v1.0

2024-09-25 Thread Deucher, Alexander
[Public] Acked-by: Alex Deucher From: Zhu, Lingshan Sent: Tuesday, September 24, 2024 11:09 PM To: Deucher, Alexander Cc: Huang, Ray ; amd-gfx@lists.freedesktop.org ; Zhu, Lingshan ; Du, Bin Subject: [PATCH 2/2] drm/amdgpu: init saw registers for mmhub v1.0

Re: NULL pointer dereference after ib test on ring 7 succeeded

2024-09-25 Thread Thomas Zimmermann
Hi Am 25.09.24 um 02:22 schrieb Arthur Marsh: After rebuilding current Linus git head with: dma-mapping: report unlimited DMA addressing in IOMMU DMA path b348b6d17fd1d5d89b86db602f02bea54a754bd8 I cannot yet apply this patch locally as a function is missing. I'll wait for -rc1 to do further

[PATCH] drm/amdkfd: Fix kdoc entry for 'get_wave_count()' function parameters

2024-09-25 Thread Srinivasan Shanmugam
Update kdoc entries to reflect the function's parameters. The descriptor for the 'queue_cnt' parameter has been added, and the incorrect mentions of 'wave_cnt' and 'vmid', which are not parameters but local variables, have been removed. Fixes the below with gcc W=1: drivers/gpu/drm/amd/amdgpu/amdg

RE: [PATCH] drm/amdkfd: Fix kdoc entry for 'get_wave_count()' function parameters

2024-09-25 Thread Joshi, Mukul
[AMD Official Use Only - AMD Internal Distribution Only] With the description updated below, this patch is Reviewed-by: Mukul Joshi > -Original Message- > From: amd-gfx On Behalf Of > Srinivasan Shanmugam > Sent: Wednesday, September 25, 2024 11:00 AM > To: Koenig, Christian ; Deucher,

[PATCH v3] drm/amd/display: Fix out-of-bounds access in 'dcn21_link_encoder_create'

2024-09-25 Thread Srinivasan Shanmugam
An issue was identified in the dcn21_link_encoder_create function where an out-of-bounds access could occur when the hpd_source index was used to reference the link_enc_hpd_regs array. This array has a fixed size and the index was not being checked against the array's bounds before accessing it. T

[PATCH 1/2] drm/amd/display: increase max surfaces in line with planes and streams

2024-09-25 Thread Melissa Wen
091a97e542cf ("drm/amd/display: Fix warning. Set MAX_SURFACES to 3") reduced the max number of surfaces since, at that time, there was no use for more. However, HW and driver evolves and there are now driver versions that allow two overlay planes (max_slave_planes). Moreover, commit 3cfd03b79425 ("

[PATCH 0/2] drm/amd/display: increase MAX_SURFACES in line with planes and streams

2024-09-25 Thread Melissa Wen
Hi! AFAIU, the driver is defining two different max number of surfaces: MAX_SURFACES (dc.h) and MAX_SURFACE_NUM (dc_types.h) Many years ago, MAX_SURFACES was set 3 just to prevent a stack size warning as in 091a97e542cf ("drm/amd/display: Fix warning. Set MAX_SURFACES to 3")[1]. But according to c

[PATCH 2/2] drm/amd/display: add warnings for MAX_SURFACES mismatch

2024-09-25 Thread Melissa Wen
So that, in the future, when the max number of planes and streams increases, they might be synced with the number of surfaces to prevent array-index-out-of-bounds issues. Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 20 +++ 1 file changed, 20 ins

6.12-rc0/regression/bisected - 9c081c11c621 drm/amdgpu: Reorder to read EFI exported ROM first - breaks connector enumeration and discovery

2024-09-25 Thread Yanko Kaneti
Hello, This commit in mainline (9c081c11c621) breaks connector enumeration and discovery for me here so my PC->HDMI-to-DP->monitor stops showing anything after amdgpu starts. Fedora rawhide 6.12 pre rc0 kernels. There is some ... amdgpu :0e:00.0: amdgpu: Fetched VBIOS from platform a

Re: [PATCH v1 6/9] drm/amd/pm: stop extra checks for runtime pm state

2024-09-25 Thread Alex Deucher
On Wed, Sep 25, 2024 at 9:38 AM Lazar, Lijo wrote: > > > > On 9/25/2024 1:24 PM, Pierre-Eric Pelloux-Prayer wrote: > > pm_runtime_get_if_in_use already checks if the GPU is active, > > so there's no need for manually checking runtimepm status: > > > >if (adev->in_suspend && !adev->in_runpm) >

Re: 6.12-rc0/regression/bisected - 9c081c11c621 drm/amdgpu: Reorder to read EFI exported ROM first - breaks connector enumeration and discovery

2024-09-25 Thread Alex Deucher
On Wed, Sep 25, 2024 at 11:46 AM Yanko Kaneti wrote: > > Hello, > > This commit in mainline (9c081c11c621) breaks connector enumeration and > discovery for me here so my PC->HDMI-to-DP->monitor stops showing > anything after amdgpu starts. Fedora rawhide 6.12 pre rc0 kernels. Fixed in this com

Re: [PATCH v1 6/9] drm/amd/pm: stop extra checks for runtime pm state

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
Le 25/09/2024 à 15:37, Lazar, Lijo a écrit : On 9/25/2024 1:24 PM, Pierre-Eric Pelloux-Prayer wrote: pm_runtime_get_if_in_use already checks if the GPU is active, so there's no need for manually checking runtimepm status: if (adev->in_suspend && !adev->in_runpm) return -EPERM;

Re: [PATCH v1 5/9] drm/amd/pm: use pm_runtime_get_if_active for debugfs getters

2024-09-25 Thread Pierre-Eric Pelloux-Prayer
Le 25/09/2024 à 15:35, Lazar, Lijo a écrit : On 9/25/2024 1:24 PM, Pierre-Eric Pelloux-Prayer wrote: Don't wake up the GPU for reading pm values. Instead, take a runtime powermanagement ref when trying to read it iff the GPU is already awake. This avoids spurious wake ups (eg: from applets

[PATCH v2] drm/amd/display: Fix out-of-bounds access in 'dcn21_link_encoder_create'

2024-09-25 Thread Srinivasan Shanmugam
An issue was identified in the dcn21_link_encoder_create function where an out-of-bounds access could occur when the hpd_source index was used to reference the link_enc_hpd_regs array. This array has a fixed size and the index was not being checked against the array's bounds before accessing it. T

[PATCH AUTOSEL 6.11 170/244] drm/amdgpu: add raven1 gfxoff quirk

2024-09-25 Thread Sasha Levin
From: Peng Liu [ Upstream commit 0126c0ae11e8b52ecfde9d1b174ee2f32d6c3a5d ] Fix screen corruption with openkylin. Link: https://bbs.openkylin.top/t/topic/171497 Signed-off-by: Peng Liu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1

[PATCH AUTOSEL 6.11 180/244] drm/amd/display: Check null-initialized variables

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 367cd9ceba1933b63bc1d87d967baf6d9fd241d2 ] [WHAT & HOW] drr_timing and subvp_pipe are initialized to null and they are not always assigned new values. It is necessary to check for null before dereferencing. This fixes 2 FORWARD_NULL issues reported by Coverity.

[PATCH AUTOSEL 6.11 179/244] drm/amd/display: Initialize denominators' default to 1

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit b995c0a6de6c74656a0c39cd57a0626351b13e3c ] [WHAT & HOW] Variables used as denominators and maybe not assigned to other values, should not be 0. Change their default to 1 so they are never 0. This fixes 10 DIVIDE_BY_ZERO issues reported by Coverity. Reviewed-by

[PATCH AUTOSEL 6.11 171/244] drm/amdgpu: enable gfxoff quirk on HP 705G4

2024-09-25 Thread Sasha Levin
From: Peng Liu [ Upstream commit 2c7795e245d993bcba2f716a8c93a5891ef910c9 ] Enabling gfxoff quirk results in perfectly usable graphical user interface on HP 705G4 DM with R5 2400G. Without the quirk, X server is completely unusable as every few seconds there is gpu reset due to ring gfx timeout

[PATCH AUTOSEL 6.11 172/244] drm/amdkfd: Fix resource leak in criu restore queue

2024-09-25 Thread Sasha Levin
From: Jesse Zhang [ Upstream commit aa47fe8d3595365a935921a90d00bc33ee374728 ] To avoid memory leaks, release q_extra_data when exiting the restore queue. v2: Correct the proto (Alex) Signed-off-by: Jesse Zhang Reviewed-by: Tim Huang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --

[PATCH AUTOSEL 6.11 186/244] drm/amd/display: Fix index out of bounds in DCN30 degamma hardware format translation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit bc50b614d59990747dd5aeced9ec22f9258991ff ] This commit addresses a potential index out of bounds issue in the `cm3_helper_translate_curve_to_degamma_hw_format` function in the DCN30 color management module. The issue could occur when the index 'i' ex

[PATCH AUTOSEL 6.11 185/244] drm/amd/display: Increase array size of dummy_boolean

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 6d64d39486197083497a01b39e23f2f8474b35d3 ] [WHY] dml2_core_shared_mode_support and dml_core_mode_support access the third element of dummy_boolean, i.e. hw_debug5 = &s->dummy_boolean[2], when dummy_boolean has size of 2. Any assignment to hw_debug5 causes an OVE

[PATCH AUTOSEL 6.11 183/244] drm/amd/display: Deallocate DML memory if allocation fails

2024-09-25 Thread Sasha Levin
From: Chris Park [ Upstream commit 892abca6877a96c9123bb1c010cafccdf8ca1b75 ] [Why] When DC state create DML memory allocation fails, memory is not deallocated subsequently, resulting in uninitialized structure that is not NULL. [How] Deallocate memory if DML memory allocation fails. Reviewed-

[PATCH AUTOSEL 6.11 184/244] drm/amd/display: Check link_res->hpo_dp_link_enc before using it

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 0beca868cde8742240cd0038141c30482d2b7eb8 ] [WHAT & HOW] Functions dp_enable_link_phy and dp_disable_link_phy can pass link_res without initializing hpo_dp_link_enc and it is necessary to check for null before dereferencing. This fixes 2 FORWARD_NULL issues repo

[PATCH AUTOSEL 6.11 188/244] drm/amd/display: Implement bounds check for stream encoder creation in DCN401

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit bdf606810210e8e07a0cdf1af3c467291363b295 ] 'stream_enc_regs' array is an array of dcn10_stream_enc_registers structures. The array is initialized with four elements, corresponding to the four calls to stream_enc_regs() in the array initializer. This m

[PATCH AUTOSEL 6.11 182/244] drm/amd/display: Check stream before comparing them

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 35ff747c86767937ee1e0ca987545b7eed7a0810 ] [WHAT & HOW] amdgpu_dm can pass a null stream to dc_is_stream_unchanged. It is necessary to check for null before dereferencing them. This fixes 1 FORWARD_NULL issue reported by Coverity. Reviewed-by: Rodrigo Siqueira

[PATCH AUTOSEL 6.11 187/244] drm/amd/display: Fix index out of bounds in degamma hardware format translation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit b7e99058eb2e86aabd7a10761e76cae33d22b49f ] Fixes index out of bounds issue in `cm_helper_translate_curve_to_degamma_hw_format` function. The issue could occur when the index 'i' exceeds the number of transfer function points (TRANSFER_FUNC_POINTS). T

[PATCH AUTOSEL 6.11 181/244] drm/amd/display: Check phantom_stream before it is used

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 3718a619a8c0a53152e76bb6769b6c414e1e83f4 ] dcn32_enable_phantom_stream can return null, so returned value must be checked before used. This fixes 1 NULL_RETURNS issue reported by Coverity. Reviewed-by: Rodrigo Siqueira Signed-off-by: Jerry Zuo Signed-off-by:

[PATCH AUTOSEL 6.11 195/244] drm/amd/display: Initialize get_bytes_per_element's default to 1

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 4067f4fa0423a89fb19a30b57231b384d77d2610 ] Variables, used as denominators and maybe not assigned to other values, should not be 0. bytes_per_element_y & bytes_per_element_c are initialized by get_bytes_per_element() which should never return 0. This fixes 10 D

[PATCH AUTOSEL 6.11 194/244] drm/amd/display: Avoid overflow assignment in link_dp_cts

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit a15268787b79fd183dd526cc16bec9af4f4e49a1 ] sampling_rate is an uint8_t but is assigned an unsigned int, and thus it can overflow. As a result, sampling_rate is changed to uint32_t. Similarly, LINK_QUAL_PATTERN_SET has a size of 2 bits, and it should only be ass

[PATCH AUTOSEL 6.11 190/244] drm/amdgpu/gfx12: properly handle error ints on all pipes

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 39879321769cc2d9a690725959ef76af92a38ac1 ] Need to handle the interrupt enables for all pipes. v2: fix indexing (Jessie) Acked-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 130 ++

[PATCH AUTOSEL 6.11 191/244] drm/amdgpu/gfx9: properly handle error ints on all pipes

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 48695573d2feaf42812c1ad54e01caff0d1c2d71 ] Need to handle the interrupt enables for all pipes. Acked-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 44 +- drive

[PATCH AUTOSEL 6.11 192/244] drm/amd/display: Fix possible overflow in integer multiplication

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 3f96f545f877ac59d0c967f52d760b4b2b3b9a47 ] [WHAT & HOW] Integer multiplies integer may overflow in context that expects an expression of unsigned long long (64 bits). This can be fixed by casting integer to unsigned long long to force 64 bits results. This fixe

[PATCH AUTOSEL 6.11 193/244] drm/amd/display: Check stream_status before it is used

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 58a8ee96f84d2c21abb85ad8c22d2bbdf59bd7a9 ] [WHAT & HOW] dc_state_get_stream_status can return null, and therefore null must be checked before stream_status is used. This fixes 1 NULL_RETURNS issue reported by Coverity. Signed-off-by: Alex Hung Reviewed-by: Ro

[PATCH AUTOSEL 6.11 189/244] drm/amd/display: Fix index out of bounds in DCN30 color transformation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit d81873f9e715b72d4f8d391c8eb243946f784dfc ] This commit addresses a potential index out of bounds issue in the `cm3_helper_translate_curve_to_hw_format` function in the DCN30 color management module. The issue could occur when the index 'i' exceeds the

[PATCH AUTOSEL 6.11 207/244] drm/radeon/r100: Handle unknown family in r100_cp_init_microcode()

2024-09-25 Thread Sasha Levin
From: Geert Uytterhoeven [ Upstream commit c6dbab46324b1742b50dc2fb5c1fee2c28129439 ] With -Werror: In function ‘r100_cp_init_microcode’, inlined from ‘r100_cp_init’ at drivers/gpu/drm/radeon/r100.c:1136:7: include/linux/printk.h:465:44: error: ‘%s’ directive argument is null [

[PATCH AUTOSEL 6.11 204/244] drm/amdgpu: fix unchecked return value warning for amdgpu_atombios

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 92549780e32718d64a6d083c6fffecb541c7 ] This resolves the unchecded return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH AUTOSEL 6.11 202/244] drm/amd/display: Force enable 3DLUT DMA check for dcn401 in DML

2024-09-25 Thread Sasha Levin
From: Dillon Varone [ Upstream commit b8dc6ca028d9a39196a3a066b9ef2d4a5eca475d ] [WHY] Currently TR0 (trip 0) is not properly budgeting for urgent latency in DML2.1. This results in overly aggressive prefetch schedules that are vulnerable to request return jitter, resulting in severe underflow a

[PATCH AUTOSEL 6.11 203/244] drm/amdgpu: fix unchecked return value warning for amdgpu_gfx

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit c0277b9d7c2ee9ee5dbc948548984f0fbb861301 ] This resolves the unchecded return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH AUTOSEL 6.11 208/244] drm/amd/display: Unlock Pipes Based On DET Allocation

2024-09-25 Thread Sasha Levin
From: Austin Zheng [ Upstream commit 4af0d8ebf74ccbb60d33fdd410891283dd6cb109 ] [Why] DML21 does not allocate DET evenly between pipes. May result in underflow when unlocking the pipes as DET could be overallocated. [How] 1. Unlock pipes that have a decreased amount of DET allocation 2. Wait fo

[PATCH AUTOSEL 6.11 211/244] drm/amdgpu: fix ptr check warning in gfx11 ip_dump

2024-09-25 Thread Sasha Levin
From: Sunil Khatri [ Upstream commit bd15f805cdc503ac229a14f5fe21db12e6e7f84a ] Change condition, if (ptr == NULL) to if (!ptr) for a better format and fix the warning. Reviewed-by: Alex Deucher Signed-off-by: Sunil Khatri Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/

[PATCH AUTOSEL 6.11 216/244] drm/amd/pm: ensure the fw_info is not null before using it

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 186fb12e7a7b038c2710ceb2fb74068f1b5d55a4 ] This resolves the dereference null return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/pm/pow

[PATCH AUTOSEL 6.11 217/244] drm/amdkfd: Check int source id for utcl2 poison event

2024-09-25 Thread Sasha Levin
From: Hawking Zhang [ Upstream commit db6341a9168d2a24ded526277eeab29724d76e9d ] Traditional utcl2 fault_status polling does not work in SRIOV environment. The polling of fault status register from guest side will be dropped by hardware. Driver should switch to check utcl2 interrupt source id t

[PATCH AUTOSEL 6.11 213/244] drm/amdgpu/gfx9: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 3ec2ad7c34c412bd9264cd1ff235d0812be90e82 ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --g

[PATCH AUTOSEL 6.11 214/244] drm/amdgpu/gfx11: enter safe mode before touching CP_INT_CNTL

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit b5be054c585110b2c5c1b180136800e8c41c7bb4 ] Need to enter safe mode before touching GC MMIO. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++-- 1 file changed, 2 insertions(

[PATCH AUTOSEL 6.11 209/244] drm/amdgpu: fix ptr check warning in gfx9 ip_dump

2024-09-25 Thread Sasha Levin
From: Sunil Khatri [ Upstream commit 07f4f9c00ec545dfa6251a44a09d2c48a76e7ee5 ] Change if (ptr == NULL) to if (!ptr) for a better format and fix the warning. Reviewed-by: Alex Deucher Signed-off-by: Sunil Khatri Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd

[PATCH AUTOSEL 6.11 210/244] drm/amdgpu: fix ptr check warning in gfx10 ip_dump

2024-09-25 Thread Sasha Levin
From: Sunil Khatri [ Upstream commit 98df5a7732e3b78bf8824d2938a8865a45cfc113 ] Change condition, if (ptr == NULL) to if (!ptr) for a better format and fix the warning. Reviewed-by: Alex Deucher Signed-off-by: Sunil Khatri Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/

[PATCH AUTOSEL 6.11 212/244] drm/amdgpu: Block MMR_READ IOCTL in reset

2024-09-25 Thread Sasha Levin
From: Victor Skvortsov [ Upstream commit 9e823f307074c0f82b5f6044943b0086e3079bed ] Register access from userspace should be blocked until reset is complete. Signed-off-by: Victor Skvortsov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm

[PATCH AUTOSEL 6.11 224/244] drm/amdgpu/gfx11: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 3f2d35c325534c1b7ac5072173f0dc7ca969dec2 ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH AUTOSEL 6.11 225/244] drm/amdgpu/gfx10: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit ead60e9c4e29c8574cae1be4fe3af1d9a978fb0f ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH AUTOSEL 6.11 223/244] drm/amdgpu/gfx12: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 21818f39beda2e843199e5d8d9e3f9e43c8080a3 ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH AUTOSEL 6.10 120/197] drm/amd/display: Add NULL check for clk_mgr in dcn32_init_hw

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit c395fd47d1565bd67671f45cca281b3acc2c31ef ] This commit addresses a potential null pointer dereference issue in the `dcn32_init_hw` function. The issue could occur when `dc->clk_mgr` is null. The fix adds a check to ensure `dc->clk_mgr` is not null be

[PATCH AUTOSEL 6.10 122/197] drm/amd/display: Add null check for top_pipe_to_program in commit_planes_for_stream

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 66d71a72539e173a9b00ca0b1852cbaa5f5bf1ad ] This commit addresses a null pointer dereference issue in the `commit_planes_for_stream` function at line 4140. The issue could occur when `top_pipe_to_program` is null. The fix adds a check to ensure `top_p

[PATCH AUTOSEL 6.10 123/197] drm/amd/display: Use gpuvm_min_page_size_kbytes for DML2 surfaces

2024-09-25 Thread Sasha Levin
From: Nicholas Kazlauskas [ Upstream commit 31663521ede2edb622ee1b397ae3ac666d6351c5 ] [Why] It's currently hard coded to 256 when it should be using the SOC provided values. This can result in corruption with linear surfaces where we prefetch more PTE than the buffer can hold. [How] Update the

[PATCH AUTOSEL 6.10 119/197] drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn30_init_hw

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit cba7fec864172dadd953daefdd26e01742b71a6a ] This commit addresses a potential null pointer dereference issue in the `dcn30_init_hw` function. The issue could occur when `dc->clk_mgr` or `dc->clk_mgr->funcs` is null. The fix adds a check to ensure `dc-

[PATCH AUTOSEL 6.10 118/197] drm/amd/display: Add null check for head_pipe in dcn32_acquire_idle_pipe_for_head_pipe_in_layer

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit ac2140449184a26eac99585b7f69814bd3ba8f2d ] This commit addresses a potential null pointer dereference issue in the `dcn32_acquire_idle_pipe_for_head_pipe_in_layer` function. The issue could occur when `head_pipe` is null. The fix adds a check to ensu

[PATCH AUTOSEL 6.10 150/197] drm/amd/display: Check phantom_stream before it is used

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 3718a619a8c0a53152e76bb6769b6c414e1e83f4 ] dcn32_enable_phantom_stream can return null, so returned value must be checked before used. This fixes 1 NULL_RETURNS issue reported by Coverity. Reviewed-by: Rodrigo Siqueira Signed-off-by: Jerry Zuo Signed-off-by:

[PATCH AUTOSEL 6.10 149/197] drm/amd/display: Check null-initialized variables

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 367cd9ceba1933b63bc1d87d967baf6d9fd241d2 ] [WHAT & HOW] drr_timing and subvp_pipe are initialized to null and they are not always assigned new values. It is necessary to check for null before dereferencing. This fixes 2 FORWARD_NULL issues reported by Coverity.

  1   2   >