All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: The hw does not support source offsets into a YUV linear fb
@ 2012-12-18 22:51 Chris Wilson
  2012-12-18 22:57 ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2012-12-18 22:51 UTC (permalink / raw)
  To: intel-gfx

As we can only pass in the base address of the first plane, we can not
control the offset into the subsampled chroma planes. This means that we
cannot support a source offset into a YUV* linear framebuffer. However,
for tiled framebuffers we can tell the hardware which pixels to read
from. So if we see a source offset into a linear YUV framebuffer, report
the invalid value back to userspace.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_sprite.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 97866c2..3e05d79 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -497,6 +497,19 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 			return -EINVAL;
 	}
 
+	if (obj->tiling_mode == I915_TILING_NONE && (src_x | src_y)) {
+		/* Source offsets are not supported with subsampled formats
+		 * if using a linear framebuffer.
+		 */
+		switch (fb->pixel_format) {
+		case DRM_FORMAT_YUYV:
+		case DRM_FORMAT_YVYU:
+		case DRM_FORMAT_UYVY:
+		case DRM_FORMAT_VYUY:
+			return -EINVAL;
+		}
+	}
+
 	/*
 	 * Reject any attempt to display video outside the visible area.
 	 * The caller must handle this by adjusting source offset and size.
-- 
1.7.10.4

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

end of thread, other threads:[~2012-12-20  5:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 22:51 [PATCH] drm/i915: The hw does not support source offsets into a YUV linear fb Chris Wilson
2012-12-18 22:57 ` Daniel Vetter
2012-12-18 23:03   ` Chris Wilson
2012-12-18 23:26     ` Chris Wilson
2012-12-19 11:56   ` Ville Syrjälä
2012-12-19 12:03     ` Chris Wilson
2012-12-19 12:14       ` 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.