drm/omap: Add a dss device operation flag for .get_modes()
Instead of manually iterating over the dss devices in the pipeline to find the first one that implements the .get_modes() operation, add a new operation flag for .get_modes() and use the omap_connector_find_device() helper function to locate the right dss device. 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:
Родитель
a872d5e92a
Коммит
46b3847d7f
|
@ -152,6 +152,7 @@ static int panel_dpi_probe(struct platform_device *pdev)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_DPI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
drm_bus_flags_from_videomode(&ddata->vm, &dssdev->bus_flags);
|
||||
|
||||
omapdss_display_init(dssdev);
|
||||
|
|
|
@ -1271,6 +1271,7 @@ static int dsicm_probe(struct platform_device *pdev)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_DSI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
|
||||
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
|
||||
OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
|
||||
|
|
|
@ -199,6 +199,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_DPI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
|
||||
/*
|
||||
* Note: According to the panel documentation:
|
||||
|
|
|
@ -194,6 +194,7 @@ static int nec_8048_probe(struct spi_device *spi)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_DPI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
dssdev->bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_SYNC_POSEDGE
|
||||
| DRM_BUS_FLAG_PIXDATA_POSEDGE;
|
||||
|
||||
|
|
|
@ -209,6 +209,7 @@ static int sharp_ls_probe(struct platform_device *pdev)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_DPI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
|
||||
/*
|
||||
* Note: According to the panel documentation:
|
||||
|
|
|
@ -708,6 +708,7 @@ static int acx565akm_probe(struct spi_device *spi)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_SDI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
dssdev->bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_SYNC_NEGEDGE
|
||||
| DRM_BUS_FLAG_PIXDATA_POSEDGE;
|
||||
|
||||
|
|
|
@ -323,6 +323,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_DPI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
|
||||
/*
|
||||
* Note: According to the panel documentation:
|
||||
|
|
|
@ -422,6 +422,7 @@ static int tpo_td043_probe(struct spi_device *spi)
|
|||
dssdev->type = OMAP_DISPLAY_TYPE_DPI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
|
||||
/*
|
||||
* Note: According to the panel documentation:
|
||||
|
|
|
@ -393,12 +393,14 @@ struct omap_dss_device_ops {
|
|||
* enum omap_dss_device_ops_flag - Indicates which device ops are supported
|
||||
* @OMAP_DSS_DEVICE_OP_DETECT: The device supports output connection detection
|
||||
* @OMAP_DSS_DEVICE_OP_HPD: The device supports all hot-plug-related operations
|
||||
* @OMAP_DSS_DEVICE_OP_EDID: The device supports readind EDID
|
||||
* @OMAP_DSS_DEVICE_OP_EDID: The device supports reading EDID
|
||||
* @OMAP_DSS_DEVICE_OP_MODES: The device supports reading modes
|
||||
*/
|
||||
enum omap_dss_device_ops_flag {
|
||||
OMAP_DSS_DEVICE_OP_DETECT = BIT(0),
|
||||
OMAP_DSS_DEVICE_OP_HPD = BIT(1),
|
||||
OMAP_DSS_DEVICE_OP_EDID = BIT(2),
|
||||
OMAP_DSS_DEVICE_OP_MODES = BIT(3),
|
||||
};
|
||||
|
||||
struct omap_dss_device {
|
||||
|
|
|
@ -755,6 +755,7 @@ static int venc_init_output(struct venc_device *venc)
|
|||
out->ops = &venc_ops;
|
||||
out->owner = THIS_MODULE;
|
||||
out->of_ports = BIT(0);
|
||||
out->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
|
||||
|
||||
r = omapdss_device_init_output(out);
|
||||
if (r < 0)
|
||||
|
|
|
@ -228,10 +228,10 @@ static int omap_connector_get_modes(struct drm_connector *connector)
|
|||
* Otherwise if the display pipeline reports modes (e.g. with a fixed
|
||||
* resolution panel or an analog TV output), query it.
|
||||
*/
|
||||
for (dssdev = omap_connector->display; dssdev; dssdev = dssdev->src) {
|
||||
if (dssdev->ops->get_modes)
|
||||
return dssdev->ops->get_modes(dssdev, connector);
|
||||
}
|
||||
dssdev = omap_connector_find_device(connector,
|
||||
OMAP_DSS_DEVICE_OP_MODES);
|
||||
if (dssdev)
|
||||
return dssdev->ops->get_modes(dssdev, connector);
|
||||
|
||||
/*
|
||||
* We can't retrieve modes, which can happen for instance for a DVI or
|
||||
|
|
Загрузка…
Ссылка в новой задаче