From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/9] drm/imx: ipuv3-plane: make sure x/y offsets are even in case of chroma subsampling
Date: Wed, 19 Oct 2016 10:58:41 +0300 [thread overview]
Message-ID: <20161019075841.GF4329@intel.com> (raw)
In-Reply-To: <20161018160757.11595-1-p.zabel@pengutronix.de>
On Tue, Oct 18, 2016 at 06:07:49PM +0200, Philipp Zabel wrote:
> Odd x/y offsets are not allowed for chroma subsampled planar YUV
> formats.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> drivers/gpu/drm/imx/ipuv3-plane.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
> index 5c34299..3a03fd8 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,13 @@ 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;
> +
> + /* x and y offsets must be even in case of 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)))
BTW you should use clipped coordinates all over instead of the raw
user coordinates. I see you're rejecting negative crtc user coordinates
and whanot so I guess it sort of works, but that's not how it's supposed
to be done. drm_plane_helper_check_state() should give you most of
what's needed.
> + return -EINVAL;
> }
>
> return 0;
> --
> 2.9.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-10-19 7:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 16:07 [PATCH 1/9] drm/imx: ipuv3-plane: make sure x/y offsets are even in case of chroma subsampling Philipp Zabel
2016-10-18 16:07 ` [PATCH 2/9] drm/imx: ipuv3-plane: disable local alpha for planes without alpha channel Philipp Zabel
2016-10-19 7:17 ` Ying Liu
2016-10-18 16:07 ` [PATCH 3/9] drm/imx: ipuv3-plane: request modeset if plane offsets changed Philipp Zabel
2016-10-19 7:19 ` Ying Liu
2016-10-18 16:07 ` [PATCH 4/9] drm/imx: ipuv3-plane: merge ipu_plane_atomic_set_base into atomic_update Philipp Zabel
2016-10-19 7:20 ` Ying Liu
2016-10-18 16:07 ` [PATCH 5/9] drm/imx: ipuv3-plane: let drm_plane_state_to_ubo/vbo handle chroma subsampling other than 4:2:0 Philipp Zabel
2016-10-19 7:42 ` Ying Liu
2016-10-18 16:07 ` [PATCH 6/9] gpu: ipu-cpmem: Add missing YVU422 case to ipu_cpmem_set_yuv_planar Philipp Zabel
2016-10-19 7:44 ` Ying Liu
2016-10-18 16:07 ` [PATCH 7/9] gpu: ipu-v3: add YUV 4:4:4 support Philipp Zabel
2016-10-19 7:47 ` Ying Liu
2016-10-19 9:30 ` Philipp Zabel
2016-10-18 16:07 ` [PATCH 8/9] drm/imx: ipuv3-plane: add support for YUV 4:2:2 and 4:4:4, NV12, and NV16 formats Philipp Zabel
2016-10-19 7:49 ` Ying Liu
2016-10-19 9:33 ` Philipp Zabel
2016-10-18 16:07 ` [PATCH 9/9] gpu: ipu-v3: initially clear all interrupts Philipp Zabel
2016-10-19 7:50 ` Ying Liu
2016-10-19 7:12 ` [PATCH 1/9] drm/imx: ipuv3-plane: make sure x/y offsets are even in case of chroma subsampling Ying Liu
2016-10-19 9:30 ` Philipp Zabel
2016-10-19 7:58 ` Ville Syrjälä [this message]
2016-10-19 9:30 ` Philipp Zabel
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=20161019075841.GF4329@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@pengutronix.de \
--cc=p.zabel@pengutronix.de \
/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