[RFC PATCH 09/29] OMAPDSS: APPLY: Allow manager set/unset_device ops to set/unset writeback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow dss_mgr_set_device/unset_device to set/unset either display or writeback
based on the dssdev argument passed to the function. Check if the device is a
writeback device by seeing if the wbdev pointer is populated for it or not.

Signed-off-by: Archit Taneja <archit@xxxxxx>
---
 drivers/video/omap2/dss/apply.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 4624f86..aee0420 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1300,7 +1300,11 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,
 	}
 
 	dssdev->manager = mgr;
-	mgr->output->device = dssdev;
+
+	if (dssdev->wbdev)
+		mgr->output->writeback = dssdev;
+	else
+		mgr->output->device = dssdev;
 
 	mutex_unlock(&apply_lock);
 
@@ -1318,7 +1322,8 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
 
 	mutex_lock(&apply_lock);
 
-	curr_dssdev = mgr->output->device;
+	curr_dssdev = dssdev->wbdev ? mgr->get_writeback(mgr) :
+			mgr->get_display(mgr);
 
 	if (!curr_dssdev) {
 		DSSERR("failed to unset device, device not set.\n");
@@ -1336,7 +1341,11 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
 	}
 
 	curr_dssdev->manager = NULL;
-	mgr->output->device = NULL;
+
+	if (dssdev->wbdev)
+		mgr->output->writeback = NULL;
+	else
+		mgr->output->device = NULL;
 
 	mutex_unlock(&apply_lock);
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux