diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-12-07 23:08:35 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-03-18 11:42:14 +0200 |
commit | 30b71761957c541cd9dfd6cd10e3feb21a8ddca1 (patch) | |
tree | f4f836e13195c5e982035a6ae64218f9e8e482de /drivers/gpu/drm/omapdrm/omap_drv.c | |
parent | 79107f274b2fc6bce13f687de33c8d0b70994558 (diff) | |
download | linux-30b71761957c541cd9dfd6cd10e3feb21a8ddca1.tar.gz |
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>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_drv.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index f3a36f7b3c4d..1b9b6f5e48e1 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -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]); |