aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ast/ast_mode.c
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2025-01-31 09:21:16 +0000
committerThomas Zimmermann <[email protected]>2025-02-03 13:01:16 +0000
commit0c5f9cb67897fc48aef8883d21a8d74d11a2f8e3 (patch)
treec80066eda0da77e541c16af8ad9d7edba5a38946 /drivers/gpu/drm/ast/ast_mode.c
parentdrm/ast: Remove struct ast_vbios_mode_info (diff)
downloadkernel-0c5f9cb67897fc48aef8883d21a8d74d11a2f8e3.tar.gz
kernel-0c5f9cb67897fc48aef8883d21a8d74d11a2f8e3.zip
drm/ast: Only look up VBIOS mode on full modesets
Only look up the VBIOS mode during atomic_check if the display mode changes. For page flips, the previous settings still apply. Avoids the runtime overhead of looking up the VBIOS mode on each page flip. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jocelyn Falempe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/ast/ast_mode.c')
-rw-r--r--drivers/gpu/drm/ast/ast_mode.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index a93994b00f40..bd781293b6d9 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -996,32 +996,34 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc,
}
/*
- * Find the VBIOS mode and adjust the DRM display mode accordingly.
+ * Find the VBIOS mode and adjust the DRM display mode accordingly
+ * if a full modeset is required. Otherwise keep the existing values.
*/
+ if (drm_atomic_crtc_needs_modeset(crtc_state)) {
+ vmode = ast_vbios_find_mode(ast, &crtc_state->mode);
+ if (!vmode)
+ return -EINVAL;
+ ast_state->vmode = vmode;
- vmode = ast_vbios_find_mode(ast, &crtc_state->mode);
- if (!vmode)
- return -EINVAL;
- ast_state->vmode = vmode;
-
- if (vmode->flags & HBorder)
- hborder = 8;
- if (vmode->flags & VBorder)
- vborder = 8;
+ if (vmode->flags & HBorder)
+ hborder = 8;
+ if (vmode->flags & VBorder)
+ vborder = 8;
- adjusted_mode->crtc_hdisplay = vmode->hde;
- adjusted_mode->crtc_hblank_start = vmode->hde + hborder;
- adjusted_mode->crtc_hblank_end = vmode->ht - hborder;
- adjusted_mode->crtc_hsync_start = vmode->hde + hborder + vmode->hfp;
- adjusted_mode->crtc_hsync_end = vmode->hde + hborder + vmode->hfp + vmode->hsync;
- adjusted_mode->crtc_htotal = vmode->ht;
+ adjusted_mode->crtc_hdisplay = vmode->hde;
+ adjusted_mode->crtc_hblank_start = vmode->hde + hborder;
+ adjusted_mode->crtc_hblank_end = vmode->ht - hborder;
+ adjusted_mode->crtc_hsync_start = vmode->hde + hborder + vmode->hfp;
+ adjusted_mode->crtc_hsync_end = vmode->hde + hborder + vmode->hfp + vmode->hsync;
+ adjusted_mode->crtc_htotal = vmode->ht;
- adjusted_mode->crtc_vdisplay = vmode->vde;
- adjusted_mode->crtc_vblank_start = vmode->vde + vborder;
- adjusted_mode->crtc_vblank_end = vmode->vt - vborder;
- adjusted_mode->crtc_vsync_start = vmode->vde + vborder + vmode->vfp;
- adjusted_mode->crtc_vsync_end = vmode->vde + vborder + vmode->vfp + vmode->vsync;
- adjusted_mode->crtc_vtotal = vmode->vt;
+ adjusted_mode->crtc_vdisplay = vmode->vde;
+ adjusted_mode->crtc_vblank_start = vmode->vde + vborder;
+ adjusted_mode->crtc_vblank_end = vmode->vt - vborder;
+ adjusted_mode->crtc_vsync_start = vmode->vde + vborder + vmode->vfp;
+ adjusted_mode->crtc_vsync_end = vmode->vde + vborder + vmode->vfp + vmode->vsync;
+ adjusted_mode->crtc_vtotal = vmode->vt;
+ }
return 0;
}