[v2,01/17] drm/atomic: update crtc->hwmode in legacy state
diff mbox

Message ID 1431548627-2527-2-git-send-email-maarten.lankhorst@linux.intel.com
State New
Headers show

Commit Message

Maarten Lankhorst May 13, 2015, 8:23 p.m. UTC
This is useful when calculating vblank in drivers that support it.
During a modeset the atomic state may not match the hardware state,
so if the driver wants to wait on a vblank they'll want to use
crtc->hwmode rather than crtc->state->adjusted_mode.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Maarten Lankhorst May 18, 2015, 8:01 a.m. UTC | #1
Op 13-05-15 om 22:23 schreef Maarten Lankhorst:
> This is useful when calculating vblank in drivers that support it.
> During a modeset the atomic state may not match the hardware state,
> so if the driver wants to wait on a vblank they'll want to use
> crtc->hwmode rather than crtc->state->adjusted_mode.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>
Drop this patch please, after discussion with danvet it seems better to do this inside the intel code of
"[PATCH v2 16/17] drm/i915: Use crtc->hwmode for vblanks." instead.

Patch
diff mbox

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d192b48d919a..63613ce673c7 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -673,6 +673,7 @@  drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
 	/* set legacy state in the crtc structure */
 	for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
 		crtc->mode = crtc->state->mode;
+		crtc->hwmode = crtc->state->adjusted_mode;
 		crtc->enabled = crtc->state->enable;
 		crtc->x = crtc->primary->state->src_x >> 16;
 		crtc->y = crtc->primary->state->src_y >> 16;