aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-08-06 08:27:17 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-29 06:44:25 -0400
commit5d89bcc341771d95e3a2996218e5949a6627f59e (patch)
tree6aa464efa689c34931b72c94ff3b1021797b86b3 /drivers/video/omap2/omapfb
parent2bbcce5e0b47e0de83a1b799b9e164f8c5b9b634 (diff)
OMAPDSS: remove initial display code from omapdss
Currently omapdss driver sets up the initial connections between overlays, overlay manager and a panel, based on default display parameter coming from the board file or via module parameters. This is unnecessary, as it's the higher level component that should decide what display to use and how. This patch removes the code from omapdss, and implements similar code to omapfb. The def_disp module parameter and the default display platform_data parameter are kept in omapdss, but omapdss doesn't do anything with them. It will just return the default display name with dss_get_default_display_name() call, which omapfb uses. This is done to keep the backward compatibility. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/omapfb')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c77
1 files changed, 66 insertions, 11 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index ba4630830e09..af2844a34644 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2369,15 +2369,52 @@ static int omapfb_init_display(struct omapfb2_device *fbdev,
2369 return 0; 2369 return 0;
2370} 2370}
2371 2371
2372static int omapfb_init_connections(struct omapfb2_device *fbdev,
2373 struct omap_dss_device *dssdev)
2374{
2375 int i, r;
2376 struct omap_overlay_manager *mgr = NULL;
2377
2378 for (i = 0; i < fbdev->num_managers; i++) {
2379 mgr = fbdev->managers[i];
2380
2381 if (dssdev->channel == mgr->id)
2382 break;
2383 }
2384
2385 if (i == fbdev->num_managers)
2386 return -ENODEV;
2387
2388 if (mgr->output)
2389 mgr->unset_output(mgr);
2390
2391 r = mgr->set_output(mgr, dssdev->output);
2392 if (r)
2393 return r;
2394
2395 for (i = 0; i < fbdev->num_overlays; i++) {
2396 struct omap_overlay *ovl = fbdev->overlays[i];
2397
2398 if (ovl->manager)
2399 ovl->unset_manager(ovl);
2400
2401 r = ovl->set_manager(ovl, mgr);
2402 if (r)
2403 dev_warn(fbdev->dev,
2404 "failed to connect overlay %s to manager %s\n",
2405 ovl->name, mgr->name);
2406 }
2407
2408 return 0;
2409}
2410
2372static int __init omapfb_probe(struct platform_device *pdev) 2411static int __init omapfb_probe(struct platform_device *pdev)
2373{ 2412{
2374 struct omapfb2_device *fbdev = NULL; 2413 struct omapfb2_device *fbdev = NULL;
2375 int r = 0; 2414 int r = 0;
2376 int i; 2415 int i;
2377 struct omap_overlay *ovl;
2378 struct omap_dss_device *def_display; 2416 struct omap_dss_device *def_display;
2379 struct omap_dss_device *dssdev; 2417 struct omap_dss_device *dssdev;
2380 struct omap_dss_device *ovl_device;
2381 2418
2382 DBG("omapfb_probe\n"); 2419 DBG("omapfb_probe\n");
2383 2420
@@ -2445,15 +2482,33 @@ static int __init omapfb_probe(struct platform_device *pdev)
2445 for (i = 0; i < fbdev->num_managers; i++) 2482 for (i = 0; i < fbdev->num_managers; i++)
2446 fbdev->managers[i] = omap_dss_get_overlay_manager(i); 2483 fbdev->managers[i] = omap_dss_get_overlay_manager(i);
2447 2484
2448 /* gfx overlay should be the default one. find a display 2485 def_display = NULL;
2449 * connected to that, and use it as default display */ 2486
2450 ovl = omap_dss_get_overlay(0); 2487 for (i = 0; i < fbdev->num_displays; ++i) {
2451 ovl_device = ovl->get_device(ovl); 2488 struct omap_dss_device *dssdev;
2452 if (ovl_device) { 2489 const char *def_name;
2453 def_display = ovl_device; 2490
2454 } else { 2491 def_name = omapdss_get_default_display_name();
2455 dev_warn(&pdev->dev, "cannot find default display\n"); 2492
2456 def_display = NULL; 2493 dssdev = fbdev->displays[i].dssdev;
2494
2495 if (def_name == NULL ||
2496 (dssdev->name && strcmp(def_name, dssdev->name) == 0)) {
2497 def_display = dssdev;
2498 break;
2499 }
2500 }
2501
2502 if (def_display == NULL) {
2503 dev_err(fbdev->dev, "failed to find default display\n");
2504 r = -EINVAL;
2505 goto cleanup;
2506 }
2507
2508 r = omapfb_init_connections(fbdev, def_display);
2509 if (r) {
2510 dev_err(fbdev->dev, "failed to init overlay connections\n");
2511 goto cleanup;
2457 } 2512 }
2458 2513
2459 if (def_mode && strlen(def_mode) > 0) { 2514 if (def_mode && strlen(def_mode) > 0) {