From patchwork Thu Sep 8 13:09:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghsiu Tsai X-Patchwork-Id: 9321317 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 CE5EA60B16 for ; Thu, 8 Sep 2016 13:10:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C00FF2983E for ; Thu, 8 Sep 2016 13:10:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B45EE29866; Thu, 8 Sep 2016 13:10:11 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 A27B329868 for ; Thu, 8 Sep 2016 13:10:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755974AbcIHNJR (ORCPT ); Thu, 8 Sep 2016 09:09:17 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:52491 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753725AbcIHNJP (ORCPT ); Thu, 8 Sep 2016 09:09:15 -0400 Received: from mtkhts09.mediatek.inc [(172.21.101.70)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 965117641; Thu, 08 Sep 2016 21:09:09 +0800 Received: from localhost.localdomain (10.21.14.115) by mtkhts09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.266.1; Thu, 8 Sep 2016 21:09:09 +0800 From: Minghsiu Tsai To: Hans Verkuil , , Rob Herring , Mauro Carvalho Chehab , Matthias Brugger , Daniel Kurtz , Pawel Osciak CC: , Eddie Huang , Yingjoe Chen , , , , , , Minghsiu Tsai Subject: [PATCH v6 5/6] media: mtk-mdp: support pixelformat V4L2_PIX_FMT_MT21C Date: Thu, 8 Sep 2016 21:09:05 +0800 Message-ID: <1473340146-6598-6-git-send-email-minghsiu.tsai@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1473340146-6598-1-git-send-email-minghsiu.tsai@mediatek.com> References: <1473340146-6598-1-git-send-email-minghsiu.tsai@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 X-Virus-Scanned: ClamAV using ClamSMTP Add V4L2_PIX_FMT_MT21C in format list. Signed-off-by: Minghsiu Tsai --- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 8 ++++++++ drivers/media/platform/mtk-mdp/mtk_mdp_regs.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c index 0655027..a90972e 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c @@ -54,6 +54,14 @@ static struct mtk_mdp_pix_align mtk_mdp_size_align = { static const struct mtk_mdp_fmt mtk_mdp_formats[] = { { + .pixelformat = V4L2_PIX_FMT_MT21C, + .depth = { 8, 4 }, + .row_depth = { 8, 8 }, + .num_planes = 2, + .num_comp = 2, + .align = &mtk_mdp_size_align, + .flags = MTK_MDP_FMT_FLAG_OUTPUT, + }, { .pixelformat = V4L2_PIX_FMT_NV12M, .depth = { 8, 4 }, .row_depth = { 8, 8 }, diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c b/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c index a5601e1..86d57f3 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_regs.c @@ -29,6 +29,8 @@ enum MDP_COLOR_ENUM { MDP_COLOR_NV12 = MDP_COLORFMT_PACK(0, 2, 1, 1, 1, 8, 1, 0, 12), MDP_COLOR_I420 = MDP_COLORFMT_PACK(0, 3, 0, 1, 1, 8, 1, 0, 8), MDP_COLOR_YV12 = MDP_COLORFMT_PACK(0, 3, 0, 1, 1, 8, 1, 1, 8), + /* Mediatek proprietary format */ + MDP_COLOR_420_MT21 = MDP_COLORFMT_PACK(5, 2, 1, 1, 1, 256, 1, 0, 12), }; static int32_t mtk_mdp_map_color_format(int v4l2_format) @@ -37,6 +39,8 @@ static int32_t mtk_mdp_map_color_format(int v4l2_format) case V4L2_PIX_FMT_NV12M: case V4L2_PIX_FMT_NV12: return MDP_COLOR_NV12; + case V4L2_PIX_FMT_MT21C: + return MDP_COLOR_420_MT21; case V4L2_PIX_FMT_YUV420M: case V4L2_PIX_FMT_YUV420: return MDP_COLOR_I420;