diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2018-04-27 12:19:17 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-09 16:23:33 -0400 |
commit | 2c756c72c4cc8336033ad4a70f112f0658436ab2 (patch) | |
tree | 3ce81c660d7a16a0612bb131f3f355e6536ad331 /drivers/media/platform | |
parent | 0f8529fd07f423786d5b83183ad3256424a176fa (diff) |
media: coda: set colorimetry on coded queue
Do not set context colorimetry on the raw (OUTPUT) queue for encoders.
Always set colorimetry on the coded queue (CAPTURE for encoders, OUTPUT
for decoders).
This also skips propagation of capture queue format and selection
rectangle on S_FMT(OUTPUT) to the CAPTURE queue for encoders.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index d3e22c14fad4..c7631e117dd3 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -779,7 +779,19 @@ static int coda_s_fmt_vid_cap(struct file *file, void *priv, r.width = q_data_src->width; r.height = q_data_src->height; - return coda_s_fmt(ctx, f, &r); + ret = coda_s_fmt(ctx, f, &r); + if (ret) + return ret; + + if (ctx->inst_type != CODA_INST_ENCODER) + return 0; + + ctx->colorspace = f->fmt.pix.colorspace; + ctx->xfer_func = f->fmt.pix.xfer_func; + ctx->ycbcr_enc = f->fmt.pix.ycbcr_enc; + ctx->quantization = f->fmt.pix.quantization; + + return 0; } static int coda_s_fmt_vid_out(struct file *file, void *priv, @@ -798,6 +810,9 @@ static int coda_s_fmt_vid_out(struct file *file, void *priv, if (ret) return ret; + if (ctx->inst_type != CODA_INST_DECODER) + return 0; + ctx->colorspace = f->fmt.pix.colorspace; ctx->xfer_func = f->fmt.pix.xfer_func; ctx->ycbcr_enc = f->fmt.pix.ycbcr_enc; |