linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com
Cc: rob@ti.com, linux-omap@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Archit Taneja <archit@ti.com>
Subject: [PATCH v2 05/23] OMAPDSS: Remove manager->device references
Date: Thu, 30 Aug 2012 11:52:27 +0000	[thread overview]
Message-ID: <1346326845-16583-6-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1346326845-16583-1-git-send-email-archit@ti.com>

With the introduction of output entities, managers will now connect to outputs.
Create a helper op for managers named get_device. This will abstract away the
information on how to get the device from an overlay manager. The get_device
op currently retrieves the output via a manager->device reference. This will
be later replaced by a manager->output->device reference.

Signed-off-by: Archit Taneja <archit@ti.com>
---
 drivers/video/omap2/dss/apply.c   |    6 ++++--
 drivers/video/omap2/dss/dispc.c   |   10 +++++++---
 drivers/video/omap2/dss/manager.c |   19 ++++++++++++++-----
 include/video/omapdss.h           |    2 ++
 4 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index d241407..8a05cbc 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1607,7 +1607,8 @@ int dss_ovl_enable(struct omap_overlay *ovl)
 		goto err1;
 	}
 
-	if (ovl->manager = NULL || ovl->manager->device = NULL) {
+	if (ovl->manager = NULL ||
+			ovl->manager->get_device(ovl->manager) = NULL) {
 		r = -EINVAL;
 		goto err1;
 	}
@@ -1676,7 +1677,8 @@ int dss_ovl_disable(struct omap_overlay *ovl)
 		goto err;
 	}
 
-	if (ovl->manager = NULL || ovl->manager->device = NULL) {
+	if (ovl->manager = NULL ||
+			ovl->manager->get_device(ovl->manager) = NULL) {
 		r = -EINVAL;
 		goto err;
 	}
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 0de9a7e..bfd73f5 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3549,7 +3549,7 @@ static void dispc_error_worker(struct work_struct *work)
 		bit = mgr_desc[i].sync_lost_irq;
 
 		if (bit & errors) {
-			struct omap_dss_device *dssdev = mgr->device;
+			struct omap_dss_device *dssdev = mgr->get_device(mgr);
 			bool enable;
 
 			DSSERR("SYNC_LOST on channel %s, restarting the output "
@@ -3580,9 +3580,13 @@ static void dispc_error_worker(struct work_struct *work)
 		DSSERR("OCP_ERR\n");
 		for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
 			struct omap_overlay_manager *mgr;
+			struct omap_dss_device *dssdev;
+
 			mgr = omap_dss_get_overlay_manager(i);
-			if (mgr->device && mgr->device->driver)
-				mgr->device->driver->disable(mgr->device);
+			dssdev = mgr->get_device(mgr);
+
+			if (dssdev && dssdev->driver)
+				dssdev->driver->disable(dssdev);
 		}
 	}
 
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index e15fa5f..fd39f66 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -43,8 +43,10 @@ static ssize_t manager_name_show(struct omap_overlay_manager *mgr, char *buf)
 
 static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "%s\n",
-			mgr->device ? mgr->device->name : "<none>");
+	struct omap_dss_device *dssdev = mgr->get_device(mgr);
+
+	return snprintf(buf, PAGE_SIZE, "%s\n", dssdev ?
+			dssdev->name : "<none>");
 }
 
 static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
@@ -72,7 +74,7 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
 	if (dssdev)
 		DSSDBG("display %s found\n", dssdev->name);
 
-	if (mgr->device) {
+	if (mgr->get_device(mgr)) {
 		r = mgr->unset_device(mgr);
 		if (r) {
 			DSSERR("failed to unset display\n");
@@ -490,9 +492,15 @@ static struct kobj_type manager_ktype = {
 	.default_attrs = manager_sysfs_attrs,
 };
 
+static inline struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr)
+{
+	return mgr->device;
+}
+
 static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
 {
 	unsigned long timeout = msecs_to_jiffies(500);
+	struct omap_dss_device *dssdev = mgr->get_device(mgr);
 	u32 irq;
 	int r;
 
@@ -500,9 +508,9 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
 	if (r)
 		return r;
 
-	if (mgr->device->type = OMAP_DISPLAY_TYPE_VENC)
+	if (dssdev->type = OMAP_DISPLAY_TYPE_VENC)
 		irq = DISPC_IRQ_EVSYNC_ODD;
-	else if (mgr->device->type = OMAP_DISPLAY_TYPE_HDMI)
+	else if (dssdev->type = OMAP_DISPLAY_TYPE_HDMI)
 		irq = DISPC_IRQ_EVSYNC_EVEN;
 	else
 		irq = dispc_mgr_get_vsync_irq(mgr->id);
@@ -556,6 +564,7 @@ int dss_init_overlay_managers(struct platform_device *pdev)
 		mgr->get_manager_info = &dss_mgr_get_info;
 		mgr->wait_for_go = &dss_mgr_wait_for_go;
 		mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
+		mgr->get_device = &dss_mgr_get_device;
 
 		mgr->caps = 0;
 		mgr->supported_displays diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index a3b35f9..29c1440 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -490,6 +490,8 @@ struct omap_overlay_manager {
 	int (*apply)(struct omap_overlay_manager *mgr);
 	int (*wait_for_go)(struct omap_overlay_manager *mgr);
 	int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
+
+	struct omap_dss_device *(*get_device)(struct omap_overlay_manager *mgr);
 };
 
 /* 22 pins means 1 clk lane and 10 data lanes */
-- 
1.7.9.5


  parent reply	other threads:[~2012-08-30 11:52 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21  6:10 [PATCH 00/23] OMAPDSS: Create output entities Archit Taneja
2012-08-21  6:10 ` [PATCH 01/23] OMAPDSS: outputs: Create a new entity called outputs Archit Taneja
2012-08-24 12:41   ` Tomi Valkeinen
2012-08-24 12:53     ` Archit Taneja
2012-08-29 10:32       ` Tomi Valkeinen
2012-08-29 10:58         ` Archit Taneja
2012-08-21  6:10 ` [PATCH 02/23] OMAPDSS: outputs: Create and initialize output instances Archit Taneja
2012-08-24 13:14   ` Tomi Valkeinen
2012-08-27  6:31     ` Archit Taneja
2012-08-27  6:44       ` Tomi Valkeinen
2012-08-21  6:10 ` [PATCH 03/23] OMAPDSS: output: Add set/unset device ops for omap_dss_output Archit Taneja
2012-08-21  6:10 ` [PATCH 04/23] OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager Archit Taneja
2012-08-21  6:10 ` [PATCH 05/23] OMAPDSS: Remove manager->device references Archit Taneja
2012-08-21  6:10 ` [PATCH 06/23] OMAP_VOUT: " Archit Taneja
2012-08-21  6:10 ` [PATCH 07/23] OMAPFB: remove " Archit Taneja
2012-08-21  6:10 ` [PATCH 08/23] OMAPDRM: Remove " Archit Taneja
2012-08-21  6:10 ` [PATCH 09/23] OMAPDSS: Create links between managers, outputs and devices Archit Taneja
2012-08-21  6:10 ` [PATCH 10/23] OMAPDSS: DPI: Pass outputs from panel driver to DPI interface driver Archit Taneja
2012-08-21  6:10 ` [PATCH 11/23] OMAPDSS: DSI: Remove dsi_pdev_map global struct Archit Taneja
2012-08-21  6:10 ` [PATCH 12/23] OMAPDSS: DSI: Pass outputs from panel driver to DSI interface driver Archit Taneja
2012-08-21  6:10 ` [PATCH 13/23] OMAPDSS: SDI: Pass outputs from panel driver to SDI " Archit Taneja
2012-08-21  6:10 ` [PATCH 14/23] OMAPDSS: RFBI: Pass outputs from panel driver to RFBI " Archit Taneja
2012-08-21  6:10 ` [PATCH 15/23] OMAPDSS: RFBI: Add output pointers as arguments to all exported functions Archit Taneja
2012-08-21  6:10 ` [PATCH 16/23] OMAPDSS: VENC: Pass outputs from panel driver to VENC interface driver Archit Taneja
2012-08-21  6:10 ` [PATCH 17/23] OMAPDSS: HDMI: Pass outputs from panel driver to HDMI " Archit Taneja
2012-08-21  6:10 ` [PATCH 18/23] OMAPDSS: HDMI: Add output pointers as arguments to all functions used by hdmi panel dr Archit Taneja
2012-08-21  6:10 ` [PATCH 19/23] OMAPDSS/OMAPFB: Change dssdev->manager references Archit Taneja
2012-08-21  6:10 ` [PATCH 20/23] OMAPDSS: MANAGER: Update display sysfs store Archit Taneja
2012-08-21  6:10 ` [PATCH 21/23] OMAPDSS: MANAGER: Get device via output Archit Taneja
2012-08-21  6:10 ` [PATCH 22/23] OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable Archit Taneja
2012-08-21  6:10 ` [PATCH 23/23] OMAPDSS: Remove old way of setting manager and device links Archit Taneja
2012-08-30 11:52 ` [PATCH v2 00/23] OMAPDSS: Create output entities Archit Taneja
2012-08-30 11:52   ` [PATCH v2 01/23] OMAPDSS: outputs: Create a new entity called outputs Archit Taneja
2012-08-30 11:52   ` [PATCH v2 02/23] OMAPDSS: outputs: Create and register output instances Archit Taneja
2012-08-31 11:57     ` Tomi Valkeinen
2012-08-31 12:15       ` Archit Taneja
2012-08-30 11:52   ` [PATCH v2 03/23] OMAPDSS: output: Add set/unset device ops for omap_dss_output Archit Taneja
2012-08-31 12:03     ` Tomi Valkeinen
2012-08-31 12:36       ` Archit Taneja
2012-08-31 12:28         ` Tomi Valkeinen
2012-08-30 11:52   ` [PATCH v2 04/23] OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager Archit Taneja
2012-08-30 11:52   ` Archit Taneja [this message]
2012-08-30 11:52   ` [PATCH v2 06/23] OMAP_VOUT: Remove manager->device references Archit Taneja
2012-08-31 12:11     ` Tomi Valkeinen
2012-08-31 12:46       ` Archit Taneja
2012-08-30 11:52   ` [PATCH v2 07/23] OMAPFB: remove " Archit Taneja
2012-08-30 11:52   ` [PATCH v2 08/23] OMAPDRM: Remove " Archit Taneja
2012-08-30 11:52   ` [PATCH v2 09/23] OMAPDSS: Create links between managers, outputs and devices Archit Taneja
2012-08-31 14:10     ` Tomi Valkeinen
2012-08-31 14:36       ` Archit Taneja
2012-08-31 14:45         ` Tomi Valkeinen
2012-08-31 15:08           ` Tomi Valkeinen
2012-09-03  9:38             ` Archit Taneja
2012-09-03  9:35               ` Tomi Valkeinen
2012-08-30 11:52   ` [PATCH v2 10/23] OMAPDSS: DPI: Pass omap_dss_output within the driver Archit Taneja
2012-08-31 13:48     ` Tomi Valkeinen
2012-08-31 13:59       ` Archit Taneja
2012-08-30 11:52   ` [PATCH v2 11/23] OMAPDSS: DSI: Remove dsi_pdev_map global struct Archit Taneja
2012-08-30 11:52   ` [PATCH v2 12/23] OMAPDSS: DSI: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52   ` [PATCH v2 13/23] OMAPDSS: SDI: " Archit Taneja
2012-08-30 11:52   ` [PATCH v2 14/23] OMAPDSS: RFBI: " Archit Taneja
2012-08-30 11:52   ` [PATCH v2 15/23] OMAPDSS: RFBI: Add dssdev pointers as arguments to all exported functions Archit Taneja
2012-08-31 14:20     ` Tomi Valkeinen
2012-08-31 14:42       ` Archit Taneja
2012-08-30 11:52   ` [PATCH v2 16/23] OMAPDSS: VENC: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52   ` [PATCH v2 17/23] OMAPDSS: HDMI: " Archit Taneja
2012-08-30 11:52   ` [PATCH v2 18/23] OMAPDSS: HDMI: Add dssdev pointer as an argument to all functions used by hdmi pane Archit Taneja
2012-08-30 11:52   ` [PATCH v2 19/23] OMAPDSS/OMAPFB: Change dssdev->manager references Archit Taneja
2012-08-30 11:52   ` [PATCH v2 20/23] OMAPDSS: MANAGER: Update display sysfs store Archit Taneja
2012-08-31 14:30     ` Tomi Valkeinen
2012-08-31 14:53       ` Archit Taneja
2012-08-30 11:52   ` [PATCH v2 21/23] OMAPDSS: MANAGER: Get device via output Archit Taneja
2012-08-30 11:52   ` [PATCH v2 22/23] OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable Archit Taneja
2012-08-30 11:52   ` [PATCH v2 23/23] OMAPDSS: Remove old way of setting manager and device links Archit Taneja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346326845-16583-6-git-send-email-archit@ti.com \
    --to=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rob@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).