drm/omap: Add support for drm_panel
Hook up drm_panel support in the omapdrm driver. The change is relatively simply as the way has been paved by drm_bridge support already. In addition to looking up, attaching to and detaching from the panel, we only need to add panel support in the connector .get_modes() handler, take connector bus flags (set by the panel) into account, and enable/disable the panel in the encoder enable/disable operations handlers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:

committed by
Tomi Valkeinen

parent
79107f274b
commit
30b7176195
@@ -23,6 +23,7 @@
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_fb_helper.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_panel.h>
|
||||
|
||||
#include "omap_dmm_tiler.h"
|
||||
#include "omap_drv.h"
|
||||
@@ -137,6 +138,9 @@ static void omap_disconnect_pipelines(struct drm_device *ddev)
|
||||
for (i = 0; i < priv->num_pipes; i++) {
|
||||
struct omap_drm_pipeline *pipe = &priv->pipes[i];
|
||||
|
||||
if (pipe->output->panel)
|
||||
drm_panel_detach(pipe->output->panel);
|
||||
|
||||
omapdss_device_disconnect(NULL, pipe->output);
|
||||
|
||||
omapdss_device_put(pipe->output);
|
||||
@@ -214,13 +218,15 @@ static int omap_display_id(struct omap_dss_device *output)
|
||||
display = omapdss_display_get(output);
|
||||
node = display->dev->of_node;
|
||||
omapdss_device_put(display);
|
||||
} else {
|
||||
} else if (output->bridge) {
|
||||
struct drm_bridge *bridge = output->bridge;
|
||||
|
||||
while (bridge->next)
|
||||
bridge = bridge->next;
|
||||
|
||||
node = bridge->of_node;
|
||||
} else if (output->panel) {
|
||||
node = output->panel->dev->of_node;
|
||||
}
|
||||
|
||||
return node ? of_alias_get_id(node, "display") : -ENODEV;
|
||||
@@ -335,6 +341,13 @@ static int omap_modeset_init(struct drm_device *dev)
|
||||
return -ENOMEM;
|
||||
|
||||
drm_connector_attach_encoder(pipe->connector, encoder);
|
||||
|
||||
if (pipe->output->panel) {
|
||||
ret = drm_panel_attach(pipe->output->panel,
|
||||
pipe->connector);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
crtc = omap_crtc_init(dev, pipe, priv->planes[i]);
|
||||
|
Reference in New Issue
Block a user