public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 3/3] drm/i915: Fix i915_ggtt_view_equal to handle rotation correctly
Date: Wed, 14 Oct 2015 19:34:42 +0300	[thread overview]
Message-ID: <20151014163442.GX26517@intel.com> (raw)
In-Reply-To: <1444834266-12689-3-git-send-email-daniel.vetter@ffwll.ch>

On Wed, Oct 14, 2015 at 04:51:06PM +0200, Daniel Vetter wrote:
> The rotated view depends upon the rotation paramters, but thus far we
> didn't bother checking for those. This seems to have been an issue
> ever since this was introduce in
> 
> commit fe14d5f4e5468c5b80a24f1a64abcbe116143670
> Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Date:   Wed Dec 10 17:27:58 2014 +0000
> 
>     drm/i915: Infrastructure for supporting different GGTT views per object
> 
> But userspace is allowed to reuse framebuffer backing storage with
> different framebuffers with different pixel formats/stride/whatever.
> And e.g. SNA indeed does this. Hence we must check for all the
> paramters to match, not just that it's rotated.
> 
> v2: intel_plane_obj_offset also needs to construct the full view, to
> avoid fallout since they don't fully match.
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.h  |  2 +-
>  drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
> index 2e1f6493c9e7..8a36f4fcc676 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> @@ -551,7 +551,7 @@ i915_ggtt_view_equal(const struct i915_ggtt_view *a,
>  
>  	if (a->type != b->type)
>  		return false;
> -	if (a->type == I915_GGTT_VIEW_PARTIAL)
> +	if (a->type != I915_GGTT_VIEW_NORMAL)
>  		return !memcmp(&a->params, &b->params, sizeof(a->params));

Again I have basically the same patch, except in mine the union is
anoymous so mine needs to handle partial and rotated sepeartely.

>  	return true;
>  }
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 57459fedf216..2a5987ce576c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2894,16 +2894,16 @@ unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane,
>  				     struct drm_i915_gem_object *obj,
>  				     unsigned int plane)
>  {
> -	const struct i915_ggtt_view *view = &i915_ggtt_view_normal;
> +	struct i915_ggtt_view view;
>  	struct i915_vma *vma;
>  	unsigned char *offset;
>  
> -	if (intel_rotation_90_or_270(intel_plane->base.state->rotation))
> -		view = &i915_ggtt_view_rotated;
> +	intel_fill_fb_ggtt_view(&view, intel_plane->base.fb,
> +				intel_plane->base.state);
>  
> -	vma = i915_gem_obj_to_ggtt_view(obj, view);
> +	vma = i915_gem_obj_to_ggtt_view(obj, &view);
>  	if (WARN(!vma, "ggtt vma for display object not found! (view=%u)\n",
> -		view->type))
> +		view.type))
>  		return -1;
>  
>  	offset = (unsigned char *)vma->node.start;
> -- 
> 2.5.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2015-10-14 16:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 14:51 [PATCH 1/3] drm/i915: Drop return value from intel_fill_fb_ggtt_view Daniel Vetter
2015-10-14 14:51 ` [PATCH 2/3] drm/i915: Stuff rotation params into view union Daniel Vetter
2015-10-14 16:33   ` Ville Syrjälä
2015-10-14 14:51 ` [PATCH 3/3] drm/i915: Fix i915_ggtt_view_equal to handle rotation correctly Daniel Vetter
2015-10-14 15:08   ` Tvrtko Ursulin
2015-10-14 15:33     ` Chris Wilson
2015-10-14 15:56       ` Tvrtko Ursulin
2015-10-14 16:13         ` Chris Wilson
2015-10-14 15:35     ` Chris Wilson
2015-10-14 15:55       ` Tvrtko Ursulin
2015-10-14 16:10         ` Chris Wilson
2015-11-19 15:42     ` Daniel Vetter
2015-10-14 16:34   ` Ville Syrjälä [this message]

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=20151014163442.GX26517@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox