drm/i915: update plane state during init
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 1 Jun 2015 10:49:54 +0000 (12:49 +0200)
committerJani Nikula <jani.nikula@intel.com>
Fri, 12 Jun 2015 10:19:32 +0000 (13:19 +0300)
Atomic planes updates rely on having a accurate plane_mask.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_display.c

index 2b5b829a98adf257f100eb436d5e996f40f47fa6..91a0f7ca7ed2762be624b97b00e16ffc5ea495c9 100644 (file)
@@ -2632,9 +2632,9 @@ valid_fb:
                dev_priv->preserve_bios_swizzle = true;
 
        primary->fb = fb;
-       primary->state->crtc = &intel_crtc->base;
-       primary->crtc = &intel_crtc->base;
+       primary->crtc = primary->state->crtc = &intel_crtc->base;
        update_state_fb(primary);
+       intel_crtc->base.state->plane_mask |= (1 << drm_plane_index(primary));
        obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 }
 
@@ -15563,7 +15563,9 @@ void intel_modeset_gem_init(struct drm_device *dev)
                                  to_intel_crtc(c)->pipe);
                        drm_framebuffer_unreference(c->primary->fb);
                        c->primary->fb = NULL;
+                       c->primary->crtc = c->primary->state->crtc = NULL;
                        update_state_fb(c->primary);
+                       c->state->plane_mask &= ~(1 << drm_plane_index(c->primary));
                }
        }