From patchwork Thu Jul 1 10:31:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 109042 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o61AVjSb022374 for ; Thu, 1 Jul 2010 10:31:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755208Ab0GAKbo (ORCPT ); Thu, 1 Jul 2010 06:31:44 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:59965 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755044Ab0GAKbo (ORCPT ); Thu, 1 Jul 2010 06:31:44 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o61AVeER003911 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Jul 2010 05:31:40 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o61AVcrL003619; Thu, 1 Jul 2010 05:31:38 -0500 (CDT) Received: from localhost (omaplbp.india.ti.com [172.24.190.217]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o61AVYP16946; Thu, 1 Jul 2010 05:31:35 -0500 (CDT) From: Archit Taneja To: linux-omap@vger.kernel.org Cc: tomi.valkeinen@nokia.com, Sumit Semwal , Senthilvadivu Guruswamy , Mukund Mittal , Archit Taneja , Samreen Subject: [PATCH] [RFC][PATCH 2/8] OMAP: DSS2: Add new Overlay Manager Date: Thu, 1 Jul 2010 16:01:19 +0530 Message-Id: <1277980285-20996-3-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.5.4.7 In-Reply-To: <1277980285-20996-2-git-send-email-archit@ti.com> References: <1277980285-20996-1-git-send-email-archit@ti.com> <1277980285-20996-2-git-send-email-archit@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 01 Jul 2010 10:31:46 +0000 (UTC) diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 6a649ab..2636b7f --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c @@ -34,6 +34,8 @@ #include "dss.h" +#define MAX_DSS_MANAGERS (cpu_is_omap44xx() ? 3 : 2) + static int num_managers; static struct list_head manager_list; @@ -449,7 +451,7 @@ struct manager_cache_data { static struct { spinlock_t lock; struct overlay_cache_data overlay_cache[3]; - struct manager_cache_data manager_cache[2]; + struct manager_cache_data manager_cache[3]; bool irq_enabled; } dss_cache; @@ -531,10 +533,9 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) return 0; - + channel = mgr->device->channel; if (dssdev->type == OMAP_DISPLAY_TYPE_VENC) { irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN; - channel = OMAP_DSS_CHANNEL_DIGIT; } else { if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { enum omap_dss_update_mode mode; @@ -546,7 +547,6 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) } else { irq = DISPC_IRQ_VSYNC; } - channel = OMAP_DSS_CHANNEL_LCD; } mc = &dss_cache.manager_cache[mgr->id]; @@ -604,13 +604,13 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) return 0; dssdev = ovl->manager->device; + channel = dssdev->channel; if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) return 0; if (dssdev->type == OMAP_DISPLAY_TYPE_VENC) { irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN; - channel = OMAP_DSS_CHANNEL_DIGIT; } else { if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { enum omap_dss_update_mode mode; @@ -622,7 +622,6 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) } else { irq = DISPC_IRQ_VSYNC; } - channel = OMAP_DSS_CHANNEL_LCD; } oc = &dss_cache.overlay_cache[ovl->id]; @@ -841,7 +840,8 @@ static int configure_overlay(enum omap_plane plane) c->rotation_type, c->rotation, c->mirror, - c->global_alpha); + c->global_alpha, + c->channel); if (r) { /* this shouldn't happen */ @@ -883,20 +883,20 @@ static int configure_dispc(void) struct overlay_cache_data *oc; struct manager_cache_data *mc; const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache); - const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache); + const int num_mgrs = MAX_DSS_MANAGERS; int i; int r; - bool mgr_busy[2]; - bool mgr_go[2]; + bool mgr_busy[MAX_DSS_MANAGERS]; + bool mgr_go[MAX_DSS_MANAGERS]; bool busy; r = 0; busy = false; - mgr_busy[0] = dispc_go_busy(0); - mgr_busy[1] = dispc_go_busy(1); - mgr_go[0] = false; - mgr_go[1] = false; + for (i = 0; i < num_mgrs; i++) { + mgr_busy[i] = dispc_go_busy(i); + mgr_go[i] = false; + } /* Commit overlay settings */ for (i = 0; i < num_ovls; ++i) { @@ -1122,7 +1122,7 @@ void dss_start_update(struct omap_dss_device *dssdev) struct manager_cache_data *mc; struct overlay_cache_data *oc; const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache); - const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache); + const int num_mgrs = MAX_DSS_MANAGERS; struct omap_overlay_manager *mgr; int i; @@ -1154,10 +1154,10 @@ static void dss_apply_irq_handler(void *data, u32 mask) const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache); const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache); int i, r; - bool mgr_busy[2]; + bool mgr_busy[MAX_DSS_MANAGERS]; - mgr_busy[0] = dispc_go_busy(0); - mgr_busy[1] = dispc_go_busy(1); + for (i = 0; i < num_mgrs; i++) + mgr_busy[i] = dispc_go_busy(i); spin_lock(&dss_cache.lock); @@ -1461,7 +1461,7 @@ int dss_init_overlay_managers(struct platform_device *pdev) num_managers = 0; - for (i = 0; i < 2; ++i) { + for (i = 0; i < MAX_DSS_MANAGERS; ++i) { struct omap_overlay_manager *mgr; mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); @@ -1471,15 +1471,25 @@ int dss_init_overlay_managers(struct platform_device *pdev) case 0: mgr->name = "lcd"; mgr->id = OMAP_DSS_CHANNEL_LCD; - mgr->supported_displays = - OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | - OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI; + mgr->supported_displays = OMAP_DISPLAY_TYPE_DBI | + OMAP_DISPLAY_TYPE_DSI; + if (cpu_is_omap34xx()) + mgr->supported_displays |= + OMAP_DISPLAY_TYPE_DPI | + OMAP_DISPLAY_TYPE_SDI; break; case 1: mgr->name = "tv"; mgr->id = OMAP_DSS_CHANNEL_DIGIT; mgr->supported_displays = OMAP_DISPLAY_TYPE_VENC; break; + case 2: + mgr->name = "2lcd"; + mgr->id = OMAP_DSS_CHANNEL_LCD2; + mgr->supported_displays = + OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | + OMAP_DISPLAY_TYPE_DSI; + break; } mgr->set_device = &omap_dss_set_device;