All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry.Wentland@amd.com, Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH v5 0/7] Better handle memory pressure at suspend
Date: Fri, 6 Oct 2023 13:50:19 -0500	[thread overview]
Message-ID: <20231006185026.5536-1-mario.limonciello@amd.com> (raw)

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 failures
in dm_suspend() up.

v1: https://lore.kernel.org/amd-gfx/20230925143359.14932-1-mario.limonciello@amd.com/
v2: https://lore.kernel.org/amd-gfx/20231002224449.95565-1-mario.limonciello@amd.com/T/#mc800319a05df821cd1875234b09bf212e2e3282b
v3: https://lore.kernel.org/amd-gfx/20231003205437.123426-1-mario.limonciello@amd.com/T/#m00a49b75cd2638bf8a0ebd549d6a6010bfb7328b
v4: https://lore.kernel.org/amd-gfx/20231004171838.168215-1-mario.limonciello@amd.com/T/#m0921840868295ec19abbe5ecbaa0aee75356b9e1

v4->v5:
  * Call amdgpu_device_prepare() from other callers to amdgpu_device_suspend()
  * 3x evict calls -> 2x evict calls
  * Add IP block specific prepare path
  * Fix issue in UVD
  * Raise warnings for issues that could happen in amdgpu_switcheroo_set_state()
  * Catch problem that could happen in dm_suspend()
  * Rebase on top of DML2 series in amd-staging-drm-next
v3->v4:
 * Combine patches 1/2
 * Drop adev->in_suspend references
v2->v3:
 * Handle adev->in_suspend in prepare() and complete()
 * Add missing scratch variable in dc_resource_state_destruct()
 * Revert error code propagation in same series
v1->v2:
 * Handle DC code too
 * Add prepare callback rather than moving symbol calls
Mario Limonciello (3):
  drm/amd: Evict resources during PM ops prepare() callback
  drm/amd/display: Destroy DC context while keeping DML
  drm/amd/display: make dc_set_power_state() return type `void` again

Mario Limonciello (7):
  drm/amd: Evict resources during PM ops prepare() callback
  drm/amd: Add concept of running prepare() sequence for IP blocks
  drm/amd: Split up UVD suspend into prepare and suspend steps
  drm/amd: Capture errors in amdgpu_switcheroo_set_state()
  drm/amd/display: Catch errors from drm_atomic_helper_suspend()
  drm/amd/display: Destroy DC context while keeping DML and DML2
  drm/amd/display: make dc_set_power_state() return type `void` again

 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 75 ++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       | 10 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c       | 12 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h       |  1 +
 drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c         |  9 +++
 drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c         |  9 +++
 drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c         |  9 +++
 drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c         |  9 +++
 drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c         |  9 +++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 19 ++---
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 43 +----------
 .../gpu/drm/amd/display/dc/core/dc_resource.c | 12 +++
 drivers/gpu/drm/amd/display/dc/dc.h           |  2 +-
 drivers/gpu/drm/amd/include/amd_shared.h      |  1 +
 15 files changed, 149 insertions(+), 72 deletions(-)

-- 
2.34.1


             reply	other threads:[~2023-10-06 18:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 18:50 Mario Limonciello [this message]
2023-10-06 18:50 ` [PATCH v5 1/7] drm/amd: Evict resources during PM ops prepare() callback Mario Limonciello
2023-10-09  8:44   ` Christian König
2023-10-09 14:37   ` Alex Deucher
2023-10-06 18:50 ` [PATCH v5 2/7] drm/amd: Add concept of running prepare() sequence for IP blocks Mario Limonciello
2023-10-09  8:46   ` Christian König
2023-10-09 14:34   ` Alex Deucher
2023-10-06 18:50 ` [PATCH v5 3/7] drm/amd: Split up UVD suspend into prepare and suspend steps Mario Limonciello
2023-10-09 14:43   ` Alex Deucher
2023-10-06 18:50 ` [PATCH v5 4/7] drm/amd: Capture errors in amdgpu_switcheroo_set_state() Mario Limonciello
2023-10-09  9:06   ` Christian König
2023-10-06 18:50 ` [PATCH v5 5/7] drm/amd/display: Catch errors from drm_atomic_helper_suspend() Mario Limonciello
2023-10-09  9:06   ` Christian König
2023-10-09 14:44   ` Alex Deucher
2023-10-06 18:50 ` [PATCH v5 6/7] drm/amd/display: Destroy DC context while keeping DML and DML2 Mario Limonciello
2023-10-09 14:45   ` Alex Deucher
2023-10-06 18:50 ` [PATCH v5 7/7] drm/amd/display: make dc_set_power_state() return type `void` again Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231006185026.5536-1-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.