diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-04-28 15:41:37 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-06-05 17:49:53 +0300 |
commit | ca5316db08199124bf72b0ed16dc1a83fe0609e2 (patch) | |
tree | c6a2010a586d67b803f17658344f4ff7f6934567 /drivers/media/platform/vivid/vivid-tpg.h | |
parent | c62cda97c81309aa77fd2d32820f3f5b925e0ce3 (diff) | |
download | linux-ca5316db08199124bf72b0ed16dc1a83fe0609e2.tar.xz |
[media] vivid: add xfer_func support
Add support for the transfer function: create a new control for it,
and support it for both capture and output sides.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/vivid/vivid-tpg.h')
-rw-r--r-- | drivers/media/platform/vivid/vivid-tpg.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/platform/vivid/vivid-tpg.h b/drivers/media/platform/vivid/vivid-tpg.h index ef8638f945be..9baed6a10334 100644 --- a/drivers/media/platform/vivid/vivid-tpg.h +++ b/drivers/media/platform/vivid/vivid-tpg.h @@ -122,8 +122,14 @@ struct tpg_data { u32 fourcc; bool is_yuv; u32 colorspace; + u32 xfer_func; u32 ycbcr_enc; /* + * Stores the actual transfer function, i.e. will never be + * V4L2_XFER_FUNC_DEFAULT. + */ + u32 real_xfer_func; + /* * Stores the actual Y'CbCr encoding, i.e. will never be * V4L2_YCBCR_ENC_DEFAULT. */ @@ -329,6 +335,19 @@ static inline u32 tpg_g_ycbcr_enc(const struct tpg_data *tpg) return tpg->ycbcr_enc; } +static inline void tpg_s_xfer_func(struct tpg_data *tpg, u32 xfer_func) +{ + if (tpg->xfer_func == xfer_func) + return; + tpg->xfer_func = xfer_func; + tpg->recalc_colors = true; +} + +static inline u32 tpg_g_xfer_func(const struct tpg_data *tpg) +{ + return tpg->xfer_func; +} + static inline void tpg_s_quantization(struct tpg_data *tpg, u32 quantization) { if (tpg->quantization == quantization) |