From mboxrd@z Thu Jan 1 00:00:00 1970 From: Archit Taneja Subject: [RFC PATCH 03/29] OMAPDSS: Writeback: Add writeback interface and panel driver Date: Tue, 27 Dec 2011 18:06:46 +0530 Message-ID: <1324989432-3625-4-git-send-email-archit@ti.com> References: <1324989432-3625-1-git-send-email-archit@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from bear.ext.ti.com ([192.94.94.41]:58015 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753612Ab1L0Mic (ORCPT ); Tue, 27 Dec 2011 07:38:32 -0500 In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: tomi.valkeinen@ti.com Cc: rohitkc@ti.com, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, Archit Taneja Create a new struct called omap_dss_writeback. This will represent a writeback pipeline the way omap_overlay and omap_overlay_manager represent overlay and managers respectively. Create a writeback interface and a dummy writeback panel driver. The writeback panel driver is needed for the omap_dss_device pointer which represents writeback in omap_dss_mgr_output. Add a omap_dss_device pointer to the omap_dss_writeback struct, and a omap_dss_writeback pointer in omap_dss_device struct, link the writeback and dss_device together when the latter is added. Signed-off-by: Archit Taneja --- drivers/video/omap2/dss/Makefile | 2 +- drivers/video/omap2/dss/core.c | 2 + drivers/video/omap2/dss/display.c | 3 + drivers/video/omap2/dss/dss.h | 5 + drivers/video/omap2/dss/dss_features.c | 8 + drivers/video/omap2/dss/dss_features.h | 1 + drivers/video/omap2/dss/writeback.c | 223 ++++++++++++++++++++++++++++++++ include/video/omapdss.h | 13 ++ 8 files changed, 256 insertions(+), 1 deletions(-) create mode 100644 drivers/video/omap2/dss/writeback.c diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile index 5c450b0..51c544e 100644 --- a/drivers/video/omap2/dss/Makefile +++ b/drivers/video/omap2/dss/Makefile @@ -1,6 +1,6 @@ obj-$(CONFIG_OMAP2_DSS) += omapdss.o omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \ - manager.o overlay.o apply.o + manager.o overlay.o apply.o writeback.o omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 5c46430..21bfd0a 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -182,6 +182,7 @@ static int omap_dss_probe(struct platform_device *pdev) dss_init_overlay_managers(pdev); dss_init_overlays(pdev); + dss_init_writeback(); r = dss_init_platform_driver(); if (r) { @@ -276,6 +277,7 @@ static int omap_dss_remove(struct platform_device *pdev) dispc_uninit_platform_driver(); dss_uninit_platform_driver(); + dss_uninit_writeback(); dss_uninit_overlays(pdev); dss_uninit_overlay_managers(pdev); diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index be331dc..a712bad 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c @@ -391,6 +391,9 @@ void dss_init_device(struct platform_device *pdev, case OMAP_DISPLAY_TYPE_HDMI: r = hdmi_init_display(dssdev); break; + case OMAP_DISPLAY_TYPE_WB: + r = writeback_init_display(dssdev); + break; default: DSSERR("Support for display '%s' not compiled in.\n", dssdev->name); diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 3cf99a9..607e730 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -226,6 +226,11 @@ int dss_ovl_simple_check(struct omap_overlay *ovl, int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info, struct omap_dss_device *dssdev); +/* writeback */ +void dss_init_writeback(void); +void dss_uninit_writeback(void); +int writeback_init_display(struct omap_dss_device *dssdev); + /* DSS */ int dss_init_platform_driver(void); void dss_uninit_platform_driver(void); diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index 5e4b829..ca41620 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c @@ -45,6 +45,7 @@ struct omap_dss_features { const int num_mgrs; const int num_ovls; + const int num_wb; const enum omap_display_type *supported_displays; const enum omap_color_mode *supported_color_modes; const enum omap_overlay_caps *overlay_caps; @@ -423,6 +424,7 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = { .num_mgrs = 3, .num_ovls = 4, + .num_wb = 1, .supported_displays = omap4_dss_supported_displays, .supported_color_modes = omap4_dss_supported_color_modes, .overlay_caps = omap4_dss_overlay_caps, @@ -447,6 +449,7 @@ static const struct omap_dss_features omap4_dss_features = { .num_mgrs = 3, .num_ovls = 4, + .num_wb = 1, .supported_displays = omap4_dss_supported_displays, .supported_color_modes = omap4_dss_supported_color_modes, .overlay_caps = omap4_dss_overlay_caps, @@ -493,6 +496,11 @@ int dss_feat_get_num_ovls(void) return omap_current_dss_features->num_ovls; } +int dss_feat_get_num_wb(void) +{ + return omap_current_dss_features->num_wb; +} + unsigned long dss_feat_get_param_min(enum dss_range_param param) { return omap_current_dss_features->dss_params[param].min; diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index cd833bb..75ee1f1 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h @@ -92,6 +92,7 @@ enum dss_range_param { /* DSS Feature Functions */ int dss_feat_get_num_mgrs(void); int dss_feat_get_num_ovls(void); +int dss_feat_get_num_wb(void); unsigned long dss_feat_get_param_min(enum dss_range_param param); unsigned long dss_feat_get_param_max(enum dss_range_param param); enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c new file mode 100644 index 0000000..ac5d3ba --- /dev/null +++ b/drivers/video/omap2/dss/writeback.c @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2011 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 "WRITEBACK" + +#include +#include +#include +#include +#include + +#include