struct drm_encoder *encoder = priv->encoders[i];
struct omap_dss_device *dssdev =
omap_encoder_get_dssdev(encoder);
+ struct omap_dss_output *output;
+
+ output = omapdss_find_output_from_display(dssdev);
/* figure out which crtc's we can connect the encoder to: */
encoder->possible_crtcs = 0;
supported_outputs =
dss_feat_get_supported_outputs(crtc_channel);
- if (supported_outputs & dssdev->output->id)
+ if (supported_outputs & output->id)
encoder->possible_crtcs |= (1 << id);
}
}
}
if (dssdev) {
- struct omap_dss_output *out = dssdev->output;
+ struct omap_dss_output *out;
+
+ out = omapdss_find_output_from_display(dssdev);
/*
* a registered device should have an output connected to it
}
EXPORT_SYMBOL(omap_dss_find_output_by_node);
+struct omap_dss_output *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
+{
+ return dssdev->output;
+}
+EXPORT_SYMBOL(omapdss_find_output_from_display);
+
+struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev)
+{
+ struct omap_dss_output *out;
+
+ out = omapdss_find_output_from_display(dssdev);
+
+ if (out == NULL)
+ return NULL;
+
+ return out->manager;
+}
+EXPORT_SYMBOL(omapdss_find_mgr_from_display);
+
static const struct dss_mgr_ops *dss_mgr_ops;
int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops)
case OMAPFB_WAITFORVSYNC:
DBG("ioctl WAITFORVSYNC\n");
- if (!display || !display->output || !display->output->manager) {
+
+ if (!display) {
r = -EINVAL;
break;
}
- mgr = display->output->manager;
+ mgr = omapdss_find_mgr_from_display(display);
+ if (!mgr) {
+ r = -EINVAL;
+ break;
+ }
r = mgr->wait_for_vsync(mgr);
break;
int i, r;
struct omap_overlay_manager *mgr;
- if (!def_dssdev->output) {
- dev_err(fbdev->dev, "no output for the default display\n");
- return -EINVAL;
- }
-
for (i = 0; i < fbdev->num_displays; ++i) {
struct omap_dss_device *dssdev = fbdev->displays[i].dssdev;
- struct omap_dss_output *out = dssdev->output;
+ struct omap_dss_output *out;
- mgr = omap_dss_get_overlay_manager(out->dispc_channel);
+ out = omapdss_find_output_from_display(dssdev);
+ if (!out)
+ continue;
- if (!mgr || !out)
+ mgr = omap_dss_get_overlay_manager(out->dispc_channel);
+ if (!mgr)
continue;
if (mgr->output)
mgr->set_output(mgr, out);
}
- mgr = def_dssdev->output->manager;
+ mgr = omapdss_find_mgr_from_display(def_dssdev);
if (!mgr) {
dev_err(fbdev->dev, "no ovl manager for the default display\n");
struct omap_dss_device *dssdev);
int omapdss_output_unset_device(struct omap_dss_output *out);
+struct omap_dss_output *omapdss_find_output_from_display(struct omap_dss_device *dssdev);
+struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev);
+
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);