[PATCH 2/4] drm/amd: Align SMU11 SMU_MSG_OverridePcieParameters implementation with SMU13

2023-07-07 Thread Mario Limonciello
SMU13 overrides dynamic PCIe lane width and dynamic speed by when on certain hosts. commit 87c617c72628 ("drm/amd/pm: conditionally disable pcie lane switching for some sienna_cichlid SKUs") worked around this issue by setting up certain SKUs to set up certain limits, but the same fundamental

[PATCH 3/4] drm/amd: Use amdgpu_device_pcie_dynamic_switching_supported() for SMU7

2023-07-07 Thread Mario Limonciello
SMU7 does a check if the dGPU is inserted into a Rocket Lake system, to turn off DPM. Extend this check to all systems that have problems with dynamic switching by using the amdgpu_device_pcie_dynamic_switching_supported() helper. Signed-off-by: Mario Limonciello ---

[PATCH 4/4] drm/amd: Drop amdgpu_device_aspm_support_quirk()

2023-07-07 Thread Mario Limonciello
NV and VI currently set up a quirk to not enable ASPM on Alder Lake systems, but the issue appears to be tied to hosts without support for dynamic speed switching. Migrate both of these over to use amdgpu_device_pcie_dynamic_switching_supported() instead and drop

[PATCH 0/4] Extend amdgpu_device_pcie_dynamic_switching_supported()

2023-07-07 Thread Mario Limonciello
amdgpu_device_pcie_dynamic_switching_supported() currently only covers SMU13. It sets up the pcietables so that effectively DPM can't change speed or lane width dynamically on problematic hosts. Earlier quirks to SMU11 did a similar solution by looking at specific PCI IDs typically paired with

[PATCH 1/4] drm/amd: Move helper for dynamic speed switch check out of smu13

2023-07-07 Thread Mario Limonciello
This helper is used for checking if the connected host supports the feature, it can be moved into generic code to be used by other smu implementations as well. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[Patch v2] drm/ttm: Use init_on_free to delay release TTM BOs

2023-07-07 Thread Rajneesh Bhardwaj
Delay release TTM BOs when the kernel default setting is init_on_free. This offloads the overhead of clearing the system memory to the work item and potentially a different CPU. This could be very beneficial when the application does a lot of malloc/free style allocations of system memory.

Re: [PATCH 1/4] drm/amdkfd: add kfd2kgd debugger callbacks for GC v9.4.3

2023-07-07 Thread Kim, Jonathan
Yeah that's an unfortunate mismatch. Leave it then. We can always clean it up later if theres a strong preference to do so. Jon From: Huang, JinHuiEric Sent: Friday, July 7, 2023 8:25 PM To: Kim, Jonathan ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH

Re: [PATCH 1/4] drm/amdkfd: add kfd2kgd debugger callbacks for GC v9.4.3

2023-07-07 Thread Eric Huang
Thanks for your review. The prefix name change will be contradictory that new functions prefix name is different with existing functions prefix name. Are you sure it doesn't matter? Regards, Eric On 2023-07-07 19:52, Kim, Jonathan wrote: I would change the static prefix names from kgd_gfx_ to

Re: [PATCH 1/4] drm/amdkfd: add kfd2kgd debugger callbacks for GC v9.4.3

2023-07-07 Thread Kim, Jonathan
I would change the static prefix names from kgd_gfx_ to kgd_gc_ to match file name and specify it as the target GC version. With that fixed and assuming grace period instance fix ups will follow after, this patch and series is: Reviewed-by: Jonathan Kim

[PATCH v5 6/6] drm/doc: Define KMS atomic state set

2023-07-07 Thread André Almeida
From: Pekka Paalanen Specify how the atomic state is maintained between userspace and kernel, plus the special case for async flips. Signed-off-by: Pekka Paalanen Signed-off-by: André Almeida --- v4: total rework by Pekka --- Documentation/gpu/drm-uapi.rst | 41

[PATCH v5 5/6] drm: Refuse to async flip with atomic prop changes

2023-07-07 Thread André Almeida
Given that prop changes may lead to modesetting, which would defeat the fast path of the async flip, refuse any atomic prop change for async flips in atomic API. The only exceptions are the framebuffer ID to flip to and the mode ID, that could be referring to an identical mode. Signed-off-by:

[PATCH v5 4/6] amd/display: indicate support for atomic async page-flips on DC

2023-07-07 Thread André Almeida
From: Simon Ser amdgpu_dm_commit_planes() already sets the flip_immediate flag for async page-flips. This flag is used to set the UNP_FLIP_CONTROL register. Thus, no additional change is required to handle async page-flips with the atomic uAPI. Signed-off-by: Simon Ser Reviewed-by: André

[PATCH v5 3/6] drm: introduce drm_mode_config.atomic_async_page_flip_not_supported

2023-07-07 Thread André Almeida
From: Simon Ser This new field indicates whether the driver has the necessary logic to support async page-flips via the atomic uAPI. This is leveraged by the next commit to allow user-space to use this functionality. All atomic drivers setting drm_mode_config.async_page_flip are updated to also

[PATCH v5 2/6] drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP

2023-07-07 Thread André Almeida
From: Simon Ser This new kernel capability indicates whether async page-flips are supported via the atomic uAPI. DRM clients can use it to check for support before feeding DRM_MODE_PAGE_FLIP_ASYNC to the kernel. Make it clear that DRM_CAP_ASYNC_PAGE_FLIP is for legacy uAPI only. Signed-off-by:

[PATCH v5 1/6] drm: allow DRM_MODE_PAGE_FLIP_ASYNC for atomic commits

2023-07-07 Thread André Almeida
From: Simon Ser If the driver supports it, allow user-space to supply the DRM_MODE_PAGE_FLIP_ASYNC flag to request an async page-flip. Set drm_crtc_state.async_flip accordingly. Document that drivers will reject atomic commits if an async flip isn't possible. This allows user-space to fall back

[PATCH v5 0/6] drm: Add support for atomic async page-flip

2023-07-07 Thread André Almeida
Hi, This work from me and Simon adds support for DRM_MODE_PAGE_FLIP_ASYNC through the atomic API. This feature is already available via the legacy API. The use case is to be able to present a new frame immediately (or as soon as possible), even if after missing a vblank. This might result in

Re: [regression][6.5] KASAN: slab-out-of-bounds in amdgpu_vm_pt_create+0x555/0x670 [amdgpu] on Radeon 7900XTX

2023-07-07 Thread Mikhail Gavrilov
On Fri, Jul 7, 2023 at 6:01 AM Chen, Guchun wrote: > > [Public] > > Hi Mike, > > Yes, we are aware of this problem, and we are working on that. The problem is > caused by recent code stores xcp_id to amdgpu bo for accounting memory usage > and so on. However, not all VMs are attached to that

Re: [PATCH 0/2] Disable dynamic switching for SMU13 on Intel hosts

2023-07-07 Thread Alex Deucher
On Fri, Jul 7, 2023 at 3:32 PM Mario Limonciello wrote: > > When ASPM is enabled, DPM is used to perform dynamic switching. When > connected to an Intel PCIe controller this causes malfunctions. > > Identify this combination and disable dynamic switching in SMU13. > > This series superceeds my

Re: [PATCH libdrm v2] amdgpu: Use PRI?64 to format uint64_t

2023-07-07 Thread Geert Uytterhoeven
Hi Christian, On Fri, Jul 7, 2023 at 2:06 PM Christian König wrote: > Am 06.07.23 um 10:36 schrieb Geert Uytterhoeven: > > On 32-bit: > > > > ../tests/amdgpu/amdgpu_stress.c: In function ‘alloc_bo’: > > ../tests/amdgpu/amdgpu_stress.c:178:49: warning: format ‘%lx’ expects > > argument

[PATCH 1/2] drm/amd/pm: share the code around SMU13 pcie parameters update

2023-07-07 Thread Mario Limonciello
From: Evan Quan So that SMU13.0.0 and SMU13.0.7 do not need to have one copy each. Signed-off-by: Evan Quan Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 4 +++ .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c| 31 +

[PATCH 2/2] drm/amd/pm: conditionally disable pcie lane/speed switching for SMU13

2023-07-07 Thread Mario Limonciello
Intel platforms such as Sapphire Rapids and Raptor Lake don't support dynamic pcie lane or speed switching. This limitation seems to carry over from one generation to another. To be safer, disable dynamic pcie lane width and speed switching when running on an Intel platform. Link:

[PATCH 0/2] Disable dynamic switching for SMU13 on Intel hosts

2023-07-07 Thread Mario Limonciello
When ASPM is enabled, DPM is used to perform dynamic switching. When connected to an Intel PCIe controller this causes malfunctions. Identify this combination and disable dynamic switching in SMU13. This series superceeds my other series [1] and fixes it in a cleaner way. [1]

RE: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance

2023-07-07 Thread Kim, Jonathan
[Public] > -Original Message- > From: Kim, Jonathan > Sent: Friday, July 7, 2023 1:06 PM > To: Huang, JinHuiEric ; amd- > g...@lists.freedesktop.org > Cc: Joshi, Mukul > Subject: RE: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance > > > > > -Original Message- > >

Re: [PATCH] [v2] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-07 Thread Alex Deucher
Applied. thanks! On Fri, Jul 7, 2023 at 7:47 AM Christian König wrote: > > Am 07.07.23 um 13:11 schrieb Arnd Bergmann: > > From: Arnd Bergmann > > > > On 32-bit architectures comparing a resource against a value larger than > > U32_MAX can cause a warning: > > > >

[PATCH 3/4] drm/amdkfd: enable watch points globally for gfx943

2023-07-07 Thread Eric Huang
From: Jonathan Kim Set watch points for all xcc instances on GFX943. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Eric Huang Reviewed-by: Jonathan Kim --- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff

[PATCH 4/4] drm/amdkfd: add multi-process debugging support for GC v9.4.3

2023-07-07 Thread Eric Huang
From: Jonathan Kim Similar to GC v9.4.2, GC v9.4.3 should use the 5-Dword extended MAP_PROCESS packet to support multi-process debugging. Update the mutli-process debug support list so that the KFD updates the runlist on debug mode setting and that it allocates enough GTT memory during KFD

[PATCH 1/4] drm/amdkfd: add kfd2kgd debugger callbacks for GC v9.4.3

2023-07-07 Thread Eric Huang
From: Jonathan Kim Implement the similarities as GC v9.4.2, and the difference for GC v9.4.3 HW spec, i.e. xcc instance. Signed-off-by: Jonathan Kim Signed-off-by: Eric Huang --- .../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 8 +- .../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h | 27 +++

[PATCH 2/4] drm/amdkfd: restore debugger additional info for gfx v9_4_3

2023-07-07 Thread Eric Huang
From: Jonathan Kim The additional information that the KFD reports to the debugger was destroyed when the following commit was merged: "drm/amdkfd: convert switches to IP version checking" Signed-off-by: Jonathan Kim Reviewed-by: Harish Kasiviswanathan Signed-off-by: Jonathan Kim Acked-by:

[PATCH 0/4] Upstream debugger feature for GFX v9.4.3

2023-07-07 Thread Eric Huang
Jonathan Kim (4): drm/amdkfd: add kfd2kgd debugger callbacks for GC v9.4.3 drm/amdkfd: restore debugger additional info for gfx v9_4_3 drm/amdkfd: enable watch points globally for gfx943 drm/amdkfd: add multi-process debugging support for GC v9.4.3

Re: [PATCH v2] drm/amdgpu: Increase soft IH ring size

2023-07-07 Thread Philip Yang
On 2023-07-07 13:15, Felix Kuehling wrote: On 2023-07-07 11:49, Philip Yang wrote: Retry faults are delegated to soft IH ring and then processed by deferred worker. Current soft IH ring size PAGE_SIZE can store

Re: [PATCH v2] drm/amdgpu: Increase soft IH ring size

2023-07-07 Thread Felix Kuehling
On 2023-07-07 11:49, Philip Yang wrote: Retry faults are delegated to soft IH ring and then processed by deferred worker. Current soft IH ring size PAGE_SIZE can store 128 entries, which may overflow and drop retry faults, causes HW stucks because the retry fault is not recovered. Increase soft

RE: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance

2023-07-07 Thread Kim, Jonathan
[Public] > -Original Message- > From: Huang, JinHuiEric > Sent: Friday, July 7, 2023 12:44 PM > To: Kim, Jonathan ; amd-gfx@lists.freedesktop.org > Cc: Joshi, Mukul > Subject: Re: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance > > > On 2023-07-07 11:56, Kim, Jonathan

Re: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance

2023-07-07 Thread Eric Huang
On 2023-07-07 11:56, Kim, Jonathan wrote: [Public] -Original Message- From: Huang, JinHuiEric Sent: Friday, July 7, 2023 11:46 AM To: Kim, Jonathan ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance On 2023-07-07 10:59, Kim,

RE: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance

2023-07-07 Thread Kim, Jonathan
[Public] > -Original Message- > From: Huang, JinHuiEric > Sent: Friday, July 7, 2023 11:46 AM > To: Kim, Jonathan ; amd-gfx@lists.freedesktop.org > Subject: Re: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance > > > On 2023-07-07 10:59, Kim, Jonathan wrote: > > [Public] > > >

[PATCH v2] drm/amdgpu: Increase soft IH ring size

2023-07-07 Thread Philip Yang
Retry faults are delegated to soft IH ring and then processed by deferred worker. Current soft IH ring size PAGE_SIZE can store 128 entries, which may overflow and drop retry faults, causes HW stucks because the retry fault is not recovered. Increase soft IH ring size to 8KB, enough to store 256

Re: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance

2023-07-07 Thread Eric Huang
On 2023-07-07 10:59, Kim, Jonathan wrote: [Public] -Original Message- From: Huang, JinHuiEric Sent: Thursday, July 6, 2023 2:19 PM To: amd-gfx@lists.freedesktop.org Cc: Kim, Jonathan ; Huang, JinHuiEric Subject: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance each xcc

[PATCH v5] drm/amdgpu:update kernel vcn ring test

2023-07-07 Thread Saleemkhan Jamadar
add session context buffer to decoder ring test. v5 - clear the session ct buffer (Christian) v4 - data type, explain change of ib size change (Christian) v3 - indent and v2 changes correction. (Christian) v2 - put the buffer at the end of the IB (Christian) Signed-off-by: Saleemkhan Jamadar

Re: [PATCH] drm/amdgpu: Increase IH soft ring size

2023-07-07 Thread Felix Kuehling
Am 2023-07-07 um 10:14 schrieb Philip Yang: Retry faults are delegated to IH soft ring and then processed by deferred worker. Current IH soft ring size PAGE_SIZE can store 128 entries, which may overflow and drop retry faults, causes HW stucks because the retry fault is not recovered.

RE: [PATCH 6/6] drm/amdkfd: add multi-process debugging support for GC v9.4.3

2023-07-07 Thread Kim, Jonathan
[Public] > -Original Message- > From: Huang, JinHuiEric > Sent: Thursday, July 6, 2023 2:19 PM > To: amd-gfx@lists.freedesktop.org > Cc: Kim, Jonathan ; Kim, Jonathan > ; Kuehling, Felix ; > Huang, JinHuiEric > Subject: [PATCH 6/6] drm/amdkfd: add multi-process debugging support for >

RE: [PATCH 3/6] drm/amdkfd: enable watch points globally for gfx943

2023-07-07 Thread Kim, Jonathan
[Public] > -Original Message- > From: Huang, JinHuiEric > Sent: Thursday, July 6, 2023 2:19 PM > To: amd-gfx@lists.freedesktop.org > Cc: Kim, Jonathan ; Kim, Jonathan > ; Kuehling, Felix ; > Huang, JinHuiEric > Subject: [PATCH 3/6] drm/amdkfd: enable watch points globally for gfx943 > >

Re: [PATCH v4] drm/amdgpu:update kernel vcn ring test

2023-07-07 Thread Saleemkhan Jamadar
Hi Christian, response inline   [Saleem]. Regards, Saleem On 07/07/23 12:35, Christian König wrote: Am 06.07.23 um 16:47 schrieb Saleemkhan Jamadar: add session context buffer to decoder ring test. v4 - data type, explain change of ib size change (Christian) v3 - indent and  v2 changes

RE: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance

2023-07-07 Thread Kim, Jonathan
[Public] > -Original Message- > From: Huang, JinHuiEric > Sent: Thursday, July 6, 2023 2:19 PM > To: amd-gfx@lists.freedesktop.org > Cc: Kim, Jonathan ; Huang, JinHuiEric > > Subject: [PATCH 4/6] drm/amdkfd: enable grace period for xcc instance > > each xcc instance needs to get iq wait

RE: [PATCH] drm/amdgpu: Increase IH soft ring size

2023-07-07 Thread Joshi, Mukul
[AMD Official Use Only - General] > -Original Message- > From: Yang, Philip > Sent: Friday, July 7, 2023 10:15 AM > To: amd-gfx@lists.freedesktop.org > Cc: Kuehling, Felix ; Joshi, Mukul > ; Yang, Philip > Subject: [PATCH] drm/amdgpu: Increase IH soft ring size > > Retry faults are

RE: [PATCH 5/6] drm/amdkfd: always keep trap enabled for GC v9.4.3

2023-07-07 Thread Kim, Jonathan
[Public] If we implement this in the GC 9.4.3 KGD disable call in patch 1 (see comments for that one), then it will look less awkward and we can drop this. Thanks, Jon > -Original Message- > From: Huang, JinHuiEric > Sent: Thursday, July 6, 2023 2:19 PM > To:

RE: [PATCH 1/6] drm/amdkfd: add kfd2kgd debugger callbacks for GC v9.4.3

2023-07-07 Thread Kim, Jonathan
[AMD Official Use Only - General] > -Original Message- > From: Huang, JinHuiEric > Sent: Thursday, July 6, 2023 2:19 PM > To: amd-gfx@lists.freedesktop.org > Cc: Kim, Jonathan ; Kim, Jonathan > ; Huang, JinHuiEric > Subject: [PATCH 1/6] drm/amdkfd: add kfd2kgd debugger callbacks for GC

[PATCH] drm/amdgpu: Increase IH soft ring size

2023-07-07 Thread Philip Yang
Retry faults are delegated to IH soft ring and then processed by deferred worker. Current IH soft ring size PAGE_SIZE can store 128 entries, which may overflow and drop retry faults, causes HW stucks because the retry fault is not recovered. Increase IH soft ring size to the same size as IH ring,

[PATCH v3] drm/amdgpu: check whether smu is idle in sriov case

2023-07-07 Thread Danijel Slivka
Why: If the reg mmMP1_SMN_C2PMSG_90 is being programed to 0x0 before guest initialization, then modprobe amdgpu will fail at smu hw_init. (the default mmMP1_SMN_C2PMSG_90 at a clean guest environment is 0x1). How to fix: this patch is to check whether smu is idle by sending a test message to smu.

Re: [PATCH v5 04/10] drm/amdgpu: create GFX-gen11 usermode queue

2023-07-07 Thread Shashank Sharma
On 07/07/2023 14:28, Christian König wrote: Am 07.07.23 um 12:02 schrieb Shashank Sharma: On 07/07/2023 10:37, Christian König wrote: Am 07.07.23 um 09:46 schrieb Shashank Sharma: On 07/07/2023 09:24, Christian König wrote: Am 06.07.23 um 14:35 schrieb Shashank Sharma: A Memory

Re: [PATCH v5 04/10] drm/amdgpu: create GFX-gen11 usermode queue

2023-07-07 Thread Christian König
Am 07.07.23 um 12:02 schrieb Shashank Sharma: On 07/07/2023 10:37, Christian König wrote: Am 07.07.23 um 09:46 schrieb Shashank Sharma: On 07/07/2023 09:24, Christian König wrote: Am 06.07.23 um 14:35 schrieb Shashank Sharma: A Memory queue descriptor (MQD) of a userqueue defines it

Re: [PATCH libdrm v2] amdgpu: Use PRI?64 to format uint64_t

2023-07-07 Thread Christian König
Am 06.07.23 um 10:36 schrieb Geert Uytterhoeven: On 32-bit: ../tests/amdgpu/amdgpu_stress.c: In function ‘alloc_bo’: ../tests/amdgpu/amdgpu_stress.c:178:49: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long

Re: [PATCH] drm/amdgpu: correct the UCODE ID used for VCN 4.0.3 SRAM update

2023-07-07 Thread Lazar, Lijo
On 7/7/2023 5:19 PM, Lang Yu wrote: On 07/07/ , Lazar, Lijo wrote: On 7/7/2023 5:01 PM, Lang Yu wrote: It uses the same UCODE ID(VCN0_RAM) but differnet cmd buffers for all instances. Fixes: e928b52c58dd ("drm/amdgpu: use psp_execute_load_ip_fw_cmd_buf instead") Signed-off-by: Lang Yu

Re: [PATCH] drm/amdgpu: correct the UCODE ID used for VCN 4.0.3 SRAM update

2023-07-07 Thread Lang Yu
On 07/07/ , Lazar, Lijo wrote: > > > On 7/7/2023 5:01 PM, Lang Yu wrote: > > It uses the same UCODE ID(VCN0_RAM) but differnet cmd buffers > > for all instances. > > > > Fixes: e928b52c58dd ("drm/amdgpu: use psp_execute_load_ip_fw_cmd_buf > > instead") > > > > Signed-off-by: Lang Yu > > ---

Re: [PATCH] [v2] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-07 Thread Christian König
Am 07.07.23 um 13:11 schrieb Arnd Bergmann: From: Arnd Bergmann On 32-bit architectures comparing a resource against a value larger than U32_MAX can cause a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: error: result of comparison of constant 4294967296 with expression of type

Re: [PATCH] drm/amdgpu: correct the UCODE ID used for VCN 4.0.3 SRAM update

2023-07-07 Thread Lazar, Lijo
On 7/7/2023 5:01 PM, Lang Yu wrote: It uses the same UCODE ID(VCN0_RAM) but differnet cmd buffers for all instances. Fixes: e928b52c58dd ("drm/amdgpu: use psp_execute_load_ip_fw_cmd_buf instead") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 +- 1 file changed,

[PATCH] drm/amdgpu: correct the UCODE ID used for VCN 4.0.3 SRAM update

2023-07-07 Thread Lang Yu
It uses the same UCODE ID(VCN0_RAM) but differnet cmd buffers for all instances. Fixes: e928b52c58dd ("drm/amdgpu: use psp_execute_load_ip_fw_cmd_buf instead") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 2/2] drm/amdgpu: use psp_execute_load_ip_fw_cmd_buf instead

2023-07-07 Thread Lang Yu
On 07/07/ , Lazar, Lijo wrote: > > > On 6/29/2023 1:44 PM, Lang Yu wrote: > > Ping. > > > > On 06/27/ , Lang Yu wrote: > > > Replace the old ones with psp_execute_load_ip_fw_cmd_buf. > > > > > > Signed-off-by: Lang Yu > > > --- > > > drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 31

[PATCH] [v2] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-07 Thread Arnd Bergmann
From: Arnd Bergmann On 32-bit architectures comparing a resource against a value larger than U32_MAX can cause a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is

Re: [PATCH v2] drm/amdgpu: check whether smu is idle in sriov case

2023-07-07 Thread Lazar, Lijo
On 7/7/2023 3:47 PM, Danijel Slivka wrote: Why: If the reg mmMP1_SMN_C2PMSG_90 is being programed to 0x0 before guest initialization, then modprobe amdgpu will fail at smu hw_init. (the default mmMP1_SMN_C2PMSG_90 at a clean guest environment is 0x1). A response to the FW message doesn't

Re: [PATCH 2/2] drm/amdgpu: use psp_execute_load_ip_fw_cmd_buf instead

2023-07-07 Thread Lazar, Lijo
On 6/29/2023 1:44 PM, Lang Yu wrote: Ping. On 06/27/ , Lang Yu wrote: Replace the old ones with psp_execute_load_ip_fw_cmd_buf. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 31 - drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 2 --

[PATCH v2] drm/amdgpu: check whether smu is idle in sriov case

2023-07-07 Thread Danijel Slivka
Why: If the reg mmMP1_SMN_C2PMSG_90 is being programed to 0x0 before guest initialization, then modprobe amdgpu will fail at smu hw_init. (the default mmMP1_SMN_C2PMSG_90 at a clean guest environment is 0x1). How to fix: this patch is to check whether smu is idle by sending a test message to smu.

Re: [PATCH v5 04/10] drm/amdgpu: create GFX-gen11 usermode queue

2023-07-07 Thread Shashank Sharma
On 07/07/2023 10:37, Christian König wrote: Am 07.07.23 um 09:46 schrieb Shashank Sharma: On 07/07/2023 09:24, Christian König wrote: Am 06.07.23 um 14:35 schrieb Shashank Sharma: A Memory queue descriptor (MQD) of a userqueue defines it in the hw's context. As MQD format can vary

Re: [PATCH v5 08/10] drm/amdgpu: generate doorbell index for userqueue

2023-07-07 Thread Shashank Sharma
On 07/07/2023 09:57, Christian König wrote: Am 07.07.23 um 09:39 schrieb Shashank Sharma: On 07/07/2023 09:15, Christian König wrote: Am 06.07.23 um 14:36 schrieb Shashank Sharma: The userspace sends us the doorbell object and the relative doobell index in the object to be used for the

Re: [PATCH v5 04/10] drm/amdgpu: create GFX-gen11 usermode queue

2023-07-07 Thread Christian König
Am 07.07.23 um 09:46 schrieb Shashank Sharma: On 07/07/2023 09:24, Christian König wrote: Am 06.07.23 um 14:35 schrieb Shashank Sharma: A Memory queue descriptor (MQD) of a userqueue defines it in the hw's context. As MQD format can vary between different graphics IPs, we need gfx GEN

Re: [PATCH 1/2] drm/amdgpu/gfx9: move update_spm_vmid() out of rlc_init()

2023-07-07 Thread Christian König
Am 06.07.23 um 20:55 schrieb Alex Deucher: rlc_init() is part of sw_init() so it should not touch hardware. Additionally, calling the rlc update_spm_vmid() callback directly invokes a gfx on/off cycle which could result in powergating being enabled before hw init is complete. Split

Re: [PATCH] drm/amdgpu: Always emit GDS switch when GDS/GWS/OA is used

2023-07-07 Thread Christian König
Am 07.07.23 um 09:28 schrieb Friedrich Vock: Hi Christian, On 07.07.23 08:56, Christian König wrote: Am 07.07.23 um 08:28 schrieb Friedrich Vock: During gfxoff, the per-VMID GDS registers are reset and not restored afterwards. Hui? Since when? Those registers should be part of the saved

Re: [PATCH v5 08/10] drm/amdgpu: generate doorbell index for userqueue

2023-07-07 Thread Christian König
Am 07.07.23 um 09:39 schrieb Shashank Sharma: On 07/07/2023 09:15, Christian König wrote: Am 06.07.23 um 14:36 schrieb Shashank Sharma: The userspace sends us the doorbell object and the relative doobell index in the object to be used for the usermode queue, but the FW expects the absolute

Re: [PATCH v5 04/10] drm/amdgpu: create GFX-gen11 usermode queue

2023-07-07 Thread Shashank Sharma
On 07/07/2023 09:24, Christian König wrote: Am 06.07.23 um 14:35 schrieb Shashank Sharma: A Memory queue descriptor (MQD) of a userqueue defines it in the hw's context. As MQD format can vary between different graphics IPs, we need gfx GEN specific handlers to create MQDs. This patch: -

Re: [PATCH v5 09/10] drm/amdgpu: cleanup leftover queues

2023-07-07 Thread Shashank Sharma
On 07/07/2023 09:17, Christian König wrote: Am 06.07.23 um 14:36 schrieb Shashank Sharma: This patch adds code to cleanup any leftover userqueues which a user might have missed to destroy due to a crash or any other programming error. Cc: Alex Deucher Cc: Christian Koenig Suggested-by:

Re: [PATCH v5 08/10] drm/amdgpu: generate doorbell index for userqueue

2023-07-07 Thread Shashank Sharma
On 07/07/2023 09:15, Christian König wrote: Am 06.07.23 um 14:36 schrieb Shashank Sharma: The userspace sends us the doorbell object and the relative doobell index in the object to be used for the usermode queue, but the FW expects the absolute doorbell index on the PCI BAR in the MQD. This

Re: [PATCH] drm/amdgpu: Always emit GDS switch when GDS/GWS/OA is used

2023-07-07 Thread Friedrich Vock
Hi Christian, On 07.07.23 08:56, Christian König wrote: Am 07.07.23 um 08:28 schrieb Friedrich Vock: During gfxoff, the per-VMID GDS registers are reset and not restored afterwards. Hui? Since when? Those registers should be part of the saved ones. Have you found that by observation?

Re: [PATCH v5 04/10] drm/amdgpu: create GFX-gen11 usermode queue

2023-07-07 Thread Christian König
Am 06.07.23 um 14:35 schrieb Shashank Sharma: A Memory queue descriptor (MQD) of a userqueue defines it in the hw's context. As MQD format can vary between different graphics IPs, we need gfx GEN specific handlers to create MQDs. This patch: - Introduces MQD handler functions for the

Re: [PATCH v5 09/10] drm/amdgpu: cleanup leftover queues

2023-07-07 Thread Christian König
Am 06.07.23 um 14:36 schrieb Shashank Sharma: This patch adds code to cleanup any leftover userqueues which a user might have missed to destroy due to a crash or any other programming error. Cc: Alex Deucher Cc: Christian Koenig Suggested-by: Bas Nieuwenhuizen Signed-off-by: Bas

Re: [PATCH v5 08/10] drm/amdgpu: generate doorbell index for userqueue

2023-07-07 Thread Christian König
Am 06.07.23 um 14:36 schrieb Shashank Sharma: The userspace sends us the doorbell object and the relative doobell index in the object to be used for the usermode queue, but the FW expects the absolute doorbell index on the PCI BAR in the MQD. This patch adds a function to convert this relative

Re: [PATCH v4] drm/amdgpu:update kernel vcn ring test

2023-07-07 Thread Christian König
Am 06.07.23 um 16:47 schrieb Saleemkhan Jamadar: add session context buffer to decoder ring test. v4 - data type, explain change of ib size change (Christian) v3 - indent and v2 changes correction. (Christian) v2 - put the buffer at the end of the IB (Christian) Signed-off-by: Saleemkhan

Re: [PATCH] drm/amdgpu: Always emit GDS switch when GDS/GWS/OA is used

2023-07-07 Thread Christian König
Am 07.07.23 um 08:28 schrieb Friedrich Vock: During gfxoff, the per-VMID GDS registers are reset and not restored afterwards. Hui? Since when? Those registers should be part of the saved ones. Have you found that by observation? Thanks, Christian. The kernel needs to emit a GDS

[PATCH] drm/amdgpu: Always emit GDS switch when GDS/GWS/OA is used

2023-07-07 Thread Friedrich Vock
During gfxoff, the per-VMID GDS registers are reset and not restored afterwards. The kernel needs to emit a GDS switch to manually update the GWS registers in this case. Since gfxoff can happen between any two submissions and the kernel has no way of knowing, emit the GDS switch before every