]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Drop 'acrtc' and add 'new_crtc_state' NULL check for writeback requests.
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Sat, 13 Jan 2024 09:02:27 +0000 (14:32 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jan 2024 21:44:43 +0000 (16:44 -0500)
Return value of 'to_amdgpu_crtc' which is container_of(...) can't be
null, so it's null check 'acrtc' is dropped.

Fixing the below:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9302 amdgpu_dm_atomic_commit_tail() error: we previously assumed 'acrtc' could be null (see line 9299)

Added 'new_crtc_state' NULL check for function
'drm_atomic_get_new_crtc_state' that retrieves the new state for a CRTC,
while enabling writeback requests.

Cc: stable@vger.kernel.org
Cc: Alex Hung <alex.hung@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 10b2a896c498229ef42e4ce65afbb943b16f3c0e..d55eeb30ccb2cf8347607f276ed390fa932fb4e0 100644 (file)
@@ -9293,10 +9293,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
                if (!new_con_state->writeback_job)
                        continue;
 
-               new_crtc_state = NULL;
+               new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base);
 
-               if (acrtc)
-                       new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base);
+               if (!new_crtc_state)
+                       continue;
 
                if (acrtc->wb_enabled)
                        continue;