drm/i915: Add primary plane to mask if it's visible
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 23 Sep 2015 14:11:41 +0000 (16:11 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 14 Oct 2015 10:47:44 +0000 (13:47 +0300)
This fixes the warnings like

"plane A assertion failure, should be disabled but not"

that on the initial modeset during boot. This can happen if
the primary plane is enabled by the firmware, but inheriting
it fails because the DMAR is active or for other reasons.

Most likely caused by

commit 36750f284b3a4f19b304fda1bb7d6e9e1275ea8d
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Mon Jun 1 12:49:54 2015 +0200

    drm/i915: update plane state during init

This is a new version of

commit 721a09f7393de6c28a07516dccd654c6e995944a
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Tue Sep 15 14:28:54 2015 +0200

    drm/i915: Add primary plane to mask if it's visible

That was reverted in order to facilitate easier backporting of some
commits from -next to v4.3.

Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91429
Reported-and-tested-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Andreas Reis <andreas.reis@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[Jani: cherry-picked from -next to v4.3]
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_display.c

index ac407e3e1eddf5efc30d4b5fa95d64d4298178e2..b2270d576979bd2acf42b6bec10d48eed947ab57 100644 (file)
@@ -15101,11 +15101,15 @@ static bool primary_get_hw_state(struct intel_plane *plane)
 /* FIXME read out full plane state for all planes */
 static void readout_plane_state(struct intel_crtc *crtc)
 {
+       struct drm_plane *primary = crtc->base.primary;
        struct intel_plane_state *plane_state =
-               to_intel_plane_state(crtc->base.primary->state);
+               to_intel_plane_state(primary->state);
 
        plane_state->visible =
-               primary_get_hw_state(to_intel_plane(crtc->base.primary));
+               primary_get_hw_state(to_intel_plane(primary));
+
+       if (plane_state->visible)
+               crtc->base.state->plane_mask |= 1 << drm_plane_index(primary);
 }
 
 static void intel_modeset_readout_hw_state(struct drm_device *dev)