diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-09-12 17:37:35 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-03-18 05:42:12 -0400 |
commit | 46b3847d7f680d51a29384a5ee9e1d54e6739f5d (patch) | |
tree | 1c69160019ef3706cffad42e97e36ab915f4793c /drivers/gpu/drm/omapdrm | |
parent | a872d5e92a6728b6155a5cfbaab3db88bf2e2b7c (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
11 files changed, 16 insertions, 5 deletions
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c index d6a584292e91..897b8820e000 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c | |||
@@ -152,6 +152,7 @@ static int panel_dpi_probe(struct platform_device *pdev) | |||
152 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; | 152 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
153 | dssdev->owner = THIS_MODULE; | 153 | dssdev->owner = THIS_MODULE; |
154 | dssdev->of_ports = BIT(0); | 154 | dssdev->of_ports = BIT(0); |
155 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
155 | drm_bus_flags_from_videomode(&ddata->vm, &dssdev->bus_flags); | 156 | drm_bus_flags_from_videomode(&ddata->vm, &dssdev->bus_flags); |
156 | 157 | ||
157 | omapdss_display_init(dssdev); | 158 | omapdss_display_init(dssdev); |
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index c5f570106a17..fe9d9f847d2e 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | |||
@@ -1271,6 +1271,7 @@ static int dsicm_probe(struct platform_device *pdev) | |||
1271 | dssdev->type = OMAP_DISPLAY_TYPE_DSI; | 1271 | dssdev->type = OMAP_DISPLAY_TYPE_DSI; |
1272 | dssdev->owner = THIS_MODULE; | 1272 | dssdev->owner = THIS_MODULE; |
1273 | dssdev->of_ports = BIT(0); | 1273 | dssdev->of_ports = BIT(0); |
1274 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
1274 | 1275 | ||
1275 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | | 1276 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | |
1276 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; | 1277 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; |
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c index e05b7f80416e..f37931bf1c5f 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | |||
@@ -199,6 +199,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) | |||
199 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; | 199 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
200 | dssdev->owner = THIS_MODULE; | 200 | dssdev->owner = THIS_MODULE; |
201 | dssdev->of_ports = BIT(0); | 201 | dssdev->of_ports = BIT(0); |
202 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
202 | 203 | ||
203 | /* | 204 | /* |
204 | * Note: According to the panel documentation: | 205 | * Note: According to the panel documentation: |
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c index cf2127837e67..8f2fb3d0492f 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | |||
@@ -194,6 +194,7 @@ static int nec_8048_probe(struct spi_device *spi) | |||
194 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; | 194 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
195 | dssdev->owner = THIS_MODULE; | 195 | dssdev->owner = THIS_MODULE; |
196 | dssdev->of_ports = BIT(0); | 196 | dssdev->of_ports = BIT(0); |
197 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
197 | dssdev->bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_SYNC_POSEDGE | 198 | dssdev->bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_SYNC_POSEDGE |
198 | | DRM_BUS_FLAG_PIXDATA_POSEDGE; | 199 | | DRM_BUS_FLAG_PIXDATA_POSEDGE; |
199 | 200 | ||
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c index 30320cee1e56..8d5d7f775b55 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | |||
@@ -209,6 +209,7 @@ static int sharp_ls_probe(struct platform_device *pdev) | |||
209 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; | 209 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
210 | dssdev->owner = THIS_MODULE; | 210 | dssdev->owner = THIS_MODULE; |
211 | dssdev->of_ports = BIT(0); | 211 | dssdev->of_ports = BIT(0); |
212 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
212 | 213 | ||
213 | /* | 214 | /* |
214 | * Note: According to the panel documentation: | 215 | * Note: According to the panel documentation: |
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c index 8debe77f92ff..b8360cef3754 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | |||
@@ -708,6 +708,7 @@ static int acx565akm_probe(struct spi_device *spi) | |||
708 | dssdev->type = OMAP_DISPLAY_TYPE_SDI; | 708 | dssdev->type = OMAP_DISPLAY_TYPE_SDI; |
709 | dssdev->owner = THIS_MODULE; | 709 | dssdev->owner = THIS_MODULE; |
710 | dssdev->of_ports = BIT(0); | 710 | dssdev->of_ports = BIT(0); |
711 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
711 | dssdev->bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_SYNC_NEGEDGE | 712 | dssdev->bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_SYNC_NEGEDGE |
712 | | DRM_BUS_FLAG_PIXDATA_POSEDGE; | 713 | | DRM_BUS_FLAG_PIXDATA_POSEDGE; |
713 | 714 | ||
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c index c8b15f19a166..721c5bb3bdef 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | |||
@@ -323,6 +323,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi) | |||
323 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; | 323 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
324 | dssdev->owner = THIS_MODULE; | 324 | dssdev->owner = THIS_MODULE; |
325 | dssdev->of_ports = BIT(0); | 325 | dssdev->of_ports = BIT(0); |
326 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
326 | 327 | ||
327 | /* | 328 | /* |
328 | * Note: According to the panel documentation: | 329 | * Note: According to the panel documentation: |
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c index 9ecc4c7bee67..50960018dbe8 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | |||
@@ -422,6 +422,7 @@ static int tpo_td043_probe(struct spi_device *spi) | |||
422 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; | 422 | dssdev->type = OMAP_DISPLAY_TYPE_DPI; |
423 | dssdev->owner = THIS_MODULE; | 423 | dssdev->owner = THIS_MODULE; |
424 | dssdev->of_ports = BIT(0); | 424 | dssdev->of_ports = BIT(0); |
425 | dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
425 | 426 | ||
426 | /* | 427 | /* |
427 | * Note: According to the panel documentation: | 428 | * Note: According to the panel documentation: |
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 7637fc041b71..01da7e94b974 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h | |||
@@ -393,12 +393,14 @@ struct omap_dss_device_ops { | |||
393 | * enum omap_dss_device_ops_flag - Indicates which device ops are supported | 393 | * enum omap_dss_device_ops_flag - Indicates which device ops are supported |
394 | * @OMAP_DSS_DEVICE_OP_DETECT: The device supports output connection detection | 394 | * @OMAP_DSS_DEVICE_OP_DETECT: The device supports output connection detection |
395 | * @OMAP_DSS_DEVICE_OP_HPD: The device supports all hot-plug-related operations | 395 | * @OMAP_DSS_DEVICE_OP_HPD: The device supports all hot-plug-related operations |
396 | * @OMAP_DSS_DEVICE_OP_EDID: The device supports readind EDID | 396 | * @OMAP_DSS_DEVICE_OP_EDID: The device supports reading EDID |
397 | * @OMAP_DSS_DEVICE_OP_MODES: The device supports reading modes | ||
397 | */ | 398 | */ |
398 | enum omap_dss_device_ops_flag { | 399 | enum omap_dss_device_ops_flag { |
399 | OMAP_DSS_DEVICE_OP_DETECT = BIT(0), | 400 | OMAP_DSS_DEVICE_OP_DETECT = BIT(0), |
400 | OMAP_DSS_DEVICE_OP_HPD = BIT(1), | 401 | OMAP_DSS_DEVICE_OP_HPD = BIT(1), |
401 | OMAP_DSS_DEVICE_OP_EDID = BIT(2), | 402 | OMAP_DSS_DEVICE_OP_EDID = BIT(2), |
403 | OMAP_DSS_DEVICE_OP_MODES = BIT(3), | ||
402 | }; | 404 | }; |
403 | 405 | ||
404 | struct omap_dss_device { | 406 | struct omap_dss_device { |
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c index cefefe6d6fcb..f1abb4195a76 100644 --- a/drivers/gpu/drm/omapdrm/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c | |||
@@ -755,6 +755,7 @@ static int venc_init_output(struct venc_device *venc) | |||
755 | out->ops = &venc_ops; | 755 | out->ops = &venc_ops; |
756 | out->owner = THIS_MODULE; | 756 | out->owner = THIS_MODULE; |
757 | out->of_ports = BIT(0); | 757 | out->of_ports = BIT(0); |
758 | out->ops_flags = OMAP_DSS_DEVICE_OP_MODES; | ||
758 | 759 | ||
759 | r = omapdss_device_init_output(out); | 760 | r = omapdss_device_init_output(out); |
760 | if (r < 0) | 761 | if (r < 0) |
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index c0157554c12f..dc4533c8cbb4 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c | |||
@@ -228,10 +228,10 @@ static int omap_connector_get_modes(struct drm_connector *connector) | |||
228 | * Otherwise if the display pipeline reports modes (e.g. with a fixed | 228 | * Otherwise if the display pipeline reports modes (e.g. with a fixed |
229 | * resolution panel or an analog TV output), query it. | 229 | * resolution panel or an analog TV output), query it. |
230 | */ | 230 | */ |
231 | for (dssdev = omap_connector->display; dssdev; dssdev = dssdev->src) { | 231 | dssdev = omap_connector_find_device(connector, |
232 | if (dssdev->ops->get_modes) | 232 | OMAP_DSS_DEVICE_OP_MODES); |
233 | return dssdev->ops->get_modes(dssdev, connector); | 233 | if (dssdev) |
234 | } | 234 | return dssdev->ops->get_modes(dssdev, connector); |
235 | 235 | ||
236 | /* | 236 | /* |
237 | * We can't retrieve modes, which can happen for instance for a DVI or | 237 | * We can't retrieve modes, which can happen for instance for a DVI or |