Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578490
| From | Thibault Saunier <thibault.saunier@osg.samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 2/4] [media] exynos-gsc: Respect userspace colorspace setting in try_fmt |
| Date | 2017-02-10 15:20 +0100 |
| Message-ID | <t9kdj-4sU-23@gated-at.bofh.it> (permalink) |
| References | <t9kdj-4sU-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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(-)
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index db7d9883861b..021598817938 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -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];
--
2.11.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/4] Fixes for colorspace logic in exynos-gsc and s5p-mfc drivers Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-10 15:20 +0100
[PATCH v3 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-10 15:20 +0100
Re: [PATCH v3 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Hans Verkuil <hverkuil@xs4all.nl> - 2017-02-10 16:10 +0100
Re: [PATCH v3 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-10 18:00 +0100
Re: [PATCH v3 1/4] [media] exynos-gsc: Use 576p instead 720p as a threshold for colorspaces Hans Verkuil <hverkuil@xs4all.nl> - 2017-02-10 18:20 +0100
[PATCH v3 2/4] [media] exynos-gsc: Respect userspace colorspace setting in try_fmt Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-10 15:20 +0100
[PATCH v3 4/4] [media] s5p-mfc: Check and set 'v4l2_pix_format:field' field in try_fmt Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-10 15:30 +0100
[PATCH v3 3/4] [media] s5p-mfc: Set colorspace in VIDIO_{G,TRY}_FMT Thibault Saunier <thibault.saunier@osg.samsung.com> - 2017-02-10 15:30 +0100
Re: [PATCH v3 3/4] [media] s5p-mfc: Set colorspace in VIDIO_{G,TRY}_FMT Hans Verkuil <hverkuil@xs4all.nl> - 2017-02-10 16:20 +0100
csiph-web