All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915: Error out when trying to set a y-tiled as a sprite
@ 2012-10-29 15:14 Damien Lespiau
  2012-10-29 16:33 ` Jesse Barnes
  2012-10-31 17:28 ` Ville Syrjälä
  0 siblings, 2 replies; 4+ messages in thread
From: Damien Lespiau @ 2012-10-29 15:14 UTC (permalink / raw)
  To: intel-gfx

From: Damien Lespiau <damien.lespiau@intel.com>

v2: Use a switch for consistency (Chris Wilson)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 87c8f1b..03307be 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -466,6 +466,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	if (intel_plane->pipe != intel_crtc->pipe)
 		return -EINVAL;
 
+	/* Sprite planes can be linear or x-tiled surfaces */
+	switch (obj->tiling_mode) {
+		case I915_TILING_NONE:
+		case I915_TILING_X:
+			break;
+		default:
+			return -EINVAL;
+	}
+
 	/*
 	 * Clamp the width & height into the visible area.  Note we don't
 	 * try to scale the source if part of the visible region is offscreen.
-- 
1.7.7.5

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

* Re: [PATCH v2] drm/i915: Error out when trying to set a y-tiled as a sprite
  2012-10-29 15:14 [PATCH v2] drm/i915: Error out when trying to set a y-tiled as a sprite Damien Lespiau
@ 2012-10-29 16:33 ` Jesse Barnes
  2012-10-29 20:29   ` Daniel Vetter
  2012-10-31 17:28 ` Ville Syrjälä
  1 sibling, 1 reply; 4+ messages in thread
From: Jesse Barnes @ 2012-10-29 16:33 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Mon, 29 Oct 2012 15:14:51 +0000
Damien Lespiau <damien.lespiau@gmail.com> wrote:

> From: Damien Lespiau <damien.lespiau@intel.com>
> 
> v2: Use a switch for consistency (Chris Wilson)
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 87c8f1b..03307be 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -466,6 +466,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
>  	if (intel_plane->pipe != intel_crtc->pipe)
>  		return -EINVAL;
>  
> +	/* Sprite planes can be linear or x-tiled surfaces */
> +	switch (obj->tiling_mode) {
> +		case I915_TILING_NONE:
> +		case I915_TILING_X:
> +			break;
> +		default:
> +			return -EINVAL;
> +	}
> +
>  	/*
>  	 * Clamp the width & height into the visible area.  Note we don't
>  	 * try to scale the source if part of the visible region is offscreen.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center

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

* Re: [PATCH v2] drm/i915: Error out when trying to set a y-tiled as a sprite
  2012-10-29 16:33 ` Jesse Barnes
@ 2012-10-29 20:29   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2012-10-29 20:29 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Mon, Oct 29, 2012 at 09:33:24AM -0700, Jesse Barnes wrote:
> On Mon, 29 Oct 2012 15:14:51 +0000
> Damien Lespiau <damien.lespiau@gmail.com> wrote:
> 
> > From: Damien Lespiau <damien.lespiau@intel.com>
> > 
> > v2: Use a switch for consistency (Chris Wilson)
> > 
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
> >  1 files changed, 9 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index 87c8f1b..03307be 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -466,6 +466,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
> >  	if (intel_plane->pipe != intel_crtc->pipe)
> >  		return -EINVAL;
> >  
> > +	/* Sprite planes can be linear or x-tiled surfaces */
> > +	switch (obj->tiling_mode) {
> > +		case I915_TILING_NONE:
> > +		case I915_TILING_X:
> > +			break;
> > +		default:
> > +			return -EINVAL;
> > +	}
> > +
> >  	/*
> >  	 * Clamp the width & height into the visible area.  Note we don't
> >  	 * try to scale the source if part of the visible region is offscreen.
> 
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH v2] drm/i915: Error out when trying to set a y-tiled as a sprite
  2012-10-29 15:14 [PATCH v2] drm/i915: Error out when trying to set a y-tiled as a sprite Damien Lespiau
  2012-10-29 16:33 ` Jesse Barnes
@ 2012-10-31 17:28 ` Ville Syrjälä
  1 sibling, 0 replies; 4+ messages in thread
From: Ville Syrjälä @ 2012-10-31 17:28 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Mon, Oct 29, 2012 at 03:14:51PM +0000, Damien Lespiau wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
> 
> v2: Use a switch for consistency (Chris Wilson)
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 87c8f1b..03307be 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -466,6 +466,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
>  	if (intel_plane->pipe != intel_crtc->pipe)
>  		return -EINVAL;
>  
> +	/* Sprite planes can be linear or x-tiled surfaces */
> +	switch (obj->tiling_mode) {
> +		case I915_TILING_NONE:
> +		case I915_TILING_X:
> +			break;
> +		default:
> +			return -EINVAL;
> +	}

I'm confused why this is necessary. intel_pin_and_fence_fb_obj() already
has the check, so things should never go much further than this.

Futhermore someone can still go and change the tiling mode after this
point. Or indeed even at the same time as we're not holding
struct_mutex here (but this would be caught by
intel_pin_and_fence_fb_obj()).

-- 
Ville Syrjälä
Intel OTC

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

end of thread, other threads:[~2012-10-31 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 15:14 [PATCH v2] drm/i915: Error out when trying to set a y-tiled as a sprite Damien Lespiau
2012-10-29 16:33 ` Jesse Barnes
2012-10-29 20:29   ` Daniel Vetter
2012-10-31 17:28 ` Ville Syrjälä

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.