Commit 116c7721 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent df6682b4
...@@ -245,8 +245,6 @@ static int omap_connector_mode_valid(struct drm_connector *connector, ...@@ -245,8 +245,6 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct omap_connector *omap_connector = to_omap_connector(connector); struct omap_connector *omap_connector = to_omap_connector(connector);
enum omap_channel channel = omap_connector->output->dispc_channel;
struct omap_drm_private *priv = connector->dev->dev_private;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
struct videomode vm = {0}; struct videomode vm = {0};
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
...@@ -256,10 +254,6 @@ static int omap_connector_mode_valid(struct drm_connector *connector, ...@@ -256,10 +254,6 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
drm_display_mode_to_videomode(mode, &vm); drm_display_mode_to_videomode(mode, &vm);
mode->vrefresh = drm_mode_vrefresh(mode); mode->vrefresh = drm_mode_vrefresh(mode);
r = priv->dispc_ops->mgr_check_timings(priv->dispc, channel, &vm);
if (r)
goto done;
for (dssdev = omap_connector->output; dssdev; dssdev = dssdev->next) { for (dssdev = omap_connector->output; dssdev; dssdev = dssdev->next) {
if (!dssdev->ops->check_timings) if (!dssdev->ops->check_timings)
continue; continue;
......
...@@ -390,6 +390,15 @@ static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc, ...@@ -390,6 +390,15 @@ static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc,
const struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
struct omap_drm_private *priv = crtc->dev->dev_private; struct omap_drm_private *priv = crtc->dev->dev_private;
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
struct videomode vm = {0};
int r;
drm_display_mode_to_videomode(mode, &vm);
r = priv->dispc_ops->mgr_check_timings(priv->dispc, omap_crtc->channel,
&vm);
if (r)
return r;
/* Check for bandwidth limit */ /* Check for bandwidth limit */
if (priv->max_bandwidth) { if (priv->max_bandwidth) {
......
...@@ -206,19 +206,13 @@ static int omap_encoder_atomic_check(struct drm_encoder *encoder, ...@@ -206,19 +206,13 @@ static int omap_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_connector_state *conn_state) struct drm_connector_state *conn_state)
{ {
struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
enum omap_channel channel = omap_encoder->output->dispc_channel;
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct omap_drm_private *priv = dev->dev_private;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
struct videomode vm = { 0 }; struct videomode vm = { 0 };
int ret; int ret;
drm_display_mode_to_videomode(&crtc_state->mode, &vm); drm_display_mode_to_videomode(&crtc_state->mode, &vm);
ret = priv->dispc_ops->mgr_check_timings(priv->dispc, channel, &vm);
if (ret)
goto done;
for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) { for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) {
if (!dssdev->ops->check_timings) if (!dssdev->ops->check_timings)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment