Re: [PATCH] MAINTAINERS: drm/ci: add entries for xfail files

2023-10-02 Thread neil . armstrong
On 19/09/2023 20:22, Helen Koike wrote: DRM CI keeps track of which tests are failing, flaking or being skipped by the ci in the expectations files. Add entries for those files to the corresponding driver maintainer, so they can be notified when they change. Signed-off-by: Helen Koike --- For

[PATCH] drm/amd/display: add kernel docs for dc_dmub_caps

2023-10-02 Thread Sagar Vashnav
Add kernel documentation for the dc_dmub_caps structure. Signed-off-by: Sagar Vashnav --- drivers/gpu/drm/amd/display/dc/dc.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 81258392d..14b4c503d 1006

Re: 6.5.5: UBSAN: radeon_atombios.c: index 1 is out of range for type 'UCHAR [1]'

2023-10-02 Thread Justin Piszcz
> > > > [Sun Oct 1 15:59:04 2023] UBSAN: array-index-out-of-bounds in > > drivers/gpu/drm/radeon/radeon_atombios.c:2620:43 > > [Sun Oct 1 15:59:04 2023] index 1 is out of range for type 'UCHAR [1]' > > [Sun Oct 1 15

[PATCH] drm/amdgpu: amdgpu_drm.h: fix comment typos

2023-10-02 Thread Randy Dunlap
Correct typos of "occurred". Signed-off-by: Randy Dunlap Cc: Alex Deucher Cc: Christian König Cc: "Pan, Xinhui" Cc: amd-gfx@lists.freedesktop.org --- include/uapi/drm/amdgpu_drm.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -- a/include/uapi/drm/amdgpu_drm.h b/include/u

[lvc-project] [PATCH] drm/amd/display: Fix potential null dereference

2023-10-02 Thread Igor Artemiev
The 'top_pipe_to_program pointer' can be NULL and it is checked at the first dereference, but not at the second. Add a check before using it. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Igor Artemiev --- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++- 1

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Kees Cook
On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: > This is a batch of patches touching drm for preparing for the coming > implementation by GCC and Clang of the __counted_by attribute. Flexible > array members annotated with __counted_by can have their accesses > bounds-checked at run-time chec

Re: [PATCH] drm/amd/display: add kernel docs for dc_dmub_caps

2023-10-02 Thread Randy Dunlap
On 10/1/23 21:41, Sagar Vashnav wrote: > Add kernel documentation for the dc_dmub_caps structure. > > Signed-off-by: Sagar Vashnav Reviewed-by: Randy Dunlap Thanks. > --- > drivers/gpu/drm/amd/display/dc/dc.h | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gp

Re: [PATCH] add kernel docs for dc_dmub_caps

2023-10-02 Thread Randy Dunlap
Hi, The $Subject could be improved, e.g.: [PATCH] drm/amd/display: add kernel docs for dc_dmub_caps On 9/29/23 03:00, Sagar Vashnav wrote: > Add kernel documentation for the dc_dmub_caps structure. > > Signed-off-by: Sagar Vashnav Reviewed-by: Randy Dunlap Thanks. > --- > drivers/gpu/drm

Re: 6.5.5: UBSAN: radeon_atombios.c: index 1 is out of range for type 'UCHAR [1]'

2023-10-02 Thread Bagas Sanjaya
On Sun, Oct 01, 2023 at 07:05:11PM -0400, Justin Piszcz wrote: > Hello, > > Kernel: 6.5.5 > Arch: x86_64 > Distribution: Debian testing > > Recently, I enabled UBSAN and noticed the following at boot time with > an older AMD graphics card, is this considered normal when using the > AMD firmware-l

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 29.09.23 um 21:33 schrieb Kees Cook: On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: This is a batch of patches touching drm for preparing for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their acces

Re: [PATCH v6 4/9] drm/amdgpu: create GFX-gen11 usermode queue

2023-10-02 Thread Christian König
Am 28.09.23 um 15:54 schrieb Shashank Sharma: On 28/09/2023 15:52, Alex Deucher wrote: On Thu, Sep 28, 2023 at 9:40 AM Shashank Sharma wrote: On 28/09/2023 15:27, Alex Deucher wrote: On Thu, Sep 28, 2023 at 9:22 AM Shashank Sharma wrote: On 14/09/2023 10:24, Shashank Sharma wrote: On 14/

Re: [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor"

2023-10-02 Thread Michel Dänzer
On 9/29/23 22:41, Hamza Mahfooz wrote: > From: Ivan Lipski > > This reverts commit 45e1ade04b4d60fe5df859076005779f27c4c9be. > > Since, it causes the following IGT tests to fail: > kms_cursor_legacy@cursor-vs-flip.* > kms_cursor_legacy@flip-vs-cursor.* Any information about how those tests fail

Re: [PATCH v4 0/4] Add GPU page fault query interface

2023-10-02 Thread Christian König
Am 28.09.23 um 22:06 schrieb Alex Deucher: This patch set adds support for an application to query GPU page faults. It's useful for debugging and there are vulkan extensions that could make use of this. Preliminary user space code which uses this can be found here: https://gitlab.freedesktop.or

Re: [PATCH] drm/amdkfd: ratelimited override pte flags messages

2023-10-02 Thread Christian König
Am 29.09.23 um 00:22 schrieb Philip Yang: Use ratelimited version of dev_dbg to avoid flooding dmesg log. No functional change. Signed-off-by: Philip Yang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 16 2 files changed,

Re: [PATCH 1/2] drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments

2023-10-02 Thread Christian König
Am 30.09.23 um 05:22 schrieb Mario Limonciello: The matching values for `pcie_gen_cap` and `pcie_width_cap` when fetched from powerplay tables are 1 byte, so narrow the arguments to match to ensure min() and max() comparisons without casts. Signed-off-by: Mario Limonciello Acked-by: Christian

Re: [PATCH] drm/amdgpu: Drop unnecessary return statements

2023-10-02 Thread Christian König
Am 30.09.23 um 06:07 schrieb Srinivasan Shanmugam: There is no reason to call return at the end of function that returns void. Fixes the below: WARNING: void function return statements are not generally useful Thus remove such a statement in the affected functions. Cc: Christian König Cc: Al

Re: [PATCH] drm/amdgpu: Fix complex macros error

2023-10-02 Thread Christian König
Am 30.09.23 um 08:32 schrieb Srinivasan Shanmugam: Fixes the below: ERROR: Macros with complex values should be enclosed in parentheses WARNING: macros should not use a trailing semicolon +#define amdgpu_inc_vram_lost(adev) atomic_inc(&((adev)->vram_lost_counter)); Cc: Christian König Cc: Ale

Re: [PATCH] drm/amdgpu: amdgpu_drm.h: fix comment typos

2023-10-02 Thread Christian König
Am 02.10.23 um 03:08 schrieb Randy Dunlap: Correct typos of "occurred". Signed-off-by: Randy Dunlap Cc: Alex Deucher Cc: Christian König Cc: "Pan, Xinhui" Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Christian König --- include/uapi/drm/amdgpu_drm.h |4 ++-- 1 file changed, 2 i

Re: [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor"

2023-10-02 Thread Michel Dänzer
On 10/2/23 12:05, Michel Dänzer wrote: > On 9/29/23 22:41, Hamza Mahfooz wrote: >> From: Ivan Lipski >> >> This reverts commit 45e1ade04b4d60fe5df859076005779f27c4c9be. >> >> Since, it causes the following IGT tests to fail: >> kms_cursor_legacy@cursor-vs-flip.* >> kms_cursor_legacy@flip-vs-cursor

Re: [PATCH 0/5] drm/amd/display: Remove migrate-disable and move memory allocation.

2023-10-02 Thread Sebastian Andrzej Siewior
On 2023-09-22 07:33:26 [+0200], Christian König wrote: > Am 21.09.23 um 16:15 schrieb Sebastian Andrzej Siewior: > > Hi, > > > > I stumbled uppon the amdgpu driver via a bugzilla report. The actual fix > > is #4 + #5 and the rest was made while looking at the code. > > Oh, yes please :) > > Rodr

Re: Fwd: radeon.ko/i586: BUG: kernel NULL pointer dereference, address: 00000004

2023-10-02 Thread Linux regression tracking #update (Thorsten Leemhuis)
[TLDR: This mail in primarily relevant for Linux kernel regression tracking. See link in footer if these mails annoy you.] On 14.07.23 04:50, Bagas Sanjaya wrote: > Anyway, I'm adding it to regzbot to ensure it doesn't fall through cracks > unnoticed: > > #regzbot introduced: b39181f7c6907d > h

Re: [PATCH 06/15] platform/x86/amd/pmf: Add support to get inputs from other subsystems

2023-10-02 Thread Ilpo Järvinen
On Sat, 30 Sep 2023, Shyam Sundar S K wrote: > On 9/26/2023 10:38 PM, Ilpo Järvinen wrote: > > On Fri, 22 Sep 2023, Shyam Sundar S K wrote: > > > >> PMF driver sends changing inputs from each subystem to TA for evaluating > >> the conditions in the policy binary. > >> > >> Add initial support of p

Re: [PATCH] drm/amdkfd: ratelimited override pte flags messages

2023-10-02 Thread Philip Yang
On 2023-10-02 06:24, Christian König wrote: Am 29.09.23 um 00:22 schrieb Philip Yang: Use ratelimited version of dev_dbg to avoid flooding dmesg log. No functional change. Signed-off-by: Philip Ya

[PATCH 1/2] drm/amd/display: Refactor dm_get_plane_scale helper

2023-10-02 Thread Michel Dänzer
From: Michel Dänzer Cleanup, no functional change intended. Signed-off-by: Michel Dänzer --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 +++ 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/d

[PATCH 2/2] drm/amd/display: Bail from dm_check_crtc_cursor if no relevant change

2023-10-02 Thread Michel Dänzer
From: Michel Dänzer If no plane was newly enabled or changed scaling, there can be no new scaling mismatch with the cursor plane. By not pulling non-cursor plane states into all atomic commits while the cursor plane is enabled, this avoids synchronizing all cursor plane changes to vertical blank

Re: [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor"

2023-10-02 Thread Michel Dänzer
On 10/2/23 12:48, Michel Dänzer wrote: > On 10/2/23 12:05, Michel Dänzer wrote: >> On 9/29/23 22:41, Hamza Mahfooz wrote: >>> From: Ivan Lipski >>> >>> This reverts commit 45e1ade04b4d60fe5df859076005779f27c4c9be. >>> >>> Since, it causes the following IGT tests to fail: >>> kms_cursor_legacy@curs

Re: 6.5.5: UBSAN: radeon_atombios.c: index 1 is out of range for type 'UCHAR [1]'

2023-10-02 Thread Alex Deucher
On Mon, Oct 2, 2023 at 3:40 AM Bagas Sanjaya wrote: > > On Sun, Oct 01, 2023 at 07:05:11PM -0400, Justin Piszcz wrote: > > Hello, > > > > Kernel: 6.5.5 > > Arch: x86_64 > > Distribution: Debian testing > > > > Recently, I enabled UBSAN and noticed the following at boot time with > > an older AMD g

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Alex Deucher
On Mon, Oct 2, 2023 at 5:20 AM Christian König wrote: > > Am 29.09.23 um 21:33 schrieb Kees Cook: > > On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: > >> This is a batch of patches touching drm for preparing for the coming > >> implementation by GCC and Clang of the __counted_by attribute. F

DPMS problems with radeon card and dual monitor setup

2023-10-02 Thread Jeff Layton
I have been seeing problems when my displays go to sleep for a couple of releases now. I have a dual monitor setup and a single AMD RX 6600 card. When I leave for a bit and come back, often all of my windows have been shuffled to the secondary monitor, and sometimes GNOME designates that monitor as

Re: [PATCH] drm/amdgpu: amdgpu_drm.h: fix comment typos

2023-10-02 Thread Alex Deucher
Applied. Thanks! On Mon, Oct 2, 2023 at 6:32 AM Christian König wrote: > > Am 02.10.23 um 03:08 schrieb Randy Dunlap: > > Correct typos of "occurred". > > > > Signed-off-by: Randy Dunlap > > Cc: Alex Deucher > > Cc: Christian König > > Cc: "Pan, Xinhui" > > Cc: amd-gfx@lists.freedesktop.org

Re: [PATCH 2/3] drm/amdgpu: Initialize acpi mem ranges after TTM

2023-10-02 Thread Bhardwaj, Rajneesh
I found an issue with this patch, that leads to performance drop. This leads to incorrectly initialize numa pools on a multi node system. I am working on the fix and will send another change set. On 9/29/2023 2:18 PM, Rajneesh Bhardwaj wrote: Move ttm init before acpi mem range init so we can

Re: [PATCH 2/2] drm/amd: Drop all hand-built MIN and MAX macros in the amdgpu base driver

2023-10-02 Thread Alex Deucher
On Sat, Sep 30, 2023 at 3:01 AM Mario Limonciello wrote: > > Several files declare MIN() or MAX() macros that ignore the types of the > values being compared. Drop these macros and switch to min() min_t(), > and max() from `linux/minmax.h`. > > Suggested-by: Hamza Mahfooz > Signed-off-by: Mario

[PATCH] Revert "drm/amd/display: Enable Replay for static screen use cases"

2023-10-02 Thread ivlipski
From: Ivan Lipski This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d. It fixes amd_psr on eDP panel without Replay support (<=0x03 Sink support) Signed-off-by: Ivan Lipski --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 22 --- .../amd/display/amdgpu_dm/amdgpu_dm

Re: [PATCH 1/3] amd/amdkfd: Add granularity bitmap mapped to gpu flag

2023-10-02 Thread Chen, Xiaogang
On 9/29/2023 9:11 AM, Philip Yang wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. Replace prange->mapped_to_gpu with prange->bitmap_mapped[], which is based on prange granularity, updated when map to

Re: [PATCH 2/3] amd/amdkfd: Unmap range from GPUs based on granularity

2023-10-02 Thread Chen, Xiaogang
On 9/29/2023 9:11 AM, Philip Yang wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. Align unmap range start and last address to granularity boundary. Skip unmap if range is already unmapped from GPUs.

Re: [PATCH 3/3] drm/amdkfd: Check bitmap_mapped flag to skip retry fault

2023-10-02 Thread Chen, Xiaogang
On 9/29/2023 9:11 AM, Philip Yang wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. Use bitmap_mapped flag to check if range already mapped to the specific GPU, to skip the retry fault from different p

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Kees Cook
On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: > On Mon, Oct 2, 2023 at 5:20 AM Christian König > wrote: > > > > Am 29.09.23 um 21:33 schrieb Kees Cook: > > > On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: > > >> This is a batch of patches touching drm for preparing for the co

[PATCH v2] Revert "drm/amd/display: Enable Replay for static screen use cases"

2023-10-02 Thread ivlipski
From: Ivan Lipski This reverts commit a92da5bc33ea99a861f6c422192af6072c145d2d. V2: Reword commit message [WHY] This commit caused regression in which eDP's with PSR support, but no Replay support (Sink support <= 0x03), failed enabling PSR and all IGT amd_psr tests. [HOW] Reverted the patch.

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: On Mon, Oct 2, 2023 at 5:20 AM Christian König wrote: Am 29.09.23 um 21:33 schrieb Kees Cook: On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote: This is a batch of patches touching drm for

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Kees Cook
On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: > Am 02.10.23 um 18:53 schrieb Kees Cook: > > On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: > > > On Mon, Oct 2, 2023 at 5:20 AM Christian König > > > wrote: > > > > Am 29.09.23 um 21:33 schrieb Kees Cook: > > > > > O

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Christian König
Am 02.10.23 um 20:08 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: On Mon, Oct 2, 2023 at 5:20 AM Christian König wrote: Am 29.09.23 um 21:33 schrieb Ke

Re: [PATCH 1/3] amd/amdkfd: Add granularity bitmap mapped to gpu flag

2023-10-02 Thread Felix Kuehling
On 2023-09-29 10:11, Philip Yang wrote: Replace prange->mapped_to_gpu with prange->bitmap_mapped[], which is based on prange granularity, updated when map to GPUS or unmap from GPUs, to optimize multiple GPU map, unmap and retry fault recover. svm_range_is_mapped is false only if no parital ran

[PATCH 1/3] drm/amdgpu: fix avg vs input power reporting on smu7

2023-10-02 Thread Alex Deucher
Hawaii, Bonaire, Fiji, and Tonga support average power, the others support current power. Signed-off-by: Alex Deucher --- .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/s

[PATCH 3/3] drm/amdgpu: add new INFO IOCTL query for input power

2023-10-02 Thread Alex Deucher
Some chips provide both average and input power. Previously we just exposed average power, add a new query for input power. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 9 + include/uapi/drm/amdgpu_drm.h | 2 ++ 2 files changed, 11 insertions(+) d

[PATCH 2/3] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL

2023-10-02 Thread Alex Deucher
For backwards compatibility with userspace. Fixes: 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2897 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 ++- 1 file changed, 6 insertions(+

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-02 Thread Kees Cook
On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: > Am 02.10.23 um 20:08 schrieb Kees Cook: > > On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: > > > Am 02.10.23 um 18:53 schrieb Kees Cook: > > > > On Mon, Oct 02, 2023 at 11:06:19AM -0400, Alex Deucher wrote: > > > >

Re: [2/3] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL

2023-10-02 Thread Mario Limonciello
On 10/2/2023 13:49, Alex Deucher wrote: For backwards compatibility with userspace. Fixes: 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2897 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Re: [PATCH 2/3] amd/amdkfd: Unmap range from GPUs based on granularity

2023-10-02 Thread Felix Kuehling
On 2023-09-29 10:11, Philip Yang wrote: Align unmap range start and last address to granularity boundary. Skip unmap if range is already unmapped from GPUs. This only handles unmap due to MMU notifiers with XNACK on. What about svm_range_unmap_from_cpu? Regards,   Felix This also solve t

Re: [PATCH 3/3] drm/amdkfd: Check bitmap_mapped flag to skip retry fault

2023-10-02 Thread Felix Kuehling
On 2023-09-29 10:11, Philip Yang wrote: Use bitmap_mapped flag to check if range already mapped to the specific GPU, to skip the retry fault from different page of the same range. Remove prange validate_timestamp which is not accurate for multiple GPUs. Signed-off-by: Philip Yang Reviewed-by

Re: [2/3] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL

2023-10-02 Thread Alex Deucher
On Mon, Oct 2, 2023 at 3:46 PM Mario Limonciello wrote: > > On 10/2/2023 13:49, Alex Deucher wrote: > > For backwards compatibility with userspace. > > > > Fixes: 47f1724db4fe ("drm/amd: Introduce > > `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`") > > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2

[Patch v2 2/2] drm/amdgpu: Use ttm_pages_limit to override vram reporting

2023-10-02 Thread Rajneesh Bhardwaj
On GFXIP9.4.3 APU, allow the memory reporting as per the ttm pages limit in NPS1 mode. Signed-off-by: Rajneesh Bhardwaj --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 17 - drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 9 + 2 files changed, 17 insertions(+), 9 deletions

[Patch v2 1/2] drm/amdgpu: Rework KFD memory max limits

2023-10-02 Thread Rajneesh Bhardwaj
To allow bigger allocations specially on systems such as GFXIP 9.4.3 that use GTT memory for VRAM allocations, relax the limits to maximize ROCm allocations. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 -- 1 file

[PATCH v2 0/3] Better handle memory pressure at suspend

2023-10-02 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 and drop allocations that aren't really needed in DC code. v1: htt

[PATCH v2 1/3] drm/amd: Add support for prepare() callback

2023-10-02 Thread Mario Limonciello
Linux PM core has a prepare() callback run before suspend and complete() callback ran after resume() for devices to use. Add plumbing to bring prepare() to amdgpu. The idea with the new vfuncs for amdgpu is that all IP blocks that memory allocations during suspend should do the allocation from th

[PATCH v2 2/3] drm/amd: Move evict resources suspend step to prepare()

2023-10-02 Thread Mario Limonciello
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 instead move this step into prepare(), while leaving all other steps that put the GPU into a low

[PATCH v2 3/3] drm/amd/display: Destroy DC context while keeping DML

2023-10-02 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 structure and clear all members except those that should be maintained. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: