Re: [PATCH v4 1/3] drm/amd: Evict resources during PM ops prepare() callback

2023-10-06 Thread Christian König
Am 05.10.23 um 16:59 schrieb Mario Limonciello: On 10/5/2023 09:39, Christian König wrote: Am 04.10.23 um 19:18 schrieb Mario Limonciello: Linux PM core has a prepare() callback run before suspend. If the system is under high memory pressure, the resources may need to be evicted into swap inst

Re: [PATCH v2 4/4] drm/amd/pm: Add sysfs attribute to get pm log

2023-10-06 Thread Christian König
Am 06.10.23 um 07:21 schrieb Lijo Lazar: Add sysfs attribute to read power management log. A snapshot is captured to the buffer when the attribute is read. Signed-off-by: Lijo Lazar --- v2: Pass PAGE_SIZE as the max size of input buffer drivers/gpu/drm/amd/pm/amdgpu_pm.c | 40 ++

[PATCH v2] drm/amdgpu: add hub->ctx_distance in setup_vmid_config

2023-10-06 Thread Yifan Zhang
add hub->ctx_distance when read CONTEXT1_CNTL, align w/ write back operation. v2: fix coding style errors reported by checkpatch.pl (Christian) Signed-off-by: Yifan Zhang Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c

Re: [PATCH v4 09/32] drm/amd/display: add plane 3D LUT driver-specific properties

2023-10-06 Thread Sebastian Wick
On Thu, Oct 05, 2023 at 04:15:04PM -0100, Melissa Wen wrote: > Add 3D LUT property for plane color transformations using a 3D lookup > table. 3D LUT allows for highly accurate and complex color > transformations and is suitable to adjust the balance between color > channels. It's also more complex

Re: [PATCH v4 00/32] drm/amd/display: add AMD driver-specific properties for color mgmt

2023-10-06 Thread Sebastian Wick
On Thu, Oct 05, 2023 at 04:14:55PM -0100, Melissa Wen wrote: > Hello, > > Just another iteration for AMD driver-specific color properties. > Basically, addressing comments from the previous version. > > Recap: this series extends the current KMS color management API with AMD > driver-specific pro

[PATCH] drm/amdgpu:common ta binary handling

2023-10-06 Thread Mangesh Gadre
Support handling common TA binary for dGPUs and APUs Signed-off-by: Mangesh Gadre Reviewed-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 85 --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 16 + 2 files changed, 90 insertions(+), 11 deletions(-) diff --

RE: [PATCH v2 1/4] drm/amdgpu: add pmlog structure definition

2023-10-06 Thread Wang, Yang(Kevin)
[AMD Official Use Only - General] Hi Lijo, I prefer to add a version field in header, which is used for compatible in the future, what is your idea? When the user attempts to parse this node, they cannot accurately determine the format of the content. Best Regards, Kevin -Original Message

[PATCH] drm/amdgpu: add missing NULL check

2023-10-06 Thread Christian König
bo->tbo.resource can easily be NULL here. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index f3ee83cdf97e.

RE: [PATCH v2 1/4] drm/amdgpu: add pmlog structure definition

2023-10-06 Thread Lazar, Lijo
[AMD Official Use Only - General] Presently only a byte stream is intended. If version is needed, uint16_t pad can be converted to format/content revision. @Deucher, Alexander/@StDenis, Tom, any comments on keeping a version? Thanks, Lijo -Original Message- From: Wang, Yang(Kevin) Sen

Re: [PATCH v2 1/4] drm/amdgpu: add pmlog structure definition

2023-10-06 Thread StDenis, Tom
[AMD Official Use Only - General] I'm lost are we talking about the pmlog? umr currently just uses the pmfw_version as a key to find the correct decoding table. Is that value not specific to a given table version? Tom From: Lazar, Lijo Sent: Friday, O

RE: [PATCH v2 1/4] drm/amdgpu: add pmlog structure definition

2023-10-06 Thread Lazar, Lijo
[Public] Hi Tom, It's about below sort of versioning. I don't know if we will have multiple log data stacked or whether this will need a different format. So far we only get a single buffer of data from FW. struct amdgpu_pmlog_v2 { struct amdgpu_pmlog_header common_header;

Re: [PATCH v2 4/4] drm/amd/pm: Add sysfs attribute to get pm log

2023-10-06 Thread Alex Deucher
On Fri, Oct 6, 2023 at 4:32 AM Christian König wrote: > > Am 06.10.23 um 07:21 schrieb Lijo Lazar: > > Add sysfs attribute to read power management log. A snapshot is > > captured to the buffer when the attribute is read. > > > > Signed-off-by: Lijo Lazar > > --- > > > > v2: Pass PAGE_SIZE as the

Re: [PATCH v2 1/4] drm/amdgpu: add pmlog structure definition

2023-10-06 Thread Alex Deucher
On Fri, Oct 6, 2023 at 9:32 AM Lazar, Lijo wrote: > > [AMD Official Use Only - General] > > Presently only a byte stream is intended. If version is needed, uint16_t pad > can be converted to format/content revision. > > @Deucher, Alexander/@StDenis, Tom, any comments on keeping a version? What v

Re: [PATCH] drm/amdgpu: add missing NULL check

2023-10-06 Thread Alex Deucher
On Fri, Oct 6, 2023 at 9:07 AM Christian König wrote: > > bo->tbo.resource can easily be NULL here. > > Signed-off-by: Christian König Add a link to the bug report? With that: Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +- > 1 file changed, 1 insertion(+

[PATCH v2 1/3] drm/amd/pm: Update metric table for smu v13_0_6

2023-10-06 Thread Asad Kamal
Update pmfw metric table to include xgmi transfer data and pci instantaneous bandwidth for smu v13_0_6 v2: Updated metric table version Signed-off-by: Asad Kamal --- .../gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --gi

[PATCH v2 2/3] drm/amd/pm: Add gpu_metrics_v1_4

2023-10-06 Thread Asad Kamal
Add new gpu_metrics_v1_4 to acquire XGMI data transfer, pcie bandwidth & Clock lock status v2: Add pcie error counter to gpu metric table v1_4 Signed-off-by: Asad Kamal --- .../gpu/drm/amd/include/kgd_pp_interface.h| 76 +++ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c| 3

[PATCH v2 3/3] drm/amd/pm: Use gpu_metrics_v1_4 for SMUv13.0.6

2023-10-06 Thread Asad Kamal
Use gpu_metrics_v1_4 for SMUv13.0.6 to fill gpu metric info Signed-off-by: Asad Kamal --- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 67 --- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/dr

Re: [PATCH] drm/amdgpu: Increase IP discovery region size

2023-10-06 Thread Deucher, Alexander
[AMD Official Use Only - General] Acked-by: Alex Deucher From: amd-gfx on behalf of Lijo Lazar Sent: Friday, October 6, 2023 1:00 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Zhang, Hawking Subject: [PATCH] drm/amdgpu: Increase IP discovery

[PATCH] drm/amdgpu: Expose ras version & schema info

2023-10-06 Thread Asad Kamal
Expose ras table version & schema info to sysfs Signed-off-by: Asad Kamal --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 58 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 11 + 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amd

[PATCH v5 0/7] Better handle memory pressure at suspend

2023-10-06 Thread Mario Limonciello
At suspend time if there is memory pressure then dynamically allocating memory will cause failures that don't clean up properly when trying suspend a second time. Move the bigger memory allocations into Linux PM prepare() callback, drop allocations that aren't really needed in DC code and report f

[PATCH v5 1/7] drm/amd: Evict resources during PM ops prepare() callback

2023-10-06 Thread Mario Limonciello
Linux PM core has a prepare() callback run before suspend. If the system is under high memory pressure, the resources may need to be evicted into swap instead. If the storage backing for swap is offlined during the suspend() step then such a call may fail. So move this step into prepare() to mov

[PATCH v5 2/7] drm/amd: Add concept of running prepare() sequence for IP blocks

2023-10-06 Thread Mario Limonciello
If any IP blocks allocate memory during their sw_fini() sequence this can cause the suspend to fail under memory pressure. Introduce a new phase that IP blocks can use to allocate memory before suspend starts so that it can potentially be evicted into swap instead. Signed-off-by: Mario Limonciell

[PATCH v5 4/7] drm/amd: Capture errors in amdgpu_switcheroo_set_state()

2023-10-06 Thread Mario Limonciello
amdgpu_switcheroo_set_state() calls lots of functions that could fail under memory pressure or for other reasons. Don't assume everything can successfully run sequentially, and check return codes for everything that returns one. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/am

[PATCH v5 3/7] drm/amd: Split up UVD suspend into prepare and suspend steps

2023-10-06 Thread Mario Limonciello
amdgpu_uvd_suspend() allocates memory and copies objects into that allocated memory. This fails under memory pressure. Instead move majority of this code into a prepare step when swap can still be allocated. Signed-off-by: Mario Limonciello --- v4->v5: * New patch --- drivers/gpu/drm/amd/amdg

[PATCH v5 5/7] drm/amd/display: Catch errors from drm_atomic_helper_suspend()

2023-10-06 Thread Mario Limonciello
drm_atomic_helper_suspend() can return PTR_ERR(), in which case the error gets stored into `dm->cached_state`. This can cause failures during resume. Catch the error during suspend and fail the suspend instead. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limon

[PATCH v5 7/7] drm/amd/display: make dc_set_power_state() return type `void` again

2023-10-06 Thread Mario Limonciello
As dc_set_power_state() no longer allocates memory, it's not necessary to have return types and check return code as it can't fail anymore. Change it back to `void`. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v4->v5: * Pick up tag --- .../gpu/drm/amd/display/amdgpu_dm/amdg

[PATCH v5 6/7] drm/amd/display: Destroy DC context while keeping DML and DML2

2023-10-06 Thread Mario Limonciello
If there is memory pressure at suspend time then dynamically allocating a large structure as part of DC suspend code will fail. Instead re-use the same structures and clear all members except those that should be maintained. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by

[PATCH 2/3] drm/amdgpu/vpe: align with mcbp changes

2023-10-06 Thread Lang Yu
MCBP is decided by adev->gfx.mcbp now. This is missed in rebase. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c index 2396622

[PATCH 1/3] drm/amdgpu/vpe: remove IB end boundary requirement

2023-10-06 Thread Lang Yu
Remove IB end boundary requirement, VPE has no such limitions, use existing amdgpu_ring_generic_pad_ib() instead. This is missed in rebase. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/

[PATCH 3/3] drm/amdgpu/vpe: fix insert_nop ops

2023-10-06 Thread Lang Yu
Avoid infinite loop when count is 0. This is missed in rebase. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c index

RE: [PATCH 3/3] drm/amdgpu/vpe: fix insert_nop ops

2023-10-06 Thread Zhang, Yifan
[AMD Official Use Only - General] This series is: Reviewed-by: Yifan Zhang Best Regards, Yifan -Original Message- From: Yu, Lang Sent: Saturday, October 7, 2023 11:24 AM To: Deucher, Alexander ; Zhang, Yifan ; Chiu, Solomon Cc: amd-gfx@lists.freedesktop.org; Yu, Lang Subject: [PATC

Re: [PATCH v2] drm/amdgpu: add hub->ctx_distance in setup_vmid_config

2023-10-06 Thread Lang Yu
On 10/06/ , Yifan Zhang wrote: > add hub->ctx_distance when read CONTEXT1_CNTL, align w/ > write back operation. > > v2: fix coding style errors reported by checkpatch.pl (Christian) > > Signed-off-by: Yifan Zhang > Acked-by: Christian König Reviewed-by: Lang Yu > --- > drivers/gpu/drm/amd/

[PATCH] drm/amd/display: Enable fast plane updates on DCN3.2 and above when state->allow_modeset = true

2023-10-06 Thread Tianci Yin
From: tiancyin [why] When cursor moves across screen boarder, lag cursor observed, since subvp settings need to sync up with vblank, that cause cursor updates being delayed. [how] Enable fast plane updates on DCN3.2 to fix it. Signed-off-by: tiancyin --- drivers/gpu/drm/amd/display/amdgpu_dm/