Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be8e8e1c authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

OMAPDSS: add helpers to get mgr or output from display



Add two helper functions that can be used to find either the DSS output
or the overlay manager that is connected to the given display.

This hides how the output and the manager are actually connected, making
it easier to change the connections in the future.

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent e7243664
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -247,6 +247,9 @@ static int omap_modeset_init(struct drm_device *dev)
		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;
@@ -259,7 +262,7 @@ static int omap_modeset_init(struct drm_device *dev)
			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);
		}
	}
+3 −1
Original line number Diff line number Diff line
@@ -78,7 +78,9 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
	}

	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
+19 −0
Original line number Diff line number Diff line
@@ -141,6 +141,25 @@ struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node)
}
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)
+7 −2
Original line number Diff line number Diff line
@@ -770,12 +770,17 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)

	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;
+7 −9
Original line number Diff line number Diff line
@@ -2363,18 +2363,16 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
	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)
@@ -2383,7 +2381,7 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
		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");
Loading