From patchwork Fri Aug 14 07:11:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xia Jiang X-Patchwork-Id: 256180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9D69C433DF for ; Fri, 14 Aug 2020 07:14:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C74AF2074D for ; Fri, 14 Aug 2020 07:14:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="qK2Os8Hw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgHNHNg (ORCPT ); Fri, 14 Aug 2020 03:13:36 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:22567 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726845AbgHNHNe (ORCPT ); Fri, 14 Aug 2020 03:13:34 -0400 X-UUID: 24d48f2f65ce40059ab4c6db27f4f428-20200814 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=crUvt8nuDvIwkxYvh2kPsXXjmR/Sm+iXYgNO4EY94dM=; b=qK2Os8HwDmxtKwCkMb5zwM9hB7zhVEGdzJSSxM+NUOrlrrqT0XhcWShFpCzbYkSSEKsya6l56qYMjVABtTlOZ7GuWltETWXrKnCCuA6wZch4jHM8LcIMzRK+Ejp+zKdQvp66qy9gaFaRTcFAPaXJrUoZ0ZXMt+tjZqsLQWbkDp4=; X-UUID: 24d48f2f65ce40059ab4c6db27f4f428-20200814 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1078314387; Fri, 14 Aug 2020 15:13:30 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Aug 2020 15:13:28 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 14 Aug 2020 15:13:27 +0800 From: Xia Jiang To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Rick Chang CC: , , , , , Marek Szyprowski , Tomasz Figa , , , , , , Xia Jiang Subject: [PATCH v12 21/29] media: platform: Change the colorspace of jpeg to the fixed value Date: Fri, 14 Aug 2020 15:11:54 +0800 Message-ID: <20200814071202.25067-23-xia.jiang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200814071202.25067-1-xia.jiang@mediatek.com> References: <20200814071202.25067-1-xia.jiang@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Jpeg doesn't support colorspace conversion, so it shouldn't accept any other colorspace in S_FMT. Change the colorspace of jpeg to the fixed value. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) -- 2.18.0 diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 01f4656fe2b3..0376bd3bdbbb 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -320,10 +320,10 @@ static int mtk_jpeg_s_fmt_mplane(struct mtk_jpeg_ctx *ctx, pix_mp->pixelformat, fmt_type); q_data->pix_mp.width = pix_mp->width; q_data->pix_mp.height = pix_mp->height; - q_data->pix_mp.colorspace = pix_mp->colorspace; - q_data->pix_mp.ycbcr_enc = pix_mp->ycbcr_enc; - q_data->pix_mp.xfer_func = pix_mp->xfer_func; - q_data->pix_mp.quantization = pix_mp->quantization; + q_data->pix_mp.colorspace = V4L2_COLORSPACE_SRGB; + q_data->pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_601; + q_data->pix_mp.xfer_func = V4L2_XFER_FUNC_SRGB; + q_data->pix_mp.quantization = V4L2_QUANTIZATION_FULL_RANGE; v4l2_dbg(1, debug, &jpeg->v4l2_dev, "(%d) s_fmt:%c%c%c%c wxh:%ux%u\n", f->type, @@ -846,10 +846,10 @@ static void mtk_jpeg_set_default_params(struct mtk_jpeg_ctx *ctx) struct mtk_jpeg_q_data *q = &ctx->out_q; int i; - q->pix_mp.colorspace = V4L2_COLORSPACE_JPEG, - q->pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; - q->pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT; - q->pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT; + q->pix_mp.colorspace = V4L2_COLORSPACE_SRGB; + q->pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_601; + q->pix_mp.quantization = V4L2_QUANTIZATION_FULL_RANGE; + q->pix_mp.xfer_func = V4L2_XFER_FUNC_SRGB; q->fmt = mtk_jpeg_find_format(mtk_jpeg_formats, MTK_JPEG_NUM_FORMATS, V4L2_PIX_FMT_JPEG, @@ -863,10 +863,10 @@ static void mtk_jpeg_set_default_params(struct mtk_jpeg_ctx *ctx) q->fmt = mtk_jpeg_find_format(mtk_jpeg_formats, MTK_JPEG_NUM_FORMATS, V4L2_PIX_FMT_YUV420M, MTK_JPEG_FMT_FLAG_DEC_CAPTURE); - q->pix_mp.colorspace = V4L2_COLORSPACE_JPEG, - q->pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; - q->pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT; - q->pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT; + q->pix_mp.colorspace = V4L2_COLORSPACE_SRGB; + q->pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_601; + q->pix_mp.quantization = V4L2_QUANTIZATION_FULL_RANGE; + q->pix_mp.xfer_func = V4L2_XFER_FUNC_SRGB; q->pix_mp.width = MTK_JPEG_MIN_WIDTH; q->pix_mp.height = MTK_JPEG_MIN_HEIGHT;