diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-06-04 18:57:09 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 09:13:30 -0400 |
commit | 7c27fa57ef31debf62c5529725d4fa096b336a99 (patch) | |
tree | 7c21c68f5d509b16249838efbf33d00e18844169 /drivers/gpu/drm/omapdrm/omap_encoder.c | |
parent | 3fbda31e814868d8477ddf52d74b7b8f596578e8 (diff) |
drm/omap: Call dispc timings check operation directly
Instead of call the dispc timings check function dispc_mgr_timings_ok()
from the internal encoders .check_timings() operation, expose it through
the dispc ops (after renaming it to check_timings) and call it directly
from omapdrm. This allows removal of now empty omap_dss_device
.check_timings() operations.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_encoder.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_encoder.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c index 0177a2c4b77a..749d21a92edd 100644 --- a/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c | |||
@@ -165,27 +165,35 @@ static int omap_encoder_atomic_check(struct drm_encoder *encoder, | |||
165 | struct drm_connector_state *conn_state) | 165 | struct drm_connector_state *conn_state) |
166 | { | 166 | { |
167 | struct omap_encoder *omap_encoder = to_omap_encoder(encoder); | 167 | struct omap_encoder *omap_encoder = to_omap_encoder(encoder); |
168 | enum omap_channel channel = omap_encoder->output->dispc_channel; | ||
168 | struct drm_device *dev = encoder->dev; | 169 | struct drm_device *dev = encoder->dev; |
170 | struct omap_drm_private *priv = dev->dev_private; | ||
169 | struct omap_dss_device *dssdev; | 171 | struct omap_dss_device *dssdev; |
170 | struct videomode vm = { 0 }; | 172 | struct videomode vm = { 0 }; |
171 | int ret; | 173 | int ret; |
172 | 174 | ||
173 | drm_display_mode_to_videomode(&crtc_state->mode, &vm); | 175 | drm_display_mode_to_videomode(&crtc_state->mode, &vm); |
174 | 176 | ||
177 | ret = priv->dispc_ops->mgr_check_timings(priv->dispc, channel, &vm); | ||
178 | if (ret) | ||
179 | goto done; | ||
180 | |||
175 | for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) { | 181 | for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) { |
176 | if (!dssdev->ops->check_timings) | 182 | if (!dssdev->ops->check_timings) |
177 | continue; | 183 | continue; |
178 | 184 | ||
179 | ret = dssdev->ops->check_timings(dssdev, &vm); | 185 | ret = dssdev->ops->check_timings(dssdev, &vm); |
180 | if (ret) { | 186 | if (ret) |
181 | dev_err(dev->dev, "invalid timings: %d\n", ret); | 187 | goto done; |
182 | return ret; | ||
183 | } | ||
184 | } | 188 | } |
185 | 189 | ||
186 | drm_display_mode_from_videomode(&vm, &crtc_state->adjusted_mode); | 190 | drm_display_mode_from_videomode(&vm, &crtc_state->adjusted_mode); |
187 | 191 | ||
188 | return 0; | 192 | done: |
193 | if (ret) | ||
194 | dev_err(dev->dev, "invalid timings: %d\n", ret); | ||
195 | |||
196 | return ret; | ||
189 | } | 197 | } |
190 | 198 | ||
191 | static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = { | 199 | static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = { |