From patchwork Fri Apr 27 16:19:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10369385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E9FD601D3 for ; Fri, 27 Apr 2018 16:19:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F34A52948E for ; Fri, 27 Apr 2018 16:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7DE829491; Fri, 27 Apr 2018 16:19:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D98A2948F for ; Fri, 27 Apr 2018 16:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758601AbeD0QTc (ORCPT ); Fri, 27 Apr 2018 12:19:32 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:40927 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757457AbeD0QTa (ORCPT ); Fri, 27 Apr 2018 12:19:30 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1fC65p-0000nX-2K; Fri, 27 Apr 2018 18:19:29 +0200 From: Philipp Zabel To: linux-media@vger.kernel.org Cc: kernel@pengutronix.de, Tomasz Figa , Ian Arkver , Philipp Zabel Subject: [PATCH v2 3/3] media: coda: set colorimetry on coded queue Date: Fri, 27 Apr 2018 18:19:17 +0200 Message-Id: <20180427161917.18398-3-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427161917.18398-1-p.zabel@pengutronix.de> References: <20180427161917.18398-1-p.zabel@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Added patch since v1 [1]: - remove automatic format propagation on S_FMT(OUT) for encoders - adding S_FMT(CAP) propagation from capture to output queue for encoders is left for a later time, this isn't even documented yet. [1] https://patchwork.linuxtv.org/patch/48266/ --- drivers/media/platform/coda/coda-common.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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;