From 898f75ef6e58b64936bd8298202135b3e7612e4e Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Wed, 7 Jan 2015 15:58:31 +0200 Subject: [PATCH] drm/i915: Update primary plane src and dst rects when fb changes When the rotation property is set on the primary plane, a call to intel_plane_restore() is made to make the new value effective. But if the dst rect is uninitialized, this will cause that code path to errouneously disable the primary plane. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87662 Signed-off-by: Ander Conselvan de Oliveira --- drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 9cb5c95..ff17f30 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2776,6 +2776,21 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc) return pending; } +static void +intel_crtc_primary_plane_update_with_legacy_state(struct drm_crtc *crtc) +{ + struct intel_plane *primary = to_intel_plane(crtc->primary); + + primary->crtc_x = crtc->x; + primary->crtc_y = crtc->y; + primary->crtc_w = primary->base.fb->width; + primary->crtc_h = primary->base.fb->height; + primary->src_x = 0; + primary->src_y = 0; + primary->src_w = primary->base.fb->width; + primary->src_h = primary->base.fb->height; +} + static int intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *fb) @@ -2857,6 +2872,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, crtc->primary->fb = fb; crtc->x = x; crtc->y = y; + intel_crtc_primary_plane_update_with_legacy_state(crtc); if (old_fb) { if (intel_crtc->active && old_fb != fb) @@ -11195,6 +11211,7 @@ static int __intel_set_mode(struct drm_crtc *crtc, crtc->primary->fb = fb; crtc->x = x; crtc->y = y; + intel_crtc_primary_plane_update_with_legacy_state(crtc); ret = dev_priv->display.crtc_mode_set(&intel_crtc->base, x, y, fb); -- 2.1.0