All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/5] drm/i915: Make sure the primary plane is enabled before reading out the fb state
Date: Thu, 5 Feb 2015 13:00:53 -0800	[thread overview]
Message-ID: <20150205210053.GC9625@intel.com> (raw)
In-Reply-To: <1423164913-24717-1-git-send-email-damien.lespiau@intel.com>

On Thu, Feb 05, 2015 at 07:35:13PM +0000, Damien Lespiau wrote:
> We don't want to end up in a state where we track that the pipe has its
> primary plane enabled when primary plane registers are programmed with
> values that look possible but the plane actually disabled.
> 
> Refuse to read out the fb state when the primary plane isn't enabled.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

For the series:

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 074f204..3fe9598 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6613,6 +6613,10 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
>  	struct drm_framebuffer *fb;
>  	struct intel_framebuffer *intel_fb;
>  
> +	val = I915_READ(DSPCNTR(plane));
> +	if (!(val & DISPLAY_PLANE_ENABLE))
> +		return;
> +
>  	intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
>  	if (!intel_fb) {
>  		DRM_DEBUG_KMS("failed to alloc fb\n");
> @@ -6621,8 +6625,6 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
>  
>  	fb = &intel_fb->base;
>  
> -	val = I915_READ(DSPCNTR(plane));
> -
>  	if (INTEL_INFO(dev)->gen >= 4)
>  		if (val & DISPPLANE_TILED)
>  			plane_config->tiling = I915_TILING_X;
> @@ -7654,6 +7656,9 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
>  	fb = &intel_fb->base;
>  
>  	val = I915_READ(PLANE_CTL(pipe, 0));
> +	if (!(val & PLANE_CTL_ENABLE))
> +		goto error;
> +
>  	if (val & PLANE_CTL_TILED_MASK)
>  		plane_config->tiling = I915_TILING_X;
>  
> @@ -7741,6 +7746,10 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
>  	struct drm_framebuffer *fb;
>  	struct intel_framebuffer *intel_fb;
>  
> +	val = I915_READ(DSPCNTR(pipe));
> +	if (!(val & DISPLAY_PLANE_ENABLE))
> +		return;
> +
>  	intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
>  	if (!intel_fb) {
>  		DRM_DEBUG_KMS("failed to alloc fb\n");
> @@ -7749,8 +7758,6 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
>  
>  	fb = &intel_fb->base;
>  
> -	val = I915_READ(DSPCNTR(pipe));
> -
>  	if (INTEL_INFO(dev)->gen >= 4)
>  		if (val & DISPPLANE_TILED)
>  			plane_config->tiling = I915_TILING_X;
> -- 
> 1.8.3.1
> 

-- 
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

  reply	other threads:[~2015-02-05 21:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 17:22 [PATCH 0/5] Fix a couple of warning introduced recently Damien Lespiau
2015-02-05 17:22 ` [PATCH 1/5] drm/i915: Put update_state_fb() next to the fb update Damien Lespiau
2015-02-05 17:22 ` [PATCH 2/5] drm/i915: Use an intermediate variable to avoid repeating ourselves Damien Lespiau
2015-02-05 17:22 ` [PATCH 3/5] drm/i915: Don't try to reference the fb in get_initial_plane_config() Damien Lespiau
2015-02-05 18:24   ` Matt Roper
2015-02-05 18:30     ` [PATCH 3/5 v2] " Damien Lespiau
2015-02-05 17:22 ` [PATCH 4/5] drm/i915: Store the initial framebuffer in initial_plane_config Damien Lespiau
2015-02-05 17:22 ` [PATCH 5/5] drm/i915: Fix atomic state when reusing the firmware fb Damien Lespiau
2015-02-05 18:10   ` Matt Roper
2015-02-05 18:32     ` Ville Syrjälä
2015-02-05 18:58     ` Damien Lespiau
2015-02-05 19:12       ` Matt Roper
2015-02-05 19:20         ` Damien Lespiau
2015-02-05 19:24         ` [PATCH 5/5 v2] " Damien Lespiau
2015-02-05 19:35 ` [PATCH 6/5] drm/i915: Make sure the primary plane is enabled before reading out the fb state Damien Lespiau
2015-02-05 21:00   ` Matt Roper [this message]
2015-02-06  8:41     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150205210053.GC9625@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.