aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-09-19 17:17:42 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-03-18 05:42:12 -0400
commit116c7721077cf82b942adaef146e97663247d972 (patch)
tree2b78db5fca0738cf0c1ed3de97400245966c22df
parentdf6682b43533e4c59c3d14b56de838c035a8bb9a (diff)
drm/omap: Move DISPC timing checks to CRTC .mode_valid() operation
The DISPC timings checks relate to the CRTC, but they're performed in the encoder and connector .atomic_check() and .mode_valid() operations. Move them to the CRTC .mode_valid() operation. 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>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_connector.c6
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c9
-rw-r--r--drivers/gpu/drm/omapdrm/omap_encoder.c6
3 files changed, 9 insertions, 12 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index e01e4cf61ae1..99ca5b3eaebb 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -245,8 +245,6 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
245 struct drm_display_mode *mode) 245 struct drm_display_mode *mode)
246{ 246{
247 struct omap_connector *omap_connector = to_omap_connector(connector); 247 struct omap_connector *omap_connector = to_omap_connector(connector);
248 enum omap_channel channel = omap_connector->output->dispc_channel;
249 struct omap_drm_private *priv = connector->dev->dev_private;
250 struct omap_dss_device *dssdev; 248 struct omap_dss_device *dssdev;
251 struct videomode vm = {0}; 249 struct videomode vm = {0};
252 struct drm_device *dev = connector->dev; 250 struct drm_device *dev = connector->dev;
@@ -256,10 +254,6 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
256 drm_display_mode_to_videomode(mode, &vm); 254 drm_display_mode_to_videomode(mode, &vm);
257 mode->vrefresh = drm_mode_vrefresh(mode); 255 mode->vrefresh = drm_mode_vrefresh(mode);
258 256
259 r = priv->dispc_ops->mgr_check_timings(priv->dispc, channel, &vm);
260 if (r)
261 goto done;
262
263 for (dssdev = omap_connector->output; dssdev; dssdev = dssdev->next) { 257 for (dssdev = omap_connector->output; dssdev; dssdev = dssdev->next) {
264 if (!dssdev->ops->check_timings) 258 if (!dssdev->ops->check_timings)
265 continue; 259 continue;
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index d99e24dcc0bf..ae399435346b 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -390,6 +390,15 @@ static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc,
390 const struct drm_display_mode *mode) 390 const struct drm_display_mode *mode)
391{ 391{
392 struct omap_drm_private *priv = crtc->dev->dev_private; 392 struct omap_drm_private *priv = crtc->dev->dev_private;
393 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
394 struct videomode vm = {0};
395 int r;
396
397 drm_display_mode_to_videomode(mode, &vm);
398 r = priv->dispc_ops->mgr_check_timings(priv->dispc, omap_crtc->channel,
399 &vm);
400 if (r)
401 return r;
393 402
394 /* Check for bandwidth limit */ 403 /* Check for bandwidth limit */
395 if (priv->max_bandwidth) { 404 if (priv->max_bandwidth) {
diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
index 1f4172f653b9..623154bc44bb 100644
--- a/drivers/gpu/drm/omapdrm/omap_encoder.c
+++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
@@ -206,19 +206,13 @@ static int omap_encoder_atomic_check(struct drm_encoder *encoder,
206 struct drm_connector_state *conn_state) 206 struct drm_connector_state *conn_state)
207{ 207{
208 struct omap_encoder *omap_encoder = to_omap_encoder(encoder); 208 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
209 enum omap_channel channel = omap_encoder->output->dispc_channel;
210 struct drm_device *dev = encoder->dev; 209 struct drm_device *dev = encoder->dev;
211 struct omap_drm_private *priv = dev->dev_private;
212 struct omap_dss_device *dssdev; 210 struct omap_dss_device *dssdev;
213 struct videomode vm = { 0 }; 211 struct videomode vm = { 0 };
214 int ret; 212 int ret;
215 213
216 drm_display_mode_to_videomode(&crtc_state->mode, &vm); 214 drm_display_mode_to_videomode(&crtc_state->mode, &vm);
217 215
218 ret = priv->dispc_ops->mgr_check_timings(priv->dispc, channel, &vm);
219 if (ret)
220 goto done;
221
222 for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) { 216 for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) {
223 if (!dssdev->ops->check_timings) 217 if (!dssdev->ops->check_timings)
224 continue; 218 continue;