From patchwork Mon Apr 8 16:04:32 2013
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Philipp Zabel
X-Patchwork-Id: 2410101
Return-Path:
X-Original-To: patchwork-dri-devel@patchwork.kernel.org
Delivered-To: patchwork-process-083081@patchwork1.kernel.org
Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177])
by patchwork1.kernel.org (Postfix) with ESMTP id 2AE8F3FC71
for ;
Mon, 8 Apr 2013 16:25:25 +0000 (UTC)
Received: from gabe.freedesktop.org (localhost [127.0.0.1])
by gabe.freedesktop.org (Postfix) with ESMTP id E1C30E5D77
for ;
Mon, 8 Apr 2013 09:25:24 -0700 (PDT)
X-Original-To: dri-devel@lists.freedesktop.org
Delivered-To: dri-devel@lists.freedesktop.org
X-Greylist: delayed 1211 seconds by postgrey-1.32 at gabe;
Mon, 08 Apr 2013 09:24:59 PDT
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
[92.198.50.35])
by gabe.freedesktop.org (Postfix) with ESMTP id DA7C6E5BFB
for ;
Mon, 8 Apr 2013 09:24:59 -0700 (PDT)
Received: from dude.hi.pengutronix.de ([10.1.0.7] helo=dude.pengutronix.de)
by metis.ext.pengutronix.de with esmtp (Exim 4.72)
(envelope-from )
id 1UPEYj-0001dQ-K7; Mon, 08 Apr 2013 18:04:41 +0200
From: Philipp Zabel
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] staging: drm/imx: ipu-dc: add 24-bit GBR support to DC
Date: Mon, 8 Apr 2013 18:04:32 +0200
Message-Id: <1365437078-22579-2-git-send-email-p.zabel@pengutronix.de>
X-Mailer: git-send-email 1.8.2.rc2
In-Reply-To: <1365437078-22579-1-git-send-email-p.zabel@pengutronix.de>
References: <1365437078-22579-1-git-send-email-p.zabel@pengutronix.de>
X-SA-Exim-Connect-IP: 10.1.0.7
X-SA-Exim-Mail-From: p.zabel@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de);
SAEximRunCond expanded to false
X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org
Cc: Greg Kroah-Hartman ,
devicetree-discuss@lists.ozlabs.org,
dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
Fabio Estevam
X-BeenThere: dri-devel@lists.freedesktop.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: Direct Rendering Infrastructure - Development
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
MIME-Version: 1.0
Sender:
dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org
Errors-To:
dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org
24-bit GBR order is needed on the display interface connected
to the Television Encoder (TVEv2) on i.MX53.
Signed-off-by: Philipp Zabel
---
drivers/staging/imx-drm/imx-drm.h | 10 ++++++++++
drivers/staging/imx-drm/ipu-v3/ipu-dc.c | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/drivers/staging/imx-drm/imx-drm.h b/drivers/staging/imx-drm/imx-drm.h
index ae28a49..a24508f 100644
--- a/drivers/staging/imx-drm/imx-drm.h
+++ b/drivers/staging/imx-drm/imx-drm.h
@@ -1,8 +1,18 @@
#ifndef _IMX_DRM_H_
#define _IMX_DRM_H_
+#include
+
+#define IPU_PIX_FMT_GBR24 v4l2_fourcc('G', 'B', 'R', '3')
+
+struct drm_crtc;
+struct drm_connector;
+struct drm_device;
+struct drm_encoder;
struct imx_drm_crtc;
struct drm_fbdev_cma;
+struct drm_framebuffer;
+struct platform_device;
struct imx_drm_crtc_helper_funcs {
int (*enable_vblank)(struct drm_crtc *crtc);
diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
index 93c7579..fad5057 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
@@ -20,6 +20,7 @@
#include
#include
+#include "../imx-drm.h"
#include "imx-ipu-v3.h"
#include "ipu-prv.h"
@@ -86,6 +87,7 @@ struct ipu_dc_priv;
enum ipu_dc_map {
IPU_DC_MAP_RGB24,
IPU_DC_MAP_RGB565,
+ IPU_DC_MAP_GBR24, /* TVEv2 */
};
struct ipu_dc {
@@ -136,6 +138,8 @@ static int ipu_pixfmt_to_map(u32 fmt)
return IPU_DC_MAP_RGB24;
case V4L2_PIX_FMT_RGB565:
return IPU_DC_MAP_RGB565;
+ case IPU_PIX_FMT_GBR24:
+ return IPU_DC_MAP_GBR24;
default:
return -EINVAL;
}
@@ -364,6 +368,12 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
ipu_dc_map_config(priv, IPU_DC_MAP_RGB565, 1, 10, 0xfc); /* green */
ipu_dc_map_config(priv, IPU_DC_MAP_RGB565, 2, 15, 0xf8); /* red */
+ /* gbr24 */
+ ipu_dc_map_clear(priv, IPU_DC_MAP_GBR24);
+ ipu_dc_map_config(priv, IPU_DC_MAP_GBR24, 2, 15, 0xff); /* green */
+ ipu_dc_map_config(priv, IPU_DC_MAP_GBR24, 1, 7, 0xff); /* blue */
+ ipu_dc_map_config(priv, IPU_DC_MAP_GBR24, 0, 23, 0xff); /* red */
+
return 0;
}