From patchwork Wed Nov 7 14:44:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 1710961 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id EF6DBE003B for ; Wed, 7 Nov 2012 14:46:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754170Ab2KGOqK (ORCPT ); Wed, 7 Nov 2012 09:46:10 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:50616 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753091Ab2KGOoz (ORCPT ); Wed, 7 Nov 2012 09:44:55 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qA7EisSU003316; Wed, 7 Nov 2012 08:44:54 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA7EisrT010170; Wed, 7 Nov 2012 08:44:54 -0600 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Wed, 7 Nov 2012 08:44:54 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA7EisD5015760; Wed, 7 Nov 2012 08:44:54 -0600 Received: from localhost (a0393947pc.apr.dhcp.ti.com [172.24.136.151]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id qA7Eiqw12826; Wed, 7 Nov 2012 08:44:53 -0600 (CST) From: Archit Taneja To: CC: , , Archit Taneja Subject: [RFC 01/11] OMAPDSS: Add writeback output driver Date: Wed, 7 Nov 2012 20:14:19 +0530 Message-ID: <1352299469-17609-2-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352299469-17609-1-git-send-email-archit@ti.com> References: <1352299469-17609-1-git-send-email-archit@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Writeback is implemented as an output driver. This lets writeback to connect to overlay managers, and configure writeback's manager like properties the same way other output drivers do. This driver can be considered something similar to the DPI output driver. It provides functions which configure the writeback's manager-like registers via apply. One difference though is that these functions won't be used by a panel driver. They'd be used by a writeback user directly. Signed-off-by: Archit Taneja --- drivers/video/omap2/dss/Kconfig | 13 +++++ drivers/video/omap2/dss/Makefile | 1 + drivers/video/omap2/dss/core.c | 6 +++ drivers/video/omap2/dss/dss.h | 6 +++ drivers/video/omap2/dss/writeback.c | 102 +++++++++++++++++++++++++++++++++++ include/video/omapdss.h | 10 ++++ 6 files changed, 138 insertions(+) create mode 100644 drivers/video/omap2/dss/writeback.c diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig index 50e8802..9e52d4b 100644 --- a/drivers/video/omap2/dss/Kconfig +++ b/drivers/video/omap2/dss/Kconfig @@ -99,6 +99,19 @@ config OMAP2_DSS_DSI See http://www.mipi.org/ for DSI specifications. +config OMAP4_DSS_WRITEBACK + bool "writeback support" + default n + help + writeback is a DISPC pipeline that takes pixel data from an overlay + output or a overlay manager output and writes it back into a specified + address in memory. + + writeback pipeline allows us to take benefit of the hardware + processing available inside the DISPC like color space conversion, + rescaling, compositing etc and perform either a memory-to-memory + transfer with data processing, or capture a displayed frame. + config OMAP2_DSS_MIN_FCK_PER_PCK int "Minimum FCK/PCK ratio (for scaling)" range 0 32 diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile index 4070191..211a290 100644 --- a/drivers/video/omap2/dss/Makefile +++ b/drivers/video/omap2/dss/Makefile @@ -8,4 +8,5 @@ omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi.o \ hdmi_panel.o ti_hdmi_4xxx_ip.o +omapdss-$(CONFIG_OMAP4_DSS_WRITEBACK) += writeback.o ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index b1a9ce1..4040868 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -528,6 +528,9 @@ static int (*dss_output_drv_reg_funcs[])(void) __initdata = { #ifdef CONFIG_OMAP4_DSS_HDMI hdmi_init_platform_driver, #endif +#ifdef CONFIG_OMAP4_DSS_WRITEBACK + writeback_init_platform_driver, +#endif }; static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { @@ -549,6 +552,9 @@ static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { #ifdef CONFIG_OMAP4_DSS_HDMI hdmi_uninit_platform_driver, #endif +#ifdef CONFIG_OMAP4_DSS_WRITEBACK + writeback_uninit_platform_driver, +#endif }; static bool dss_output_drv_loaded[ARRAY_SIZE(dss_output_drv_reg_funcs)]; diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 84a7f6a..f7eb7d6 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -528,6 +528,12 @@ bool hdmi_mode_has_audio(void); int hdmi_audio_config(struct omap_dss_audio *audio); #endif +/* Writeback */ +#ifdef CONFIG_OMAP4_DSS_WRITEBACK +int writeback_init_platform_driver(void) __init; +void writeback_uninit_platform_driver(void) __exit; +#endif + /* RFBI */ int rfbi_init_platform_driver(void) __init; void rfbi_uninit_platform_driver(void) __exit; diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c new file mode 100644 index 0000000..b5c6406 --- /dev/null +++ b/drivers/video/omap2/dss/writeback.c @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2012 Texas Instruments + * Author: Archit Taneja + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define DSS_SUBSYS_NAME "WB" + +#include +#include +#include +#include + +#include