aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2015-12-03 14:37:36 -0500
committerMatt Roper <matthew.d.roper@intel.com>2015-12-17 11:16:43 -0500
commit200757f5d7c6f7f7032a0a07bbb8c02a840bbf7d (patch)
tree8f5b52c1233fd14c6d0ee631d6805f05edcf0804 /drivers/gpu/drm/i915
parent0c82312f3f15538f4e6ceda2a82caee8fbac4501 (diff)
drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2)
If we fail to reconstruct the BIOS fb (e.g., because the FB is too large), we'll be left with plane state that indicates the primary plane is visible yet has a NULL fb. This mismatch causes problems later on (e.g., for the watermark code). Since we've failed to reconstruct the BIOS FB, the best solution is to just disable the primary plane and pretend the BIOS never had it enabled. v2: Add intel_pre_disable_primary() call (Maarten) Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: drm-intel-fixes@lists.freedesktop.org Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1449171462-30763-2-git-send-email-matthew.d.roper@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2786f484478c..11af6f52b3e4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -118,6 +118,7 @@ static void skylake_pfit_enable(struct intel_crtc *crtc);
118static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force); 118static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
119static void ironlake_pfit_enable(struct intel_crtc *crtc); 119static void ironlake_pfit_enable(struct intel_crtc *crtc);
120static void intel_modeset_setup_hw_state(struct drm_device *dev); 120static void intel_modeset_setup_hw_state(struct drm_device *dev);
121static void intel_pre_disable_primary(struct drm_crtc *crtc);
121 122
122typedef struct { 123typedef struct {
123 int min, max; 124 int min, max;
@@ -2595,6 +2596,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
2595 struct drm_i915_gem_object *obj; 2596 struct drm_i915_gem_object *obj;
2596 struct drm_plane *primary = intel_crtc->base.primary; 2597 struct drm_plane *primary = intel_crtc->base.primary;
2597 struct drm_plane_state *plane_state = primary->state; 2598 struct drm_plane_state *plane_state = primary->state;
2599 struct drm_crtc_state *crtc_state = intel_crtc->base.state;
2600 struct intel_plane *intel_plane = to_intel_plane(primary);
2598 struct drm_framebuffer *fb; 2601 struct drm_framebuffer *fb;
2599 2602
2600 if (!plane_config->fb) 2603 if (!plane_config->fb)
@@ -2631,6 +2634,18 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
2631 } 2634 }
2632 } 2635 }
2633 2636
2637 /*
2638 * We've failed to reconstruct the BIOS FB. Current display state
2639 * indicates that the primary plane is visible, but has a NULL FB,
2640 * which will lead to problems later if we don't fix it up. The
2641 * simplest solution is to just disable the primary plane now and
2642 * pretend the BIOS never had it enabled.
2643 */
2644 to_intel_plane_state(plane_state)->visible = false;
2645 crtc_state->plane_mask &= ~(1 << drm_plane_index(primary));
2646 intel_pre_disable_primary(&intel_crtc->base);
2647 intel_plane->disable_plane(primary, &intel_crtc->base);
2648
2634 return; 2649 return;
2635 2650
2636valid_fb: 2651valid_fb: