From patchwork Wed Sep 28 21:23:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Parrot X-Patchwork-Id: 9354989 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 B55C860757 for ; Wed, 28 Sep 2016 21:24:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A69C4288F8 for ; Wed, 28 Sep 2016 21:24:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99B812977E; Wed, 28 Sep 2016 21:24:01 +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 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 33474288F8 for ; Wed, 28 Sep 2016 21:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754131AbcI1VXo (ORCPT ); Wed, 28 Sep 2016 17:23:44 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:50199 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934106AbcI1VXk (ORCPT ); Wed, 28 Sep 2016 17:23:40 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u8SLNdmL012347; Wed, 28 Sep 2016 16:23:39 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8SLNcnO022656; Wed, 28 Sep 2016 16:23:38 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Wed, 28 Sep 2016 16:23:37 -0500 Received: from uda0869644a.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8SLNbhZ002847; Wed, 28 Sep 2016 16:23:37 -0500 From: Benoit Parrot To: Hans Verkuil CC: , Subject: [Patch 32/35] media: ti-vpe: vpdma: Add RAW8 and RAW16 data types Date: Wed, 28 Sep 2016 16:23:37 -0500 Message-ID: <20160928212337.27760-1-bparrot@ti.com> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 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 RAW8 and RAW16 data type to VPDMA. To handle RAW format we are re-using the YUV CBY422 vpdma data type so that we use the vpdma to re-order the incoming bytes, as the VIP parser assumes that the first byte presented on the bus is the MSB of a 2 bytes value. RAW8 handles from 1 to 8 bits. RAW16 handles from 9 to 16 bits. Signed-off-by: Benoit Parrot --- drivers/media/platform/ti-vpe/vpdma.c | 23 +++++++++++++++++++++++ drivers/media/platform/ti-vpe/vpdma.h | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/drivers/media/platform/ti-vpe/vpdma.c b/drivers/media/platform/ti-vpe/vpdma.c index e8ed6bae83ed..422fb0840e6e 100644 --- a/drivers/media/platform/ti-vpe/vpdma.c +++ b/drivers/media/platform/ti-vpe/vpdma.c @@ -191,6 +191,29 @@ const struct vpdma_data_format vpdma_rgb_fmts[] = { }; EXPORT_SYMBOL(vpdma_rgb_fmts); +/* + * To handle RAW format we are re-using the CBY422 + * vpdma data type so that we use the vpdma to re-order + * the incoming bytes, as the parser assumes that the + * first byte presented on the bus is the MSB of a 2 + * bytes value. + * RAW8 handles from 1 to 8 bits + * RAW16 handles from 9 to 16 bits + */ +const struct vpdma_data_format vpdma_raw_fmts[] = { + [VPDMA_DATA_FMT_RAW8] = { + .type = VPDMA_DATA_FMT_TYPE_YUV, + .data_type = DATA_TYPE_CBY422, + .depth = 8, + }, + [VPDMA_DATA_FMT_RAW16] = { + .type = VPDMA_DATA_FMT_TYPE_YUV, + .data_type = DATA_TYPE_CBY422, + .depth = 16, + }, +}; +EXPORT_SYMBOL(vpdma_raw_fmts); + const struct vpdma_data_format vpdma_misc_fmts[] = { [VPDMA_DATA_FMT_MV] = { .type = VPDMA_DATA_FMT_TYPE_MISC, diff --git a/drivers/media/platform/ti-vpe/vpdma.h b/drivers/media/platform/ti-vpe/vpdma.h index 0df156b7c1cf..131700c112b2 100644 --- a/drivers/media/platform/ti-vpe/vpdma.h +++ b/drivers/media/platform/ti-vpe/vpdma.h @@ -104,12 +104,18 @@ enum vpdma_rgb_formats { VPDMA_DATA_FMT_BGRA32, }; +enum vpdma_raw_formats { + VPDMA_DATA_FMT_RAW8 = 0, + VPDMA_DATA_FMT_RAW16, +}; + enum vpdma_misc_formats { VPDMA_DATA_FMT_MV = 0, }; extern const struct vpdma_data_format vpdma_yuv_fmts[]; extern const struct vpdma_data_format vpdma_rgb_fmts[]; +extern const struct vpdma_data_format vpdma_raw_fmts[]; extern const struct vpdma_data_format vpdma_misc_fmts[]; enum vpdma_frame_start_event {