Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578206
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/4] [media] exynos-gsc: Respect userspace colorspace setting |
| Date | 2017-02-10 08:10 +0100 |
| Message-ID | <t9dvb-fW-9@gated-at.bofh.it> (permalink) |
| References | <t93ct-2cm-3@gated-at.bofh.it> <t9dvb-fW-11@gated-at.bofh.it> <t93ct-2cm-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 09.02.2017 21:04, Thibault Saunier wrote:
> If the colorspace is specified by userspace we should respect
> it and not reset it ourself if we can support it.
>
> Signed-off-by: Thibault Saunier <thibault.saunier@osg.samsung.com>
> ---
> drivers/media/platform/exynos-gsc/gsc-core.c | 25 +++++++++++++++++--------
> 1 file changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
> index 2beb43401987..63bb4577827d 100644
> --- a/drivers/media/platform/exynos-gsc/gsc-core.c
> +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
> @@ -445,10 +445,14 @@ int gsc_try_fmt_mplane(struct gsc_ctx *ctx, struct v4l2_format *f)
>
> pix_mp->num_planes = fmt->num_planes;
>
> - if (pix_mp->width > 720 && pix_mp->height > 576) /* HD */
> - pix_mp->colorspace = V4L2_COLORSPACE_REC709;
> - else /* SD */
> - pix_mp->colorspace = V4L2_COLORSPACE_SMPTE170M;
> + if (pix_mp->colorspace != V4L2_COLORSPACE_REC709 &&
> + pix_mp->colorspace != V4L2_COLORSPACE_SMPTE170M &&
> + pix_mp->colorspace != V4L2_COLORSPACE_DEFAULT) {
> + if (pix_mp->width > 720 && pix_mp->height > 576) /* HD */
> + pix_mp->colorspace = V4L2_COLORSPACE_REC709;
> + else /* SD */
> + pix_mp->colorspace = V4L2_COLORSPACE_SMPTE170M;
> + }
>
> for (i = 0; i < pix_mp->num_planes; ++i) {
> struct v4l2_plane_pix_format *plane_fmt = &pix_mp->plane_fmt[i];
> @@ -492,12 +496,17 @@ int gsc_g_fmt_mplane(struct gsc_ctx *ctx, struct v4l2_format *f)
> pix_mp->height = frame->f_height;
> pix_mp->field = V4L2_FIELD_NONE;
> pix_mp->pixelformat = frame->fmt->pixelformat;
> - if (pix_mp->width > 720 && pix_mp->height > 576) /* HD */
> - pix_mp->colorspace = V4L2_COLORSPACE_REC709;
> - else /* SD */
> - pix_mp->colorspace = V4L2_COLORSPACE_SMPTE170M;
> pix_mp->num_planes = frame->fmt->num_planes;
>
> + if (pix_mp->colorspace != V4L2_COLORSPACE_REC709 &&
> + pix_mp->colorspace != V4L2_COLORSPACE_SMPTE170M &&
> + pix_mp->colorspace != V4L2_COLORSPACE_DEFAULT) {
> + if (pix_mp->width > 720 && pix_mp->height > 576) /* HD */
> + pix_mp->colorspace = V4L2_COLORSPACE_REC709;
> + else /* SD */
> + pix_mp->colorspace = V4L2_COLORSPACE_SMPTE170M;
> + }
> +
This is g_fmt, so you set colorspace regardless of its current value, am
I right?
Regards
Andrzej
> for (i = 0; i < pix_mp->num_planes; ++i) {
> pix_mp->plane_fmt[i].bytesperline = (frame->f_width *
> frame->fmt->depth[i]) / 8;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/4] [media] Fixes for colorspace logic in exynos-gsc and s5p-mfc drivers Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-09 21:10 +0100
[PATCH v2 2/4] [media] exynos-gsc: Respect userspace colorspace setting Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-09 21:10 +0100
Re: [PATCH v2 2/4] [media] exynos-gsc: Respect userspace colorspace setting Andrzej Hajda <a.hajda@samsung.com> - 2017-02-10 08:10 +0100
[PATCH v2 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-09 21:10 +0100
Re: [PATCH v2 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Andrzej Hajda <a.hajda@samsung.com> - 2017-02-10 08:00 +0100
Re: [PATCH v2 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-10 20:40 +0100
Re: [PATCH v2 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Hans Verkuil <hverkuil@xs4all.nl> - 2017-02-13 09:50 +0100
[PATCH v2 3/4] [media] s5p-mfc: Set colorspace in VIDIO_{G,TRY}_FMT Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-09 21:10 +0100
Re: [PATCH v2 3/4] [media] s5p-mfc: Set colorspace in VIDIO_{G,TRY}_FMT Andrzej Hajda <a.hajda@samsung.com> - 2017-02-10 08:10 +0100
csiph-web