aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-09-10 05:04:16 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-26 07:58:33 -0400
commit3224827630f1823c1181e562af9d36951f6cbd11 (patch)
treeff71a396a6e9b0c15bb6a8eb6ba45b3d2e9e4150 /drivers/video
parent23e2aa644f39fbc8121f49dd50ce85590cc4e4b7 (diff)
OMAPDSS: Create links between managers, outputs and devices
Links between DSS entities are made in dss_init_connections() when a panel device is registered, and are removed in dss_uninit_connections() when the device is unregistered. Modify these functions to incorporate the addition of outputs. The fields in omap_dss_device struct gives information on which output and manager to connect to. The desired manager and output pointers are retrieved and prepared to form the desired links. The output is linked to the device, and then the manager to the output. A helper function omapdss_get_output_from_device() is created to retrieve the output from the display by checking it's type, and the module id in case of DSI. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/display.c35
-rw-r--r--drivers/video/omap2/dss/dss.h1
-rw-r--r--drivers/video/omap2/dss/output.c33
3 files changed, 61 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index db83ae81a71..ccf8550fafd 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -327,22 +327,35 @@ EXPORT_SYMBOL(omapdss_default_get_timings);
327 */ 327 */
328static int dss_init_connections(struct omap_dss_device *dssdev, bool force) 328static int dss_init_connections(struct omap_dss_device *dssdev, bool force)
329{ 329{
330 struct omap_dss_output *out;
330 struct omap_overlay_manager *mgr; 331 struct omap_overlay_manager *mgr;
331 int i, r; 332 int i, r;
332 333
333 WARN_ON(dssdev->manager); 334 out = omapdss_get_output_from_dssdev(dssdev);
335
336 WARN_ON(dssdev->output);
337 WARN_ON(out->device);
338
339 r = omapdss_output_set_device(out, dssdev);
340 if (r) {
341 DSSERR("failed to connect output to new device\n");
342 return r;
343 }
334 344
335 mgr = omap_dss_get_overlay_manager(dssdev->channel); 345 mgr = omap_dss_get_overlay_manager(dssdev->channel);
336 346
337 if (mgr->device && !force) 347 if (mgr->output && !force)
338 return 0; 348 return 0;
339 349
340 if (mgr->device) 350 if (mgr->output)
341 mgr->unset_device(mgr); 351 mgr->unset_output(mgr);
342 352
343 r = mgr->set_device(mgr, dssdev); 353 r = mgr->set_output(mgr, out);
344 if (r) { 354 if (r) {
345 DSSERR("failed to set initial manager\n"); 355 DSSERR("failed to connect manager to output of new device\n");
356
357 /* remove the output-device connection we just made */
358 omapdss_output_unset_device(out);
346 return r; 359 return r;
347 } 360 }
348 361
@@ -366,8 +379,14 @@ static int dss_init_connections(struct omap_dss_device *dssdev, bool force)
366 379
367static void dss_uninit_connections(struct omap_dss_device *dssdev) 380static void dss_uninit_connections(struct omap_dss_device *dssdev)
368{ 381{
369 if (dssdev->manager) 382 if (dssdev->output) {
370 dssdev->manager->unset_device(dssdev->manager); 383 struct omap_overlay_manager *mgr = dssdev->output->manager;
384
385 if (mgr)
386 mgr->unset_output(mgr);
387
388 omapdss_output_unset_device(dssdev->output);
389 }
371} 390}
372 391
373int dss_init_device(struct platform_device *pdev, 392int dss_init_device(struct platform_device *pdev,
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b5c0df43547..a14528bcfea 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -232,6 +232,7 @@ int dss_ovl_unset_manager(struct omap_overlay *ovl);
232/* output */ 232/* output */
233void dss_register_output(struct omap_dss_output *out); 233void dss_register_output(struct omap_dss_output *out);
234void dss_unregister_output(struct omap_dss_output *out); 234void dss_unregister_output(struct omap_dss_output *out);
235struct omap_dss_output *omapdss_get_output_from_dssdev(struct omap_dss_device *dssdev);
235 236
236/* display */ 237/* display */
237int dss_suspend_all_devices(void); 238int dss_suspend_all_devices(void);
diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
index 1a84b79d558..813f26682b7 100644
--- a/drivers/video/omap2/dss/output.c
+++ b/drivers/video/omap2/dss/output.c
@@ -113,3 +113,36 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
113 113
114 return NULL; 114 return NULL;
115} 115}
116
117struct omap_dss_output *omapdss_get_output_from_dssdev(struct omap_dss_device *dssdev)
118{
119 struct omap_dss_output *out = NULL;
120 enum omap_dss_output_id id;
121
122 switch (dssdev->type) {
123 case OMAP_DISPLAY_TYPE_DPI:
124 out = omap_dss_get_output(OMAP_DSS_OUTPUT_DPI);
125 break;
126 case OMAP_DISPLAY_TYPE_DBI:
127 out = omap_dss_get_output(OMAP_DSS_OUTPUT_DBI);
128 break;
129 case OMAP_DISPLAY_TYPE_SDI:
130 out = omap_dss_get_output(OMAP_DSS_OUTPUT_SDI);
131 break;
132 case OMAP_DISPLAY_TYPE_VENC:
133 out = omap_dss_get_output(OMAP_DSS_OUTPUT_VENC);
134 break;
135 case OMAP_DISPLAY_TYPE_HDMI:
136 out = omap_dss_get_output(OMAP_DSS_OUTPUT_HDMI);
137 break;
138 case OMAP_DISPLAY_TYPE_DSI:
139 id = dssdev->phy.dsi.module == 0 ? OMAP_DSS_OUTPUT_DSI1 :
140 OMAP_DSS_OUTPUT_DSI2;
141 out = omap_dss_get_output(id);
142 break;
143 default:
144 break;
145 }
146
147 return out;
148}