@@ -472,10 +472,13 @@ 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) {
+ 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];
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> --- Changes in v3: - Do not check values in the g_fmt functions as Andrzej explained in previous review - Set colorspace if user passed V4L2_COLORSPACE_DEFAULT in Changes in v2: None drivers/media/platform/exynos-gsc/gsc-core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)