Skip to content

Commit

Permalink
Merge branch 'archit/outputs-for-3.7'
Browse files Browse the repository at this point in the history
Merge omapdss output work, that creates a new entity "output" to represent the
outputs (DPI, DSI, HDMI, ...) from DSS. An output sits in between an overlay
manager and a panel, and helps us to remove references to panel devices from
the omapdss core.

* archit/outputs-for-3.7: (23 commits)
  OMAPDSS: Remove old way of setting manager and device links
  OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable
  OMAPDSS: OVERLAY/MANAGER: Get device via output
  OMAPDSS: MANAGER: Update display sysfs store
  OMAPFB: Change dssdev->manager references
  OMAPDSS: HDMI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: VENC: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: RFBI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: SDI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: DSI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: DSI: Remove dsi_pdev_map global struct
  OMAPDSS: DPI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: Create links between managers, outputs and devices
  OMAPDRM: Remove manager->device references
  OMAPFB: remove manager->device references
  OMAP_VOUT: Remove manager->device references
  OMAPDSS: Remove manager->device references
  OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager
  OMAPDSS: output: Add set/unset device ops for omap_dss_output
  OMAPDSS: outputs: Create and register output instances
  ...
  • Loading branch information
Tomi Valkeinen committed Sep 26, 2012
2 parents e84dc1c + 3c2995a commit 866f095
Show file tree
Hide file tree
Showing 23 changed files with 743 additions and 198 deletions.
75 changes: 50 additions & 25 deletions drivers/media/video/omap/omap_vout.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,15 @@ static int omapvid_init(struct omap_vout_device *vout, u32 addr)

win = &vout->win;
for (i = 0; i < ovid->num_overlays; i++) {
struct omap_dss_device *dssdev;

ovl = ovid->overlays[i];
if (!ovl->manager || !ovl->manager->device)
dssdev = ovl->get_device(ovl);

if (!dssdev)
return -EINVAL;

timing = &ovl->manager->device->panel.timings;
timing = &dssdev->panel.timings;

outw = win->w.width;
outh = win->w.height;
Expand Down Expand Up @@ -515,8 +519,11 @@ static int omapvid_apply_changes(struct omap_vout_device *vout)
struct omapvideo_info *ovid = &vout->vid_info;

for (i = 0; i < ovid->num_overlays; i++) {
struct omap_dss_device *dssdev;

ovl = ovid->overlays[i];
if (!ovl->manager || !ovl->manager->device)
dssdev = ovl->get_device(ovl);
if (!dssdev)
return -EINVAL;
ovl->manager->apply(ovl->manager);
}
Expand Down Expand Up @@ -579,12 +586,14 @@ static void omap_vout_isr(void *arg, unsigned int irqstatus)

ovid = &vout->vid_info;
ovl = ovid->overlays[0];
/* get the display device attached to the overlay */
if (!ovl->manager || !ovl->manager->device)
return;

mgr_id = ovl->manager->id;
cur_display = ovl->manager->device;

/* get the display device attached to the overlay */
cur_display = ovl->get_device(ovl);

if (!cur_display)
return;

spin_lock(&vout->vbq_lock);
do_gettimeofday(&timevalue);
Expand Down Expand Up @@ -948,7 +957,9 @@ static int omap_vout_release(struct file *file)
/* Disable all the overlay managers connected with this interface */
for (i = 0; i < ovid->num_overlays; i++) {
struct omap_overlay *ovl = ovid->overlays[i];
if (ovl->manager && ovl->manager->device)
struct omap_dss_device *dssdev = ovl->get_device(ovl);

if (dssdev)
ovl->disable(ovl);
}
/* Turn off the pipeline */
Expand Down Expand Up @@ -1081,14 +1092,17 @@ static int vidioc_try_fmt_vid_out(struct file *file, void *fh,
struct omapvideo_info *ovid;
struct omap_video_timings *timing;
struct omap_vout_device *vout = fh;
struct omap_dss_device *dssdev;

ovid = &vout->vid_info;
ovl = ovid->overlays[0];
/* get the display device attached to the overlay */
dssdev = ovl->get_device(ovl);

if (!ovl->manager || !ovl->manager->device)
if (!dssdev)
return -EINVAL;
/* get the display device attached to the overlay */
timing = &ovl->manager->device->panel.timings;

timing = &dssdev->panel.timings;

vout->fbuf.fmt.height = timing->y_res;
vout->fbuf.fmt.width = timing->x_res;
Expand All @@ -1105,6 +1119,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
struct omapvideo_info *ovid;
struct omap_video_timings *timing;
struct omap_vout_device *vout = fh;
struct omap_dss_device *dssdev;

if (vout->streaming)
return -EBUSY;
Expand All @@ -1113,13 +1128,14 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,

ovid = &vout->vid_info;
ovl = ovid->overlays[0];
dssdev = ovl->get_device(ovl);

/* get the display device attached to the overlay */
if (!ovl->manager || !ovl->manager->device) {
if (!dssdev) {
ret = -EINVAL;
goto s_fmt_vid_out_exit;
}
timing = &ovl->manager->device->panel.timings;
timing = &dssdev->panel.timings;

/* We dont support RGB24-packed mode if vrfb rotation
* is enabled*/
Expand Down Expand Up @@ -1298,20 +1314,23 @@ static int vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
struct omapvideo_info *ovid;
struct omap_overlay *ovl;
struct omap_video_timings *timing;
struct omap_dss_device *dssdev;

if (vout->streaming)
return -EBUSY;

mutex_lock(&vout->lock);
ovid = &vout->vid_info;
ovl = ovid->overlays[0];
/* get the display device attached to the overlay */
dssdev = ovl->get_device(ovl);

if (!ovl->manager || !ovl->manager->device) {
if (!dssdev) {
ret = -EINVAL;
goto s_crop_err;
}
/* get the display device attached to the overlay */
timing = &ovl->manager->device->panel.timings;

timing = &dssdev->panel.timings;

if (is_rotation_90_or_270(vout)) {
vout->fbuf.fmt.height = timing->x_res;
Expand Down Expand Up @@ -1667,7 +1686,7 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
for (j = 0; j < ovid->num_overlays; j++) {
struct omap_overlay *ovl = ovid->overlays[j];

if (ovl->manager && ovl->manager->device) {
if (ovl->get_device(ovl)) {
struct omap_overlay_info info;
ovl->get_overlay_info(ovl, &info);
info.paddr = addr;
Expand All @@ -1690,8 +1709,9 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)

for (j = 0; j < ovid->num_overlays; j++) {
struct omap_overlay *ovl = ovid->overlays[j];
struct omap_dss_device *dssdev = ovl->get_device(ovl);

if (ovl->manager && ovl->manager->device) {
if (dssdev) {
ret = ovl->enable(ovl);
if (ret)
goto streamon_err1;
Expand Down Expand Up @@ -1726,8 +1746,9 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)

for (j = 0; j < ovid->num_overlays; j++) {
struct omap_overlay *ovl = ovid->overlays[j];
struct omap_dss_device *dssdev = ovl->get_device(ovl);

if (ovl->manager && ovl->manager->device)
if (dssdev)
ovl->disable(ovl);
}

Expand Down Expand Up @@ -1890,8 +1911,8 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
struct video_device *vfd;
struct v4l2_pix_format *pix;
struct v4l2_control *control;
struct omap_dss_device *display =
vout->vid_info.overlays[0]->manager->device;
struct omap_overlay *ovl = vout->vid_info.overlays[0];
struct omap_dss_device *display = ovl->get_device(ovl);

/* set the default pix */
pix = &vout->pix;
Expand Down Expand Up @@ -2205,8 +2226,10 @@ static int __init omap_vout_probe(struct platform_device *pdev)
*/
for (i = 1; i < vid_dev->num_overlays; i++) {
ovl = omap_dss_get_overlay(i);
if (ovl->manager && ovl->manager->device) {
def_display = ovl->manager->device;
dssdev = ovl->get_device(ovl);

if (dssdev) {
def_display = dssdev;
} else {
dev_warn(&pdev->dev, "cannot find display\n");
def_display = NULL;
Expand Down Expand Up @@ -2253,8 +2276,10 @@ static int __init omap_vout_probe(struct platform_device *pdev)
for (i = 1; i < vid_dev->num_overlays; i++) {
def_display = NULL;
ovl = omap_dss_get_overlay(i);
if (ovl->manager && ovl->manager->device)
def_display = ovl->manager->device;
dssdev = ovl->get_device(ovl);

if (dssdev)
def_display = dssdev;

if (def_display && def_display->driver)
def_display->driver->disable(def_display);
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/omapdrm/omap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ static void dump_video_chains(void)
for (i = 0; i < omap_dss_get_num_overlays(); i++) {
struct omap_overlay *ovl = omap_dss_get_overlay(i);
struct omap_overlay_manager *mgr = ovl->manager;
struct omap_dss_device *dssdev = mgr ? mgr->device : NULL;
struct omap_dss_device *dssdev = mgr ?
mgr->get_device(mgr) : NULL;
if (dssdev) {
DBG("%d: %s -> %s -> %s", i, ovl->name, mgr->name,
dssdev->name);
Expand Down Expand Up @@ -185,7 +186,7 @@ static int create_connector(struct drm_device *dev,
for (j = 0; j < priv->num_encoders; j++) {
struct omap_overlay_manager *mgr =
omap_encoder_get_manager(priv->encoders[j]);
if (mgr->device == dssdev) {
if (mgr->get_device(mgr) == dssdev) {
drm_mode_connector_attach_encoder(connector,
priv->encoders[j]);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
obj-$(CONFIG_OMAP2_DSS) += omapdss.o
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 apply.o
manager.o manager-sysfs.o overlay.o overlay-sysfs.o output.o apply.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 866f095

Please sign in to comment.