From: jsg Date: Thu, 23 Feb 2023 02:27:50 +0000 (+0000) Subject: drm/amd/display: Fail atomic_check early on normalize_zpos error X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7679cee44e946e1016eab576626d0b485d3f3f42;p=openbsd drm/amd/display: Fail atomic_check early on normalize_zpos error From Leo Li 020eccac747e30a35f1fdd4dc6f18425ff1a5870 in linux-6.1.y/6.1.13 2a00299e7447395d0898e7c6214817c06a61a8e8 in mainline linux --- 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 4f4ff3180c6..39e2b5cbdc3 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 @@ -9560,7 +9560,11 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, * `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in * atomic state, so call drm helper to normalize zpos. */ - drm_atomic_normalize_zpos(dev, state); + ret = drm_atomic_normalize_zpos(dev, state); + if (ret) { + drm_dbg(dev, "drm_atomic_normalize_zpos() failed\n"); + goto fail; + } /* Remove exiting planes if they are modified */ for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) {