summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-06-13 04:11:38 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-06-13 04:11:38 +0000
commitbd6e117a923da06f55f1c2359cc11f52d1c04940 (patch)
tree3abaec28a21a7174e19de61c99ec380b9e5a6af9 /sys
parent1ec92d4416d3034dba10813c19fa82da38e65cf1 (diff)
drm/amd/display: Fix hang when skipping modeset
From Aurabindo Pillai 49f63bd0625a790025a086e8856ee8e5b9042412 in linux-6.1.y/6.1.29 da5e14909776edea4462672fb4a3007802d262e7 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c5
-rw-r--r--sys/dev/pci/drm/amd/display/dc/core/dc_resource.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 1127fb2d8af..0aca5c3b723 100644
--- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7677,6 +7677,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
continue;
dc_plane = dm_new_plane_state->dc_state;
+ if (!dc_plane)
+ continue;
bundle->surface_updates[planes_count].surface = dc_plane;
if (new_pcrtc_state->color_mgmt_changed) {
@@ -9221,8 +9223,9 @@ static int dm_update_plane_state(struct dc *dc,
return -EINVAL;
}
+ if (dm_old_plane_state->dc_state)
+ dc_plane_state_release(dm_old_plane_state->dc_state);
- dc_plane_state_release(dm_old_plane_state->dc_state);
dm_new_plane_state->dc_state = NULL;
*lock_and_validation_needed = true;
diff --git a/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c b/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c
index 42af49f30bf..658913c6404 100644
--- a/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c
+++ b/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c
@@ -1707,6 +1707,9 @@ bool dc_remove_plane_from_context(
struct dc_stream_status *stream_status = NULL;
struct resource_pool *pool = dc->res_pool;
+ if (!plane_state)
+ return true;
+
for (i = 0; i < context->stream_count; i++)
if (context->streams[i] == stream) {
stream_status = &context->stream_status[i];