From mboxrd@z Thu Jan 1 00:00:00 1970 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=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=ham 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 3B5E6C10F0E for ; Tue, 9 Apr 2019 06:18:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16A252083E for ; Tue, 9 Apr 2019 06:18:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbfDIGSl (ORCPT ); Tue, 9 Apr 2019 02:18:41 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:61652 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726371AbfDIGSl (ORCPT ); Tue, 9 Apr 2019 02:18:41 -0400 X-UUID: 314484c965f242de92cfd5f966a86d48-20190409 X-UUID: 314484c965f242de92cfd5f966a86d48-20190409 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1121168037; Tue, 09 Apr 2019 14:18:31 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Apr 2019 14:18:29 +0800 Received: from [172.21.77.4] (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 9 Apr 2019 14:18:29 +0800 Message-ID: <1554790709.10331.6.camel@mtksdaap41> Subject: Re: [PATCH 03/14] [media] mtk-mipicsi: add color format support for mt2712 From: CK Hu To: Stu Hsieh CC: Mauro Carvalho Chehab , Matthias Brugger , , , , , Date: Tue, 9 Apr 2019 14:18:29 +0800 In-Reply-To: <1554724505-19882-4-git-send-email-stu.hsieh@mediatek.com> References: <1554724505-19882-1-git-send-email-stu.hsieh@mediatek.com> <1554724505-19882-4-git-send-email-stu.hsieh@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Stu: On Mon, 2019-04-08 at 19:54 +0800, Stu Hsieh wrote: > This patch add color format support for mt2712 Without this patch, I think this driver still support these color format. In this patch, you just check for the non-supported color format. > > Signed-off-by: Stu Hsieh > --- > .../media/platform/mtk-mipicsi/mtk_mipicsi.c | 25 +++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > index a5ed720df900..ccf2d18a3e74 100644 > --- a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > +++ b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > @@ -139,6 +139,25 @@ static void mtk_mipicsi_remove_device(struct soc_camera_device *icd) > (void)pm_runtime_put_sync(icd->parent); > } > > +static bool is_supported(struct soc_camera_device *icd, const u32 pixformat) icd is useless, so remove it. > +{ > + bool ret = false; > + > + switch (pixformat) { > + /* YUV422 */ > + case V4L2_PIX_FMT_YUYV: > + case V4L2_PIX_FMT_UYVY: > + case V4L2_PIX_FMT_YVYU: > + case V4L2_PIX_FMT_VYUY: > + ret = true; You could just return true. > + break; > + default: > + break; You don't need the 'default' part. > + } > + > + return ret; You could just return false. Regards, CK > +} > + > static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > struct v4l2_format *f) > { > @@ -154,6 +173,12 @@ static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > struct v4l2_mbus_framefmt *mf = &format.format; > int ret = 0; > > + if (!is_supported(icd, pix->pixelformat)) { > + dev_err(dev, "Format %x not support. set V4L2_PIX_FMT_YUYV as default\n", > + pix->pixelformat); > + pix->pixelformat = V4L2_PIX_FMT_YUYV; > + } > + > xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); > if (xlate == NULL) { > dev_err(dev, "Format 0x%x not found\n", pix->pixelformat); From mboxrd@z Thu Jan 1 00:00:00 1970 From: CK Hu Subject: Re: [PATCH 03/14] [media] mtk-mipicsi: add color format support for mt2712 Date: Tue, 9 Apr 2019 14:18:29 +0800 Message-ID: <1554790709.10331.6.camel@mtksdaap41> References: <1554724505-19882-1-git-send-email-stu.hsieh@mediatek.com> <1554724505-19882-4-git-send-email-stu.hsieh@mediatek.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1554724505-19882-4-git-send-email-stu.hsieh@mediatek.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Stu Hsieh Cc: srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org List-Id: linux-mediatek@lists.infradead.org Hi, Stu: On Mon, 2019-04-08 at 19:54 +0800, Stu Hsieh wrote: > This patch add color format support for mt2712 Without this patch, I think this driver still support these color format. In this patch, you just check for the non-supported color format. > > Signed-off-by: Stu Hsieh > --- > .../media/platform/mtk-mipicsi/mtk_mipicsi.c | 25 +++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > index a5ed720df900..ccf2d18a3e74 100644 > --- a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > +++ b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > @@ -139,6 +139,25 @@ static void mtk_mipicsi_remove_device(struct soc_camera_device *icd) > (void)pm_runtime_put_sync(icd->parent); > } > > +static bool is_supported(struct soc_camera_device *icd, const u32 pixformat) icd is useless, so remove it. > +{ > + bool ret = false; > + > + switch (pixformat) { > + /* YUV422 */ > + case V4L2_PIX_FMT_YUYV: > + case V4L2_PIX_FMT_UYVY: > + case V4L2_PIX_FMT_YVYU: > + case V4L2_PIX_FMT_VYUY: > + ret = true; You could just return true. > + break; > + default: > + break; You don't need the 'default' part. > + } > + > + return ret; You could just return false. Regards, CK > +} > + > static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > struct v4l2_format *f) > { > @@ -154,6 +173,12 @@ static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > struct v4l2_mbus_framefmt *mf = &format.format; > int ret = 0; > > + if (!is_supported(icd, pix->pixelformat)) { > + dev_err(dev, "Format %x not support. set V4L2_PIX_FMT_YUYV as default\n", > + pix->pixelformat); > + pix->pixelformat = V4L2_PIX_FMT_YUYV; > + } > + > xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); > if (xlate == NULL) { > dev_err(dev, "Format 0x%x not found\n", pix->pixelformat); From mboxrd@z Thu Jan 1 00:00:00 1970 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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham 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 50D36C282DA for ; Tue, 9 Apr 2019 06:18:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15A1B2083E for ; Tue, 9 Apr 2019 06:18:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Wm9MovuY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15A1B2083E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pgfUfUTJZq0fWDAZB0NFtnzdeWLXxfGfwU8sUrb1uyo=; b=Wm9MovuYfobGNF c2ZkE++lL1qtxnfI8JJA5aaAfOncGp68uWnrtLlwSZ/4aD+UvuRfb/Ap1ZpPd9iEEGxh6X+MfiucP T+CE3H0GRL9JjLXKzr8Q5EvUJ1QQ9vKfBXLl47b6G+X3LcPz8XEhjftOLV4E4V/wup2mXbIY5cR+O RyiTg/DP7pKzJqdin0y6Yt6XOP4AswgtmF6NkS5FfpqwxQSq+SCoGA7CLW/3AWcgT9MpCojXGPrU4 qr6raiAGsrUVzExxfkfJDcnIBuEWk5foHyPivXIEUTiV5IkLaVaKFdFNvUOZlYsulB1zaYy/Yu0Me AgODAzamBbfohq1hNLAQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDk5f-0001IG-7R; Tue, 09 Apr 2019 06:18:39 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDk5b-0001HU-OJ; Tue, 09 Apr 2019 06:18:37 +0000 X-UUID: 9efccfc09b3d4720bf58aea2a6d51109-20190408 X-UUID: 9efccfc09b3d4720bf58aea2a6d51109-20190408 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1799143876; Mon, 08 Apr 2019 22:18:33 -0800 Received: from MTKMBS01N1.mediatek.inc (172.21.101.68) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Apr 2019 23:18:31 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Apr 2019 14:18:29 +0800 Received: from [172.21.77.4] (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 9 Apr 2019 14:18:29 +0800 Message-ID: <1554790709.10331.6.camel@mtksdaap41> Subject: Re: [PATCH 03/14] [media] mtk-mipicsi: add color format support for mt2712 From: CK Hu To: Stu Hsieh Date: Tue, 9 Apr 2019 14:18:29 +0800 In-Reply-To: <1554724505-19882-4-git-send-email-stu.hsieh@mediatek.com> References: <1554724505-19882-1-git-send-email-stu.hsieh@mediatek.com> <1554724505-19882-4-git-send-email-stu.hsieh@mediatek.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190408_231835_793618_AAFA6C73 X-CRM114-Status: GOOD ( 15.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Stu: On Mon, 2019-04-08 at 19:54 +0800, Stu Hsieh wrote: > This patch add color format support for mt2712 Without this patch, I think this driver still support these color format. In this patch, you just check for the non-supported color format. > > Signed-off-by: Stu Hsieh > --- > .../media/platform/mtk-mipicsi/mtk_mipicsi.c | 25 +++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > index a5ed720df900..ccf2d18a3e74 100644 > --- a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > +++ b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > @@ -139,6 +139,25 @@ static void mtk_mipicsi_remove_device(struct soc_camera_device *icd) > (void)pm_runtime_put_sync(icd->parent); > } > > +static bool is_supported(struct soc_camera_device *icd, const u32 pixformat) icd is useless, so remove it. > +{ > + bool ret = false; > + > + switch (pixformat) { > + /* YUV422 */ > + case V4L2_PIX_FMT_YUYV: > + case V4L2_PIX_FMT_UYVY: > + case V4L2_PIX_FMT_YVYU: > + case V4L2_PIX_FMT_VYUY: > + ret = true; You could just return true. > + break; > + default: > + break; You don't need the 'default' part. > + } > + > + return ret; You could just return false. Regards, CK > +} > + > static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > struct v4l2_format *f) > { > @@ -154,6 +173,12 @@ static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > struct v4l2_mbus_framefmt *mf = &format.format; > int ret = 0; > > + if (!is_supported(icd, pix->pixelformat)) { > + dev_err(dev, "Format %x not support. set V4L2_PIX_FMT_YUYV as default\n", > + pix->pixelformat); > + pix->pixelformat = V4L2_PIX_FMT_YUYV; > + } > + > xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); > if (xlate == NULL) { > dev_err(dev, "Format 0x%x not found\n", pix->pixelformat); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel