All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] drm/imx: ipuv3-plane: make sure x/y offsets are even in case of chroma subsampling
@ 2016-10-19 10:21 Philipp Zabel
  2016-10-19 10:21 ` [PATCH 02/10] drm/imx: ipuv3-plane: disable local alpha for planes without alpha channel Philipp Zabel
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Philipp Zabel @ 2016-10-19 10:21 UTC (permalink / raw)
  To: dri-devel; +Cc: kernel

Odd x/y offsets are not allowed for horizontally/vertically chroma
subsampled planar YUV formats.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
Changes since v1:
 - Improve comment
---
 drivers/gpu/drm/imx/ipuv3-plane.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
index 5c34299..e1ad844 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -259,6 +259,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
 	struct drm_framebuffer *fb = state->fb;
 	struct drm_framebuffer *old_fb = old_state->fb;
 	unsigned long eba, ubo, vbo, old_ubo, old_vbo;
+	int hsub, vsub;
 
 	/* Ok to disable */
 	if (!fb)
@@ -372,6 +373,16 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
 
 		if (old_fb && old_fb->pitches[1] != fb->pitches[1])
 			crtc_state->mode_changed = true;
+
+		/*
+		 * The x/y offsets must be even in case of horizontal/vertical
+		 * chroma subsampling.
+		 */
+		hsub = drm_format_horz_chroma_subsampling(fb->pixel_format);
+		vsub = drm_format_vert_chroma_subsampling(fb->pixel_format);
+		if (((state->src_x >> 16) & (hsub - 1)) ||
+		    ((state->src_y >> 16) & (vsub - 1)))
+			return -EINVAL;
 	}
 
 	return 0;
-- 
2.9.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-10-25  2:59 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-19 10:21 [PATCH 01/10] drm/imx: ipuv3-plane: make sure x/y offsets are even in case of chroma subsampling Philipp Zabel
2016-10-19 10:21 ` [PATCH 02/10] drm/imx: ipuv3-plane: disable local alpha for planes without alpha channel Philipp Zabel
2016-10-19 10:21 ` [PATCH 03/10] drm/imx: ipuv3-plane: request modeset if plane offsets changed Philipp Zabel
2016-10-19 10:21 ` [PATCH 04/10] drm/imx: ipuv3-plane: merge ipu_plane_atomic_set_base into atomic_update Philipp Zabel
2016-10-19 10:21 ` [PATCH 05/10] drm/imx: ipuv3-plane: let drm_plane_state_to_ubo/vbo handle chroma subsampling other than 4:2:0 Philipp Zabel
2016-10-20  6:19   ` Ying Liu
2016-10-19 10:21 ` [PATCH 06/10] gpu: ipu-cpmem: remove unused ipu_cpmem_set_yuv_planar function Philipp Zabel
2016-10-20  6:20   ` Ying Liu
2016-10-19 10:21 ` [PATCH 07/10] gpu: ipu-v3: add YUV 4:4:4 support Philipp Zabel
2016-10-19 10:21 ` [PATCH 08/10] drm/imx: ipuv3-plane: add support for YUV 4:2:2 and 4:4:4, NV12, and NV16 formats Philipp Zabel
2016-10-20  6:21   ` Ying Liu
2016-10-19 10:21 ` [PATCH 09/10] gpu: ipu-v3: initially clear all interrupts Philipp Zabel
2016-10-19 10:21 ` [PATCH 10/10] drm/imx: ipuv3-plane: use drm_plane_helper_check_state, clipped coordinates Philipp Zabel
2016-10-19 10:31   ` Ville Syrjälä
2016-10-19 10:46     ` Philipp Zabel
2016-10-20  7:53   ` Ying Liu
2016-10-20  8:41     ` Ville Syrjälä
2016-10-20  8:51       ` Ying Liu
2016-10-20 13:20         ` Ville Syrjälä
2016-10-20 13:29         ` Philipp Zabel
2016-10-21  5:45           ` Ying Liu
2016-10-21  8:18             ` Philipp Zabel
2016-10-21  8:49               ` Ying Liu
2016-10-24 11:50                 ` Philipp Zabel
2016-10-25  2:59                   ` Ying Liu
2016-10-20  6:18 ` [PATCH 01/10] drm/imx: ipuv3-plane: make sure x/y offsets are even in case of chroma subsampling Ying Liu

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.