[PATCH 3/3] drm/amdkfd: use existing VM helper for PD and PT validation in SVM

2022-06-07 Thread Lang Yu
This will remove some redundant codes. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c index d6fc00d51c8c..03e07d1d1d1a

[PATCH] drm/amdgpu/display: Fix compilation issues

2022-06-07 Thread Chandan Vurdigere Nataraj
[Why] Getting below build errors: drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1419:3: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] default: ^

[PATCH] drm/amdgpu/display: Remove unnecessary typecasts and fix build issues

2022-06-07 Thread Chandan Vurdigere Nataraj
[Why] Getting below errors: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:1414:5: error: implicit conversion from enumeration type 'enum scan_direction_class' to different enumeration type 'enum dm_rotation_angle' [-Werror,-Wenum-conversion]

Re: [PATCH V3] drm/amdgpu: enable ASPM support for PCIE 7.4.0/7.6.0

2022-06-07 Thread Lazar, Lijo
On 6/7/2022 2:08 PM, Evan Quan wrote: Enable ASPM support for PCIE 7.4.0 and 7.6.0. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Thanks, Lijo Change-Id: Ib3b0e106ff43ad49f0f815e6eeb5c756b6bf4550 -- v1->v2: - support LTR disabled scenario(Lijo) ---

[PATCH V3] drm/amdgpu: enable ASPM support for PCIE 7.4.0/7.6.0

2022-06-07 Thread Evan Quan
Enable ASPM support for PCIE 7.4.0 and 7.6.0. Signed-off-by: Evan Quan Change-Id: Ib3b0e106ff43ad49f0f815e6eeb5c756b6bf4550 -- v1->v2: - support LTR disabled scenario(Lijo) --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +

[PATCH 2/3] drm/amdkfd: simplify PD and PT BOs validation

2022-06-07 Thread Lang Yu
1, Move root BO kmapping to amdgpu_vm_make_compute. 2, Don't validate and kmap root BO intentional, it would be validated and mapped by amdgpu_vm_validate_pt_bos if necessary. 3, Rename and expose vm_validate_pt_pd_bos, so that it could be used by SVM. Signed-off-by: Lang Yu ---

[PATCH 1/3] drm/amdkfd: don't validate pinned BOs

2022-06-07 Thread Lang Yu
If a BO is pinned to VRAM and you try to validate it into GTT, you will get an error. Suggested-by: Christian König Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 2/3] drm/amdgpu: Add peer-to-peer support among PCIe connected AMD GPUs

2022-06-07 Thread Ramesh Errabolu
Add support for peer-to-peer communication among AMD GPUs over PCIe bus. Support REQUIRES enablement of config HSA_AMD_P2P. Signed-off-by: Ramesh Errabolu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 1 +

RE: [PATCH] drm/amdgpu/mes: only invalid/prime icache after finish loading both pipe MES FWs.

2022-06-07 Thread Zhang, Yifan
[AMD Official Use Only - General] Ping -Original Message- From: amd-gfx On Behalf Of Yifan Zhang Sent: Monday, June 6, 2022 6:40 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Zhang, Yifan ; Huang, Ray Subject: [PATCH] drm/amdgpu/mes: only invalid/prime icache after

Re: [PATCH] drm/amdgpu/display: Fix compilation issues

2022-06-07 Thread Alex Deucher
On Tue, Jun 7, 2022 at 4:27 AM Chandan Vurdigere Nataraj wrote: > > [Why] > Getting below build errors: > drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1419:3: error: > unannotated fall-through between switch labels > [-Werror,-Wimplicit-fallthrough] > default: >

[PATCH] drm/amdgpu: Fix reference leak in psp_xgmi_reflect_topology_info()

2022-06-07 Thread Jianglei Nie
amdgpu_get_xgmi_hive() increases the kobject reference counter of the hive it returned. The hive returned by amdgpu_get_xgmi_hive() should be released with the help of amdgpu_put_xgmi_hive() to balance its kobject reference counter properly. Forgetting the amdgpu_put_xgmi_hive() operation will

Re: [PATCH] drm/amdgpu: Add MODE register to wave debug info in gfx11

2022-06-07 Thread Deucher, Alexander
[AMD Official Use Only - General] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Joseph Greathouse Sent: Monday, June 6, 2022 7:04 PM To: amd-gfx@lists.freedesktop.org Cc: StDenis, Tom ; Greathouse, Joseph Subject: [PATCH] drm/amdgpu: Add MODE

Re: [PATCH] drm/amdgpu/mes: only invalid/prime icache after finish loading both pipe MES FWs.

2022-06-07 Thread Deucher, Alexander
[Public] Acked-by: Alex Deucher From: Zhang, Yifan Sent: Tuesday, June 7, 2022 10:36 AM To: Zhang, Yifan ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Huang, Ray ; Huang, Tim ; Du, Xiaojian Subject: RE: [PATCH] drm/amdgpu/mes: only invalid/prime

RE: [PATCH] drm/amdgpu/mes: only invalid/prime icache after finish loading both pipe MES FWs.

2022-06-07 Thread Huang, Tim
Reviewed-by: Tim Huang -Original Message- From: Zhang, Yifan Sent: Tuesday, June 7, 2022 10:37 PM To: Zhang, Yifan ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Huang, Ray ; Huang, Tim ; Du, Xiaojian Subject: RE: [PATCH] drm/amdgpu/mes: only invalid/prime icache after

Re: [PATCH v2] drm/amdgpu: fix scratch register access method in SRIOV

2022-06-07 Thread Alex Deucher
On Sun, Jun 5, 2022 at 10:39 PM ZhenGuo Yin wrote: > > The scratch register should be accessed through MMIO instead of RLCG > in SRIOV, since it being used in RLCG register access function. > > Fixes: 0e1314781b9c("drm/amdgpu: nuke dynamic gfx scratch reg allocation") > Signed-off-by: ZhenGuo Yin

Re: [PATCH] drm/amdgpu/display: Fix compilation issues

2022-06-07 Thread Leo
On 2022-06-07 10:00, Alex Deucher wrote: > On Tue, Jun 7, 2022 at 4:27 AM Chandan Vurdigere Nataraj > wrote: >> >> [Why] >> Getting below build errors: >> drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1419:3: error: >> unannotated fall-through between switch labels >>

Re: [PATCH] drm/amdkfd: Add fw version for 10.3.6

2022-06-07 Thread Deucher, Alexander
[AMD Official Use Only - General] Does this need an update for GC 10.3.7 as well? Alex From: Zhang, Jesse(Jie) Sent: Monday, June 6, 2022 11:20 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Limonciello, Mario ; Chang, David ; Kuehling, Felix

Re: [PATCH v6 17/22] drm/shmem-helper: Add generic memory shrinker

2022-06-07 Thread Dmitry Osipenko
On 6/6/22 13:57, Christian König wrote: > Am 05.06.22 um 18:47 schrieb Daniel Vetter: >> On Fri, 27 May 2022 at 01:55, Dmitry Osipenko >> wrote: >>> Introduce a common DRM SHMEM shrinker framework that allows to reduce >>> code duplication among DRM drivers by replacing theirs custom shrinker >>>

[PATCH 1/1] drm/radeon: Initialize fences array entries in radeon_sa_bo_next_hole

2022-06-07 Thread Xiaohui Zhang
Similar to the handling of amdgpu_sa_bo_next_hole in commit 6a15f3ff19a8 ("drm/amdgpu: Initialize fences array entries in amdgpu_sa_bo_next_hole"), we thought a patch might be needed here as well. The entries were only initialized once in radeon_sa_bo_new. If a fence wasn't signalled yet in the

[PATCH 1/1] drm/radeon: integer overflow in radeon_mode_dumb_create()

2022-06-07 Thread Xiaohui Zhang
Similar to the handling of amdgpu_mode_dumb_create in commit 54ef0b5461c0 ("drm/amdgpu: integer overflow in amdgpu_mode_dumb_create()"), we thought a patch might be needed here as well. args->size is a u64. arg->pitch and args->height are u32. The multiplication will overflow instead of using

Re: [PATCH 3/3] drm/amdkfd: use existing VM helper for PD and PT validation in SVM

2022-06-07 Thread Felix Kuehling
Am 2022-06-07 um 05:59 schrieb Lang Yu: This will remove some redundant codes. Signed-off-by: Lang Yu The redundancy is quite small, and amdgpu_amdkfd_gpuvm_validate_pt_pd_bos and amdgpu_amdkfd_bo_validate are quite a bit more complex and handle more different cases. Someone changing

Re: [PATCH] Revert "workqueue: remove unused cancel_work()"

2022-06-07 Thread Alex Deucher
On Tue, Jun 7, 2022 at 1:14 PM Tejun Heo wrote: > > On Sat, May 21, 2022 at 12:04:00AM -0400, Andrey Grodzovsky wrote: > > From 78df30cc97f10c885f5159a293e6afe2348aa60c Mon Sep 17 00:00:00 2001 > > From: Andrey Grodzovsky > > Date: Thu, 19 May 2022 09:47:28 -0400 > > Subject: Revert "workqueue:

[PATCH AUTOSEL 5.17 42/60] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

[PATCH AUTOSEL 5.17 41/60] drm/amd/display: Check if modulo is 0 before dividing.

2022-06-07 Thread Sasha Levin
From: David Galiffi [ Upstream commit 49947b906a6bd9668eaf4f9cf691973c25c26955 ] [How & Why] If a value of 0 is read, then this will cause a divide-by-0 panic. Reviewed-by: Martin Leung Acked-by: Qingqing Zhuo Signed-off-by: David Galiffi Tested-by: Daniel Wheeler Signed-off-by: Alex

[PATCH AUTOSEL 5.17 43/60] drm/amd/pm: fix a potential gpu_metrics_table memory leak

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit d2f4460a3d9502513419f06cc376c7ade49d5753 ] gpu_metrics_table is allocated in yellow_carp_init_smc_tables() but not freed in yellow_carp_fini_smc_tables(). Signed-off-by: Gong Yuanjun Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin ---

[PATCH AUTOSEL 5.17 44/60] drm/amd/pm: Fix missing thermal throttler status

2022-06-07 Thread Sasha Levin
From: Lijo Lazar [ Upstream commit b0f4d663fce6a4232d3c20ce820f919111b1c60b ] On aldebaran, when thermal throttling happens due to excessive GPU temperature, the reason for throttling event is missed in warning message. This patch fixes it. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang

[PATCH AUTOSEL 5.10 29/38] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

[PATCH AUTOSEL 5.4 26/34] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

Re: [PATCH] umr: print MODE register as part of wave state

2022-06-07 Thread Alex Deucher
On Mon, Jun 6, 2022 at 5:04 PM Joseph Greathouse wrote: > > The MODE register contains detailed per-wave information, but UMR > skipped printing it. This patch adds the ability to print each wave's > MODE register as part of the wave scan operation, and prints the MODE > register's sub-fields as

Re: [PATCH 1/1] drm/radeon: integer overflow in radeon_mode_dumb_create()

2022-06-07 Thread Alex Deucher
Applied. Thanks! Alex On Tue, Jun 7, 2022 at 12:05 PM Xiaohui Zhang wrote: > > Similar to the handling of amdgpu_mode_dumb_create in commit 54ef0b5461c0 > ("drm/amdgpu: integer overflow in amdgpu_mode_dumb_create()"), > we thought a patch might be needed here as well. > > args->size is a u64.

[PATCH] drm/amd/display: fix null pointer deref error

2022-06-07 Thread Aurabindo Pillai
[Why] 0 was passed in place of a pointer which triggered null pointer dereference. [How] Pass in a pointer that contains nullified parameters instead of null pointer. Signed-off-by: Aurabindo Pillai --- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 9 ++--- 1 file changed, 6

[PATCH AUTOSEL 5.18 46/68] drm/amd/display: Check zero planes for OTG disable W/A on clock change

2022-06-07 Thread Sasha Levin
From: Nicholas Kazlauskas [ Upstream commit 66a197203794339b028eedfa880bff9367fce783 ] [Why] A display clock change hang can occur when switching between DIO and HPO enabled modes during the optimize_bandwidth in dc_commit_state_no_check call. This happens when going from 4k120 8bpc 420 to

[PATCH AUTOSEL 5.18 47/68] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

[PATCH AUTOSEL 5.18 48/68] drm/amd/pm: fix a potential gpu_metrics_table memory leak

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit d2f4460a3d9502513419f06cc376c7ade49d5753 ] gpu_metrics_table is allocated in yellow_carp_init_smc_tables() but not freed in yellow_carp_fini_smc_tables(). Signed-off-by: Gong Yuanjun Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin ---

[PATCH AUTOSEL 5.18 45/68] drm/amd/display: Check if modulo is 0 before dividing.

2022-06-07 Thread Sasha Levin
From: David Galiffi [ Upstream commit 49947b906a6bd9668eaf4f9cf691973c25c26955 ] [How & Why] If a value of 0 is read, then this will cause a divide-by-0 panic. Reviewed-by: Martin Leung Acked-by: Qingqing Zhuo Signed-off-by: David Galiffi Tested-by: Daniel Wheeler Signed-off-by: Alex

[PATCH AUTOSEL 5.17 59/60] drm/amd/pm: use bitmap_{from, to}_arr32 where appropriate

2022-06-07 Thread Sasha Levin
From: Yury Norov [ Upstream commit 525d6515604eb1373ce5e6372a6b6640953b2d6a ] The smu_v1X_0_set_allowed_mask() uses bitmap_copy() to convert bitmap to 32-bit array. This may be wrong due to endiannes issues. Fix it by switching to bitmap_{from,to}_arr32. CC: Alexander Gordeev CC: Andy

[PATCH AUTOSEL 5.15 50/51] drm/amd/pm: use bitmap_{from, to}_arr32 where appropriate

2022-06-07 Thread Sasha Levin
From: Yury Norov [ Upstream commit 525d6515604eb1373ce5e6372a6b6640953b2d6a ] The smu_v1X_0_set_allowed_mask() uses bitmap_copy() to convert bitmap to 32-bit array. This may be wrong due to endiannes issues. Fix it by switching to bitmap_{from,to}_arr32. CC: Alexander Gordeev CC: Andy

[PATCH 1/2] drm/amdgpu: remove acc_size from reserve/unreserve mem

2022-06-07 Thread Alex Sierra
TTM used to track the "acc_size" of all BOs internally. We needed to keep track of it in our memory reservation to avoid TTM running out of memory in its own accounting. However, that "acc_size" accounting has since been removed from TTM. Therefore we don't really need to track it any more.

[PATCH 2/2] drm/amdkfd: track unified memory reservation with xnack off

2022-06-07 Thread Alex Sierra
[WHY] Unified memory with xnack off should be tracked, as userptr mappings and legacy allocations do. To avoid oversuscribe system memory when xnack off. [How] Exposing functions reserve_mem_limit and unreserve_mem_limit to SVM API and call them on every prange creation and free. Signed-off-by:

Re: [PATCH] drm/amd/display: fix null pointer deref error

2022-06-07 Thread Aurabindo Pillai
On 2022-06-07 13:41, Alex Deucher wrote: On Tue, Jun 7, 2022 at 1:40 PM Rodrigo Siqueira Jordao wrote: On 2022-06-07 13:06, Aurabindo Pillai wrote: [Why] 0 was passed in place of a pointer which triggered null pointer dereference. [How] Pass in a pointer that contains nullified

Re: [PATCH 1/1] drm/radeon: Initialize fences array entries in radeon_sa_bo_next_hole

2022-06-07 Thread Alex Deucher
Applied. Thanks! Alex On Tue, Jun 7, 2022 at 12:04 PM Xiaohui Zhang wrote: > > Similar to the handling of amdgpu_sa_bo_next_hole in commit 6a15f3ff19a8 > ("drm/amdgpu: Initialize fences array entries in amdgpu_sa_bo_next_hole"), > we thought a patch might be needed here as well. > > The

Re: [PATCH] drm/amdgpu/display: Remove unnecessary typecasts and fix build issues

2022-06-07 Thread Leo
On 2022-06-07 05:40, Chandan Vurdigere Nataraj wrote: > [Why] > Getting below errors: > drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:1414:5: > error: implicit conversion from enumeration type 'enum scan_direction_class' > to different enumeration type 'enum

Re: [PATCH] drm/amd/display: fix null pointer deref error

2022-06-07 Thread Alex Deucher
On Tue, Jun 7, 2022 at 1:40 PM Rodrigo Siqueira Jordao wrote: > > > > On 2022-06-07 13:06, Aurabindo Pillai wrote: > > [Why] > > 0 was passed in place of a pointer which triggered null pointer > > dereference. > > > > [How] > > Pass in a pointer that contains nullified parameters instead of null

Re: [PATCH] drm/amdgpu/display: Remove unnecessary typecasts and fix build issues

2022-06-07 Thread Aurabindo Pillai
On 2022-06-07 11:34, Leo wrote: On 2022-06-07 05:40, Chandan Vurdigere Nataraj wrote: [Why] Getting below errors: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:1414:5: error: implicit conversion from enumeration type 'enum scan_direction_class' to different

[PATCH AUTOSEL 5.15 38/51] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

[PATCH AUTOSEL 5.15 37/51] drm/amd/display: Check if modulo is 0 before dividing.

2022-06-07 Thread Sasha Levin
From: David Galiffi [ Upstream commit 49947b906a6bd9668eaf4f9cf691973c25c26955 ] [How & Why] If a value of 0 is read, then this will cause a divide-by-0 panic. Reviewed-by: Martin Leung Acked-by: Qingqing Zhuo Signed-off-by: David Galiffi Tested-by: Daniel Wheeler Signed-off-by: Alex

[PATCH AUTOSEL 5.15 39/51] drm/amd/pm: Fix missing thermal throttler status

2022-06-07 Thread Sasha Levin
From: Lijo Lazar [ Upstream commit b0f4d663fce6a4232d3c20ce820f919111b1c60b ] On aldebaran, when thermal throttling happens due to excessive GPU temperature, the reason for throttling event is missed in warning message. This patch fixes it. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang

[PATCH AUTOSEL 4.9 17/19] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

Re: [PATCH 2/3] drm/amdgpu: Add peer-to-peer support among PCIe connected AMD GPUs

2022-06-07 Thread Felix Kuehling
Am 2022-06-07 um 04:23 schrieb Ramesh Errabolu: Add support for peer-to-peer communication among AMD GPUs over PCIe bus. Support REQUIRES enablement of config HSA_AMD_P2P. Signed-off-by: Ramesh Errabolu Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu.h |

Re: [PATCH] Revert "workqueue: remove unused cancel_work()"

2022-06-07 Thread Tejun Heo
On Sat, May 21, 2022 at 12:04:00AM -0400, Andrey Grodzovsky wrote: > From 78df30cc97f10c885f5159a293e6afe2348aa60c Mon Sep 17 00:00:00 2001 > From: Andrey Grodzovsky > Date: Thu, 19 May 2022 09:47:28 -0400 > Subject: Revert "workqueue: remove unused cancel_work()" > > This reverts commit

Re: [PATCH] drm/amd/display: fix null pointer deref error

2022-06-07 Thread Rodrigo Siqueira Jordao
On 2022-06-07 13:06, Aurabindo Pillai wrote: [Why] 0 was passed in place of a pointer which triggered null pointer dereference. [How] Pass in a pointer that contains nullified parameters instead of null pointer. Signed-off-by: Aurabindo Pillai ---

[PATCH AUTOSEL 5.18 50/68] drm/amd/pm: correct the metrics version for SMU 11.0.11/12/13

2022-06-07 Thread Sasha Levin
From: Evan Quan [ Upstream commit 396beb91a9eb86cbfa404e4220cca8f3ada70777 ] Correct the metrics version used for SMU 11.0.11/12/13. Fixes misreported GPU metrics (e.g., fan speed, etc.) depending on which version of SMU firmware is loaded. Bug:

[PATCH AUTOSEL 5.18 49/68] drm/amd/pm: Fix missing thermal throttler status

2022-06-07 Thread Sasha Levin
From: Lijo Lazar [ Upstream commit b0f4d663fce6a4232d3c20ce820f919111b1c60b ] On aldebaran, when thermal throttling happens due to excessive GPU temperature, the reason for throttling event is missed in warning message. This patch fixes it. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang

[PATCH AUTOSEL 5.18 67/68] drm/amd/pm: use bitmap_{from, to}_arr32 where appropriate

2022-06-07 Thread Sasha Levin
From: Yury Norov [ Upstream commit 525d6515604eb1373ce5e6372a6b6640953b2d6a ] The smu_v1X_0_set_allowed_mask() uses bitmap_copy() to convert bitmap to 32-bit array. This may be wrong due to endiannes issues. Fix it by switching to bitmap_{from,to}_arr32. CC: Alexander Gordeev CC: Andy

[PATCH AUTOSEL 4.19 22/27] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

[PATCH AUTOSEL 4.14 20/25] drm/radeon: fix a possible null pointer dereference

2022-06-07 Thread Sasha Levin
From: Gong Yuanjun [ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ] In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure

[PATCH 1/2] drm/amdgpu/vcn: add unified queue ib test

2022-06-07 Thread Ruijing Dong
- add unified queue headers - add unified queue ib tests. Signed-off-by: Ruijing Dong --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 102 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + 2 files changed, 100 insertions(+), 3 deletions(-) diff --git

[PATCH 2/2] drm/amdgpu/vcn: support unified queue only in vcn4

2022-06-07 Thread Ruijing Dong
- remove multiple queue support. - add unified queue related functions. Signed-off-by: Ruijing Dong --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 563 +++--- 1 file changed, 140 insertions(+), 423 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c

[RFC 03/18] drm/display/dp_mst: Rename drm_dp_mst_vcpi_allocation

2022-06-07 Thread Lyude Paul
In retrospect, the name I chose for this originally is confusing, as there's a lot more info in here then just the VCPI. This really should be called a payload. Let's make it more obvious that this is meant to be related to the atomic state and is about payloads by renaming it to

[RFC 02/18] drm/amdgpu/dm/mst: Rename get_payload_table()

2022-06-07 Thread Lyude Paul
This function isn't too confusing if you see the comment around the call-site for it, but if you don't then it's not at all obvious this is meant to copy DRM's payload table over to DC's internal state structs. Seeing this function before finding that comment definitely threw me into a loop a few

[RFC 01/18] drm/amdgpu/dc/mst: Rename dp_mst_stream_allocation(_table)

2022-06-07 Thread Lyude Paul
Just to make this more clear to outside contributors that these are DC-specific structs, as this also threw me into a loop a number of times before I figured out the purpose of this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Fangzhi Zuo ---

Re: [PATCH] Revert "workqueue: remove unused cancel_work()"

2022-06-07 Thread Tejun Heo
On Tue, Jun 07, 2022 at 01:39:01PM -0400, Alex Deucher wrote: > On Tue, Jun 7, 2022 at 1:14 PM Tejun Heo wrote: > > > > On Sat, May 21, 2022 at 12:04:00AM -0400, Andrey Grodzovsky wrote: > > > From 78df30cc97f10c885f5159a293e6afe2348aa60c Mon Sep 17 00:00:00 2001 > > > From: Andrey Grodzovsky >

[RESEND RFC 07/18] drm/display/dp_mst: Add helper for finding payloads in atomic MST state

2022-06-07 Thread Lyude Paul
We already open-code this quite often, and will be iterating through payloads even more once we've moved all of the payload tracking into the atomic state. So, let's add a helper for doing this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc:

[RESEND RFC 17/18] drm/radeon: Drop legacy MST support

2022-06-07 Thread Lyude Paul
Right now, radeon is technically the only non-atomic driver still making use of the MST helpers - and thus the final user of all of the legacy MST helpers. Originally I was going to look into seeing if we could move legacy MST into the radeon driver itself, however: * SI and CIK both can use

[RESEND RFC 15/18] drm/display/dp_mst: Skip releasing payloads if last connected port isn't connected

2022-06-07 Thread Lyude Paul
In the past, we've ran into strange issues regarding errors in response to trying to destroy payloads after a port has been unplugged. We fixed this back in: This is intended to replace the workaround that was added here: commit 3769e4c0af5b ("drm/dp_mst: Avoid to mess up payload table by ports

[RESEND RFC 09/18] drm/display/dp_mst: Don't open code modeset checks for releasing time slots

2022-06-07 Thread Lyude Paul
I'm not sure why, but at the time I originally wrote the find/release time slot helpers I thought we should avoid keeping modeset tracking out of the MST helpers. In retrospect though there's no actual good reason to do this, and the logic has ended up being identical across all the drivers using

[RESEND RFC 14/18] drm/display/dp_mst: Drop all ports from topology on CSNs before queueing link address work

2022-06-07 Thread Lyude Paul
We want to start cutting down on all of the places that we use port validation, so that ports may be removed from the topology as quickly as possible to minimize the number of errors we run into as a result of being out of sync with the current topology status. This isn't a very typical scenario

[RESEND RFC 16/18] drm/display/dp_mst: Maintain time slot allocations when deleting payloads

2022-06-07 Thread Lyude Paul
Currently, we set drm_dp_atomic_payload->time_slots to 0 in order to indicate that we're about to delete a payload in the current atomic state. Since we're going to be dropping all of the legacy code for handling the payload table however, we need to be able to ensure that we still keep track of

RE: [PATCH] drm/amdgpu: fix limiting AV1 to the first instance on VCN3

2022-06-07 Thread Dong, Ruijing
[AMD Official Use Only - General] I can see for VCN4, AV1 dec/enc also need to limit to the first instance. Thanks, Ruijing -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Friday, June 3, 2022 10:12 AM To: Christian König Cc: Pelloux-Prayer, Pierre-Eric ; amd-gfx

[RESEND RFC 04/18] drm/display/dp_mst: Call them time slots, not VCPI slots

2022-06-07 Thread Lyude Paul
VCPI is only sort of the correct term here, originally the majority of this code simply referred to timeslots vaguely as "slots" - and since I started working on it and adding atomic functionality, the name "VCPI slots" has been used to represent time slots. Now that we actually have consistent

[RESEND RFC 11/18] drm/nouveau/kms: Cache DP encoders in nouveau_connector

2022-06-07 Thread Lyude Paul
Post-NV50, the only kind of encoder you'll find for DP connectors on Nvidia GPUs are SORs (serial output resources). Because SORs have fixed associations with their connectors, we can correctly assume that any DP connector on a nvidia GPU will have exactly one SOR encoder routed to it for

[RESEND RFC 12/18] drm/nouveau/kms: Pull mst state in for all modesets

2022-06-07 Thread Lyude Paul
Since we're going to be relying on atomic locking for payloads now (and the MST mgr needs to track CRTCs), pull in the topology state for all modesets in nv50_msto_atomic_check(). Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- 1 file changed, 1 insertion(+), 1

[RESEND RFC 10/18] drm/display/dp_mst: Fix modeset tracking in drm_dp_atomic_release_vcpi_slots()

2022-06-07 Thread Lyude Paul
Currently with the MST helpers we avoid releasing payloads _and_ avoid pulling in the MST state if there aren't any actual payload changes. While we want to keep the first step, we need to now make sure that we're always pulling in the MST state on all modesets that can modify payloads - even if

[RESEND RFC 18/18] drm/display/dp_mst: Move all payload info into the atomic state

2022-06-07 Thread Lyude Paul
Now that we've finally gotten rid of the non-atomic MST users leftover in the kernel, we can finally get rid of all of the legacy payload code we have and move as much as possible into the MST atomic state structs. The main purpose of this is to make the MST code a lot less confusing to work on,

[RFC 00/18] drm/display/dp_mst: Drop Radeon MST support, make MST atomic-only

2022-06-07 Thread Lyude Paul
For quite a while we've been carrying around a lot of legacy modesetting code in the MST helpers that has been rather annoying to keep around, and very often gets in the way of trying to implement additional functionality in MST such as fallback link rate retraining, dynamic BPC management and DSC

[RFC 07/18] drm/display/dp_mst: Add helper for finding payloads in atomic MST state

2022-06-07 Thread Lyude Paul
We already open-code this quite often, and will be iterating through payloads even more once we've moved all of the payload tracking into the atomic state. So, let's add a helper for doing this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc:

[RFC 05/18] drm/display/dp_mst: Fix confusing docs for drm_dp_atomic_release_time_slots()

2022-06-07 Thread Lyude Paul
For some reason we mention returning 0 if "slots have been added back to drm_dp_mst_topology_state->avail_slots". This is totally misleading, avail_slots is simply for figuring out the total number of slots available in total on the topology and has no relation to the current payload allocations.

[RFC 06/18] drm/display/dp_mst: Add some missing kdocs for atomic MST structs

2022-06-07 Thread Lyude Paul
Since we're about to start adding some stuff here, we may as well fill in any missing documentation that we forgot to write. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul ---

[RESEND RFC 06/18] drm/display/dp_mst: Add some missing kdocs for atomic MST structs

2022-06-07 Thread Lyude Paul
Since we're about to start adding some stuff here, we may as well fill in any missing documentation that we forgot to write. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul ---

[RESEND RFC 05/18] drm/display/dp_mst: Fix confusing docs for drm_dp_atomic_release_time_slots()

2022-06-07 Thread Lyude Paul
For some reason we mention returning 0 if "slots have been added back to drm_dp_mst_topology_state->avail_slots". This is totally misleading, avail_slots is simply for figuring out the total number of slots available in total on the topology and has no relation to the current payload allocations.

[RESEND RFC 08/18] drm/display/dp_mst: Add nonblocking helpers for DP MST

2022-06-07 Thread Lyude Paul
As Daniel Vetter pointed out, if we only use the atomic modesetting locks with MST it's technically possible for a driver with non-blocking modesets to race when it comes to MST displays - as we make the mistake of not doing our own CRTC commit tracking in the topology_state object. This could

[RESEND RFC 02/18] drm/amdgpu/dm/mst: Rename get_payload_table()

2022-06-07 Thread Lyude Paul
This function isn't too confusing if you see the comment around the call-site for it, but if you don't then it's not at all obvious this is meant to copy DRM's payload table over to DC's internal state structs. Seeing this function before finding that comment definitely threw me into a loop a few

Re: [PATCH 2/2] drm/amdkfd: track unified memory reservation with xnack off

2022-06-07 Thread Felix Kuehling
Am 2022-06-07 um 13:17 schrieb Alex Sierra: [WHY] Unified memory with xnack off should be tracked, as userptr mappings and legacy allocations do. To avoid oversuscribe system memory when xnack off. [How] Exposing functions reserve_mem_limit and unreserve_mem_limit to SVM API and call them on

[RFC 04/18] drm/display/dp_mst: Call them time slots, not VCPI slots

2022-06-07 Thread Lyude Paul
VCPI is only sort of the correct term here, originally the majority of this code simply referred to timeslots vaguely as "slots" - and since I started working on it and adding atomic functionality, the name "VCPI slots" has been used to represent time slots. Now that we actually have consistent

[RESEND RFC 00/18] drm/display/dp_mst: Drop Radeon MST support, make MST atomic-only

2022-06-07 Thread Lyude Paul
Ugh, thanks ./scripts/get_maintainers.pl for confusing and breaking git-send email <<. Sorry for the resend everyone. For quite a while we've been carrying around a lot of legacy modesetting code in the MST helpers that has been rather annoying to keep around, and very often gets in the way of

[RESEND RFC 03/18] drm/display/dp_mst: Rename drm_dp_mst_vcpi_allocation

2022-06-07 Thread Lyude Paul
In retrospect, the name I chose for this originally is confusing, as there's a lot more info in here then just the VCPI. This really should be called a payload. Let's make it more obvious that this is meant to be related to the atomic state and is about payloads by renaming it to

[RESEND RFC 01/18] drm/amdgpu/dc/mst: Rename dp_mst_stream_allocation(_table)

2022-06-07 Thread Lyude Paul
Just to make this more clear to outside contributors that these are DC-specific structs, as this also threw me into a loop a number of times before I figured out the purpose of this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Fangzhi Zuo ---

[RESEND RFC 13/18] drm/display/dp_mst: Add helpers for serializing SST <-> MST transitions

2022-06-07 Thread Lyude Paul
There's another kind of situation where we could potentially race with nonblocking modesets and MST, especially if we were to only use the locking provided by atomic modesetting: * Display 1 begins as enabled on DP-1 in SST mode * Display 1 switches to MST mode, exposes one sink in MST mode *

Re: [PATCH] drm/amdgpu: fix limiting AV1 to the first instance on VCN3

2022-06-07 Thread Alex Deucher
We'll need to implement the parse callbacks for vcn4 as well if we haven't already. Alex On Tue, Jun 7, 2022 at 4:20 PM Dong, Ruijing wrote: > > [AMD Official Use Only - General] > > I can see for VCN4, AV1 dec/enc also need to limit to the first instance. > > Thanks, > Ruijing > >

Re: [PATCH] drm/amdgpu: always flush the TLB on gfx8

2022-06-07 Thread Alex Deucher
On Fri, Jun 3, 2022 at 9:05 AM Christian König wrote: > > The TLB on GFX8 stores each block of 8 PTEs where any of the valid bits > are set. > > Signed-off-by: Christian König Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 + > 1 file changed, 5

Re: [RESEND RFC 17/18] drm/radeon: Drop legacy MST support

2022-06-07 Thread Alex Deucher
On Tue, Jun 7, 2022 at 3:39 PM Lyude Paul wrote: > > Right now, radeon is technically the only non-atomic driver still making > use of the MST helpers - and thus the final user of all of the legacy MST > helpers. Originally I was going to look into seeing if we could move legacy > MST into the

[RFC 1/3] drm/amd/display: Introduce KUnit to DML

2022-06-07 Thread Maíra Canal
KUnit unifies the test structure and provides helper tools that simplify the development. Basic use case allows running tests as regular processes, which makes easier to run unit tests on a development machine and to integrate the tests in a CI system. This commit introduce a basic unit test to

[RFC 3/3] drm/amd/display: Introduce KUnit tests to the bw_fixed library

2022-06-07 Thread Maíra Canal
From: Magali Lemes The bw_fixed library performs a lot of the mathematical operations involving fixed-point arithmetic and the conversion of integers to fixed-point representation. As fixed-point representation is the base foundation of the DML calcs operations, this unit tests intend to assure

[RFC 2/3] drm/amd/display: Move bw_fixed macros to header file

2022-06-07 Thread Maíra Canal
The macros defined at bw_fixed are important mathematical definitions, specifying masks to get the fractional part and the maximum and minimum values of I64. In order to enable unit tests for bw_fixed, it is relevant to have access to those macros. This commit moves the macros to the header file,

[RFC 0/3] drm/amd/display: Introduce KUnit to Display Mode Library

2022-06-07 Thread Maíra Canal
This RFC is a preview of the work being developed by Isabella Basso [1], Maíra Canal [2], and Tales Lelo [3], as part of their Google Summer of Code projects [4], and Magali Lemes [5], as part of her capstone project. Our main goal is to bring unit testing to the AMDPGU driver; in particular,

[PATCH 4/4] drm/amdgpu: Update mes_v11_api_def.h

2022-06-07 Thread Graham Sider
Update MES API to support oversubscription without aggregated doorbell for usermode queues. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 1 + drivers/gpu/drm/amd/amdgpu/mes_v11_0.c

[PATCH 1/4] drm/amdgpu: Fetch MES scheduler/KIQ versions

2022-06-07 Thread Graham Sider
Store MES scheduler and MES KIQ version numbers in amdgpu_mes. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 3 +++ drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 12 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h

[PATCH 2/4] drm/amdkfd: Pass MES/RS64 information to sysfs

2022-06-07 Thread Graham Sider
Make MES/RS64 CP enablement and MES scheduler/MES KIQ versions available through sysfs. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c

[PATCH 3/4] drm/amdkfd: Enable GFX11 usermode queue oversubscription

2022-06-07 Thread Graham Sider
Starting with GFX11, MES requires wptr BOs to be GTT allocated/mapped to GART for usermode queues in order to support oversubscription. In the case that work is submitted to an unmapped queue, MES must have a GART wptr address to determine whether the queue should be mapped. This change is

[PATCH 1/1] drm/amdgpu/jpeg2: Add jpeg vmid update under IB submit

2022-06-07 Thread Mohammad Zafar Ziya
Add jpeg vmid update under IB submit Signed-off-by: Mohammad Zafar Ziya Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 6 +- drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git

  1   2   >