Skip to content

Commit

Permalink
Merge omapdss compat layer work
Browse files Browse the repository at this point in the history
We have two separate, exclusive, users of omapdss: 1) omapfb + omap_vout and 2)
omapdrm. Because omapfb and omap_vout are independent drivers, we've built
layers in omapdss to manage the two simultaneous callers. These layers are not
needed for omapdrm, as omapdrm is the sole user of omapdss, and these layers in
fact only create trouble for omapdrm.

The simple option to improve omapdrm situation would be to copy the omapdss
code for omapdrm. We are trying to avoid this, as omapdss and the panel drivers
are quite a lot of code together, and most of the code would be used without
change.

Thus this series helps the situation by moving the omapdss code required by
omapfb + omap_vout to separate files, creating a distinct layer used only by
omapfb + omap_vout. We call this layer "compat layer". This compat layer then
uses the core omapdss driver to operate the hardware. omapdrm will use the core
omapdss directly, without any layers in between.

After this series, omapfb, omap_vout and omapdrm can all be compiled at the
same time. Obviously omapdrm and omapfb+omap_vout cannot be run at the same
time (the first one to start will "win"), so compiling them at the same time is
only sensible as modules for testing purposes. Normal users should only compile
one of those.

This series does not make omapdrm use the core omapdss API, that will happen in
a separate series for omapdrm.
  • Loading branch information
Tomi Valkeinen committed Dec 10, 2012
2 parents 6b6f1ed + a9ee9f0 commit d10ecc5
Show file tree
Hide file tree
Showing 20 changed files with 1,202 additions and 872 deletions.
17 changes: 14 additions & 3 deletions drivers/media/platform/omap/omap_vout.c
Original file line number Diff line number Diff line change
Expand Up @@ -2184,14 +2184,23 @@ static int __init omap_vout_probe(struct platform_device *pdev)
struct omap_dss_device *def_display;
struct omap2video_device *vid_dev = NULL;

ret = omapdss_compat_init();
if (ret) {
dev_err(&pdev->dev, "failed to init dss\n");
return ret;
}

if (pdev->num_resources == 0) {
dev_err(&pdev->dev, "probed for an unknown device\n");
return -ENODEV;
ret = -ENODEV;
goto err_dss_init;
}

vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL);
if (vid_dev == NULL)
return -ENOMEM;
if (vid_dev == NULL) {
ret = -ENOMEM;
goto err_dss_init;
}

vid_dev->num_displays = 0;
for_each_dss_dev(dssdev) {
Expand Down Expand Up @@ -2286,6 +2295,8 @@ static int __init omap_vout_probe(struct platform_device *pdev)
}
probe_err0:
kfree(vid_dev);
err_dss_init:
omapdss_compat_uninit();
return ret;
}

Expand Down
11 changes: 11 additions & 0 deletions drivers/staging/omapdrm/omap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,14 @@ static int dev_load(struct drm_device *dev, unsigned long flags)

dev->dev_private = priv;

ret = omapdss_compat_init();
if (ret) {
dev_err(dev->dev, "coult not init omapdss\n");
dev->dev_private = NULL;
kfree(priv);
return ret;
}

priv->wq = alloc_ordered_workqueue("omapdrm", 0);

INIT_LIST_HEAD(&priv->obj_list);
Expand All @@ -583,6 +591,7 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
dev_err(dev->dev, "omap_modeset_init failed: ret=%d\n", ret);
dev->dev_private = NULL;
kfree(priv);
omapdss_compat_uninit();
return ret;
}

Expand Down Expand Up @@ -618,6 +627,8 @@ static int dev_unload(struct drm_device *dev)
flush_workqueue(priv->wq);
destroy_workqueue(priv->wq);

omapdss_compat_uninit();

kfree(dev->dev_private);
dev->dev_private = NULL;

Expand Down
7 changes: 5 additions & 2 deletions drivers/video/omap2/dss/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
obj-$(CONFIG_OMAP2_DSS) += omapdss.o
# Core DSS files
omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \
manager.o manager-sysfs.o overlay.o overlay-sysfs.o output.o apply.o \
display-sysfs.o
output.o
# DSS compat layer files
omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \
dispc-compat.o display-sysfs.o
omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o
omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o venc_panel.o
Expand Down
Loading

0 comments on commit d10ecc5

Please sign in to comment.