All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb
@ 2015-11-23 16:48 Matt Roper
  2015-11-23 16:53 ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Roper @ 2015-11-23 16:48 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ville Syrjälä

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.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
Ville indicated that it might also be worth dropping the BIOS FB size test we
have today.  I'm not sure what the status of FBC is today (which I believe is
why we have the size check), so we should probably wait for Paulo to weigh in
on that part and potentially follow up with an additional patch.

 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 68fb449..ed659e2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2597,6 +2597,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	struct drm_i915_gem_object *obj;
 	struct drm_plane *primary = intel_crtc->base.primary;
 	struct drm_plane_state *plane_state = primary->state;
+	struct drm_crtc_state *crtc_state = intel_crtc->base.state;
+	struct intel_plane *intel_plane = to_intel_plane(primary);
 	struct drm_framebuffer *fb;
 
 	if (!plane_config->fb)
@@ -2633,6 +2635,17 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 		}
 	}
 
+	/*
+	 * We've failed to reconstruct the BIOS FB.  Current display state
+	 * indicates that the primary plane is visible, but has a NULL FB,
+	 * which will lead to problems later if we don't fix it up.  The
+	 * simplest solution is to just disable the primary plane now and
+	 * pretend the BIOS never had it enabled.
+	 */
+	to_intel_plane_state(plane_state)->visible = false;
+	crtc_state->plane_mask &= ~(1 << drm_plane_index(primary));
+	intel_plane->disable_plane(primary, &intel_crtc->base);
+
 	return;
 
 valid_fb:
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb
  2015-11-23 16:48 [PATCH] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb Matt Roper
@ 2015-11-23 16:53 ` Chris Wilson
  2015-11-24  0:10   ` Matt Roper
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2015-11-23 16:53 UTC (permalink / raw)
  To: Matt Roper; +Cc: intel-gfx, Ville Syrjälä

On Mon, Nov 23, 2015 at 08:48:32AM -0800, Matt Roper wrote:
> 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.
> 
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

There are a bunch of bugzillas open about this as it is a regression
from about 3.2.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb
  2015-11-23 16:53 ` Chris Wilson
@ 2015-11-24  0:10   ` Matt Roper
  2015-11-24  8:42     ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Roper @ 2015-11-24  0:10 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx, Ville Syrjälä

On Mon, Nov 23, 2015 at 04:53:55PM +0000, Chris Wilson wrote:
> On Mon, Nov 23, 2015 at 08:48:32AM -0800, Matt Roper wrote:
> > 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.
> > 
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Ville Syrjälä <ville.syrjala@intel.com>
> > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> 
> There are a bunch of bugzillas open about this as it is a regression
> from about 3.2.
> -Chris
> 

Do you happen to know any of the bug ID's off the top of your head (or
keywords to look for)?  I skimmed through the bug list, but the only one
that jumped out at me as possibly related is

https://bugs.freedesktop.org/show_bug.cgi?id=91751
("Display still active even though primary plane is disabled and kills
the GPU")

Thanks!


Matt


> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb
  2015-11-24  0:10   ` Matt Roper
@ 2015-11-24  8:42     ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2015-11-24  8:42 UTC (permalink / raw)
  To: Matt Roper; +Cc: intel-gfx, Ville Syrjälä

On Mon, Nov 23, 2015 at 04:10:58PM -0800, Matt Roper wrote:
> On Mon, Nov 23, 2015 at 04:53:55PM +0000, Chris Wilson wrote:
> > On Mon, Nov 23, 2015 at 08:48:32AM -0800, Matt Roper wrote:
> > > 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.
> > > 
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > Cc: Ville Syrjälä <ville.syrjala@intel.com>
> > > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > 
> > There are a bunch of bugzillas open about this as it is a regression
> > from about 3.2.
> > -Chris
> > 
> 
> Do you happen to know any of the bug ID's off the top of your head (or
> keywords to look for)?  I skimmed through the bug list, but the only one
> that jumped out at me as possibly related is
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=91751
> ("Display still active even though primary plane is disabled and kills
> the GPU")

Errors like https://bugs.freedesktop.org/show_bug.cgi?id=89319 or GPU
hangs on takeover like
https://bugs.freedesktop.org/show_bug.cgi?id=87677
https://bugs.freedesktop.org/show_bug.cgi?id=89146
https://bugs.freedesktop.org/show_bug.cgi?id=91653
from a quick search
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-24  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23 16:48 [PATCH] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb Matt Roper
2015-11-23 16:53 ` Chris Wilson
2015-11-24  0:10   ` Matt Roper
2015-11-24  8:42     ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.