Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dpu: Require modeset if clone mode status changes

If the clone mode enabled status is changing, a modeset needs to happen
so that the resources can be reassigned

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/637483/
Link: https://lore.kernel.org/r/20250214-concurrent-wb-v6-5-a44c293cf422@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Jessica Zhang and committed by
Dmitry Baryshkov
20972609 2ea34682

+17 -8
+12 -5
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
··· 1351 1351 * 1352 1352 * Check if the changes in the object properties demand full mode set. 1353 1353 */ 1354 - int dpu_crtc_check_mode_changed(struct drm_crtc_state *crtc_state) 1354 + int dpu_crtc_check_mode_changed(struct drm_crtc_state *old_crtc_state, 1355 + struct drm_crtc_state *new_crtc_state) 1355 1356 { 1356 1357 struct drm_encoder *drm_enc; 1357 - struct drm_crtc *crtc = crtc_state->crtc; 1358 + struct drm_crtc *crtc = new_crtc_state->crtc; 1359 + bool clone_mode_enabled = drm_crtc_in_clone_mode(old_crtc_state); 1360 + bool clone_mode_requested = drm_crtc_in_clone_mode(new_crtc_state); 1358 1361 1359 1362 DRM_DEBUG_ATOMIC("%d\n", crtc->base.id); 1360 1363 1361 1364 /* there might be cases where encoder needs a modeset too */ 1362 - drm_for_each_encoder_mask(drm_enc, crtc->dev, crtc_state->encoder_mask) { 1363 - if (dpu_encoder_needs_modeset(drm_enc, crtc_state->state)) 1364 - crtc_state->mode_changed = true; 1365 + drm_for_each_encoder_mask(drm_enc, crtc->dev, new_crtc_state->encoder_mask) { 1366 + if (dpu_encoder_needs_modeset(drm_enc, new_crtc_state->state)) 1367 + new_crtc_state->mode_changed = true; 1365 1368 } 1369 + 1370 + if ((clone_mode_requested && !clone_mode_enabled) || 1371 + (!clone_mode_requested && clone_mode_enabled)) 1372 + new_crtc_state->mode_changed = true; 1366 1373 1367 1374 return 0; 1368 1375 }
+2 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
··· 239 239 return crtc ? atomic_read(&to_dpu_crtc(crtc)->frame_pending) : -EINVAL; 240 240 } 241 241 242 - int dpu_crtc_check_mode_changed(struct drm_crtc_state *crtc_state); 242 + int dpu_crtc_check_mode_changed(struct drm_crtc_state *old_crtc_state, 243 + struct drm_crtc_state *new_crtc_state); 243 244 244 245 int dpu_crtc_vblank(struct drm_crtc *crtc, bool en); 245 246
+3 -2
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
··· 449 449 static int dpu_kms_check_mode_changed(struct msm_kms *kms, struct drm_atomic_state *state) 450 450 { 451 451 struct drm_crtc_state *new_crtc_state; 452 + struct drm_crtc_state *old_crtc_state; 452 453 struct drm_crtc *crtc; 453 454 int i; 454 455 455 - for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) 456 - dpu_crtc_check_mode_changed(new_crtc_state); 456 + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) 457 + dpu_crtc_check_mode_changed(old_crtc_state, new_crtc_state); 457 458 458 459 return 0; 459 460 }