Skip to contentSkip to conversation

drm/i915: Error out when trying to set a y-tiled as a sprite

PATCH Applied Damien Lespiau 4 participants 4 messages Oct 29, 2012 – Oct 31, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915: Error out when trying to set a y-tiled as a sprite

From: Damien Lespiau <[email protected]>

v2: Use a switch for consistency (Chris Wilson)

---
 drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +9 -0
index 87c8f1b..03307be 100644
@@ -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.
Signature · 1 line
1.7.7.5
Reviewed-by on v2 1/1
#1 lore raw
Quoted 19 lines · On Mon, 29 Oct 2012 15:14:51 +0000 Damien Lespiau <[email protected]>…

From: Damien Lespiau <[email protected]>

v2: Use a switch for consistency (Chris Wilson)

---
 drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +2 -0
index 87c8f1b..03307be 100644
@@ -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) {

drivers/gpu/drm/i915/intel_sprite.c intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, · line 480

Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +7 -0
+		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.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#2 lore raw
Quoted 20 lines · Jesse Barnes
Quoted 17 lines · On Mon, 29 Oct 2012 15:14:51 +0000 Damien Lespiau <[email protected]>…

From: Damien Lespiau <[email protected]>

v2: Use a switch for consistency (Chris Wilson)

---
 drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +0 -0
index 87c8f1b..03307be 100644
@@ -466,6 +466,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	if (intel_plane->pipe != intel_crtc->pipe)
 		return -EINVAL;
 
Quoted 14 lines

drivers/gpu/drm/i915/intel_sprite.c intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, · line 480

Quoted 12 lines
drivers/gpu/drm/i915/intel_sprite.c +9 -0
+	/* 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.

Queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
In reply to Damien Lespiau
Quoted 15 lines · Damien Lespiau

From: Damien Lespiau <[email protected]>

v2: Use a switch for consistency (Chris Wilson)

---
 drivers/gpu/drm/i915/intel_sprite.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +0 -0
index 87c8f1b..03307be 100644
@@ -466,6 +466,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	if (intel_plane->pipe != intel_crtc->pipe)

drivers/gpu/drm/i915/intel_sprite.c intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, · line 476

Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +8 -0
 		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()).

Signature · 2 lines
Ville Syrjälä
Intel OTC