[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170209194314.5908-3-thibault.saunier@osg.samsung.com>
Date: Thu, 9 Feb 2017 16:43:12 -0300
From: Thibault Saunier <thibault.saunier@....samsung.com>
To: linux-kernel@...r.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@...pensource.com>,
Andi Shyti <andi.shyti@...sung.com>,
Shuah Khan <shuahkh@....samsung.com>,
Inki Dae <inki.dae@...sung.com>,
Nicolas Dufresne <nicolas.dufresne@...labora.com>,
Javier Martinez Canillas <javier@....samsung.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Kukjin Kim <kgene@...nel.org>,
linux-samsung-soc@...r.kernel.org,
Sylwester Nawrocki <s.nawrocki@...sung.com>,
linux-media@...r.kernel.org, Krzysztof Kozlowski <krzk@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
Ulf Hansson <ulf.hansson@...aro.org>,
Thibault Saunier <thibault.saunier@....samsung.com>
Subject: [PATCH 2/4] [media] exynos-gsc: Respect userspace colorspace setting
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@....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;
+ }
+
for (i = 0; i < pix_mp->num_planes; ++i) {
pix_mp->plane_fmt[i].bytesperline = (frame->f_width *
frame->fmt->depth[i]) / 8;
--
2.11.1
Powered by blists - more mailing lists