From patchwork Wed Nov 7 06:37:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaik Ameer Basha X-Patchwork-Id: 1708121 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A30383FC8F for ; Wed, 7 Nov 2012 06:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348Ab2KGGRQ (ORCPT ); Wed, 7 Nov 2012 01:17:16 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:26642 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910Ab2KGGRP (ORCPT ); Wed, 7 Nov 2012 01:17:15 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MD300HZCTFNC9J0@mailout4.samsung.com> for linux-media@vger.kernel.org; Wed, 07 Nov 2012 15:17:10 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 88.73.12699.6ECF9905; Wed, 07 Nov 2012 15:17:10 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-b2-5099fce638f9 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 48.73.12699.5ECF9905; Wed, 07 Nov 2012 15:17:10 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MD300HBSTF6GW30@mmp2.samsung.com> for linux-media@vger.kernel.org; Wed, 07 Nov 2012 15:17:09 +0900 (KST) From: Shaik Ameer Basha To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, kgene.kim@samsung.com, shaik.samsung@gmail.com Subject: [PATCH] [media] exynos-gsc: Adding tiled multi-planar format to G-Scaler Date: Wed, 07 Nov 2012 12:07:07 +0530 Message-id: <1352270227-8369-1-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.7.0.4 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsWyRsSkTvfZn5kBBk9eslv0bNjK6sDo8XmT XABjFJdNSmpOZllqkb5dAldG0/dTLAWrhSsat15ma2BcJNDFyMkhIWAiceTwOnYIW0ziwr31 bF2MXBxCAksZJRqf7WaFKXq89SYrRGI6o8TO52sYIZzlTBLTln9gA6liEzCU2H7vCliHiIC8 xJPeG2BxZgEvieaeSYwgtrBAsMSdn9+AbA4OFgFViXff40HCvAJuEtt3rYe6QkGiddkhMJtF QEDi2+RDLCDlEgKyEpsOMIOslRDYwibR87iPCaJeUuLgihssExgFFzAyrGIUTS1ILihOSs81 0itOzC0uzUvXS87P3cQIDKnT/55J72Bc1WBxiFGAg1GJh9cidWaAEGtiWXFl7iFGCQ5mJRHe I5+AQrwpiZVVqUX58UWlOanFhxh9gC6ZyCwlmpwPDPe8knhDYxNzU2NTSyMjM1NTHMJK4rzN HikBQgLpiSWp2ampBalFMOOYODilGhg7f51n2im9qemdh6mjo38F7za5+fPvX/wh5W0XX/dm bdmVrZd6Uud8dH0jwvRFpyj7W69nZ4QXn5vGu7DvD310r/NIhB5Ys7Y2WaZazv5Ty2FrK0fb ZfuKPafr+t0790GTW2GDilW6c+vviYb/BHd/3D3PhLl+z8+pedNP7tktcqb+8EuOVb+UWIoz Eg21mIuKEwG3tRYGVgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsVy+t9jQd1nf2YGGLzRtujZsJXVgdHj8ya5 AMaoBkabjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFslF58AXbfMHKCh SgpliTmlQKGAxOJiJX07TBNCQ9x0LWAaI3R9Q4LgeowM0EDCGsaMpu+nWApWC1c0br3M1sC4 SKCLkZNDQsBE4vHWm6wQtpjEhXvr2boYuTiEBKYzSux8voYRwlnOJDFt+Qc2kCo2AUOJ7feu gHWICMhLPOm9ARZnFvCSaO6ZxAhiCwsES9z5+Q3I5uBgEVCVePc9HiTMK+AmsX3XenaIZQoS rcsOsU9g5F7AyLCKUTS1ILmgOCk910ivODG3uDQvXS85P3cTIzhcn0nvYFzVYHGIUYCDUYmH 1yJ1ZoAQa2JZcWXuIUYJDmYlEd4jn4BCvCmJlVWpRfnxRaU5qcWHGH2Alk9klhJNzgfGUl5J vKGxibmpsamliYWJmSUOYSVx3maPlAAhgfTEktTs1NSC1CKYcUwcnFINjGJ8mvsfnJxlHpVU 2a679NiC926lC8v2ffDaHmB+5cK8K9wfL1+OuBaivGX6O7c4B6nDb7vnJwT3pVR3fGXb7ji7 ss+xm/O1VCPDzQ1my45PPn7f/7ynDmPotLts4RL2cZrOuaaZp3bXyur4z9L7abxglkMH+zum v7p7KjYsOy7wY/bBXywCYUosxRmJhlrMRcWJAHMeCXKEAgAA X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Adding V4L2_PIX_FMT_NV12MT_16X16 to G-Scaler supported formats. If the output or input format is V4L2_PIX_FMT_NV12MT_16X16, configure G-Scaler to use GSC_IN_TILE_MODE. Signed-off-by: Shaik Ameer Basha --- drivers/media/platform/exynos-gsc/gsc-core.c | 9 +++++++++ drivers/media/platform/exynos-gsc/gsc-core.h | 5 +++++ drivers/media/platform/exynos-gsc/gsc-regs.c | 6 ++++++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index cc7b218..00f1013 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -185,6 +185,15 @@ static const struct gsc_fmt gsc_formats[] = { .corder = GSC_CRCB, .num_planes = 3, .num_comp = 3, + }, { + .name = "YUV 4:2:0 non-contig. 2p, Y/CbCr, tiled", + .pixelformat = V4L2_PIX_FMT_NV12MT_16X16, + .depth = { 8, 4 }, + .color = GSC_YUV420, + .yorder = GSC_LSB_Y, + .corder = GSC_CBCR, + .num_planes = 2, + .num_comp = 2, } }; diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h index 5f157ef..cc19bba 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.h +++ b/drivers/media/platform/exynos-gsc/gsc-core.h @@ -427,6 +427,11 @@ static inline void gsc_ctx_state_lock_clear(u32 state, struct gsc_ctx *ctx) spin_unlock_irqrestore(&ctx->gsc_dev->slock, flags); } +static inline int is_tiled(const struct gsc_fmt *fmt) +{ + return fmt->pixelformat == V4L2_PIX_FMT_NV12MT_16X16; +} + static inline void gsc_hw_enable_control(struct gsc_dev *dev, bool on) { u32 cfg = readl(dev->regs + GSC_ENABLE); diff --git a/drivers/media/platform/exynos-gsc/gsc-regs.c b/drivers/media/platform/exynos-gsc/gsc-regs.c index 0146b35..6f5b5a4 100644 --- a/drivers/media/platform/exynos-gsc/gsc-regs.c +++ b/drivers/media/platform/exynos-gsc/gsc-regs.c @@ -214,6 +214,9 @@ void gsc_hw_set_in_image_format(struct gsc_ctx *ctx) break; } + if (is_tiled(frame->fmt)) + cfg |= GSC_IN_TILE_C_16x8 | GSC_IN_TILE_MODE; + writel(cfg, dev->regs + GSC_IN_CON); } @@ -334,6 +337,9 @@ void gsc_hw_set_out_image_format(struct gsc_ctx *ctx) break; } + if (is_tiled(frame->fmt)) + cfg |= GSC_OUT_TILE_C_16x8 | GSC_OUT_TILE_MODE; + end_set: writel(cfg, dev->regs + GSC_OUT_CON); }