summaryrefslogtreecommitdiff
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-05-31 12:48:00 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-05 17:51:01 +0300
commit136a5e9e01ed89d8891845027b3ee731bb662926 (patch)
tree49206281a236c37e431c21b82d336d46a856e81a /drivers/media/pci
parent78aad7f81aa6dfccdb2804ac35db6fc371d265cf (diff)
downloadlinux-136a5e9e01ed89d8891845027b3ee731bb662926.tar.xz
[media] cobalt: support transfer function
Add support for the transfer function to the cobalt driver: make sure it is passed on to/retrieved from the sub-device correctly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/cobalt/cobalt-driver.h1
-rw-r--r--drivers/media/pci/cobalt/cobalt-v4l2.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/pci/cobalt/cobalt-driver.h b/drivers/media/pci/cobalt/cobalt-driver.h
index f63ce193a65d..c206df930669 100644
--- a/drivers/media/pci/cobalt/cobalt-driver.h
+++ b/drivers/media/pci/cobalt/cobalt-driver.h
@@ -231,6 +231,7 @@ struct cobalt_stream {
u32 pixfmt;
u32 sequence;
u32 colorspace;
+ u32 xfer_func;
u32 ycbcr_enc;
u32 quantization;
diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c
index 8b14bec123eb..72b081f9cde3 100644
--- a/drivers/media/pci/cobalt/cobalt-v4l2.c
+++ b/drivers/media/pci/cobalt/cobalt-v4l2.c
@@ -170,6 +170,7 @@ static void cobalt_enable_output(struct cobalt_stream *s)
}
sd_fmt.format.colorspace = s->colorspace;
+ sd_fmt.format.xfer_func = s->xfer_func;
sd_fmt.format.ycbcr_enc = s->ycbcr_enc;
sd_fmt.format.quantization = s->quantization;
sd_fmt.format.width = bt->width;
@@ -737,6 +738,7 @@ static int cobalt_g_fmt_vid_cap(struct file *file, void *priv_fh,
v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt);
v4l2_fill_pix_format(pix, &sd_fmt.format);
pix->colorspace = sd_fmt.format.colorspace;
+ pix->xfer_func = sd_fmt.format.xfer_func;
pix->ycbcr_enc = sd_fmt.format.ycbcr_enc;
pix->quantization = sd_fmt.format.quantization;
}
@@ -782,6 +784,7 @@ static int cobalt_try_fmt_vid_cap(struct file *file, void *priv_fh,
v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt);
v4l2_fill_pix_format(pix, &sd_fmt.format);
pix->colorspace = sd_fmt.format.colorspace;
+ pix->xfer_func = sd_fmt.format.xfer_func;
pix->ycbcr_enc = sd_fmt.format.ycbcr_enc;
pix->quantization = sd_fmt.format.quantization;
}
@@ -897,6 +900,7 @@ static int cobalt_g_fmt_vid_out(struct file *file, void *priv_fh,
pix->field = V4L2_FIELD_NONE;
pix->pixelformat = s->pixfmt;
pix->colorspace = s->colorspace;
+ pix->xfer_func = s->xfer_func;
pix->ycbcr_enc = s->ycbcr_enc;
pix->quantization = s->quantization;
pix->sizeimage = pix->bytesperline * pix->height;
@@ -953,11 +957,13 @@ static int cobalt_s_fmt_vid_out(struct file *file, void *priv_fh,
s->stride = pix->bytesperline;
s->pixfmt = pix->pixelformat;
s->colorspace = pix->colorspace;
+ s->xfer_func = pix->xfer_func;
s->ycbcr_enc = pix->ycbcr_enc;
s->quantization = pix->quantization;
sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt);
sd_fmt.format.colorspace = pix->colorspace;
+ sd_fmt.format.xfer_func = pix->xfer_func;
sd_fmt.format.ycbcr_enc = pix->ycbcr_enc;
sd_fmt.format.quantization = pix->quantization;
v4l2_subdev_call(s->sd, pad, set_fmt, NULL, &sd_fmt);