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>
This commit is contained in:

committed by
Tomi Valkeinen

parent
3fbda31e81
commit
7c27fa57ef
@@ -165,27 +165,35 @@ static int omap_encoder_atomic_check(struct drm_encoder *encoder,
|
||||
struct drm_connector_state *conn_state)
|
||||
{
|
||||
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 omap_drm_private *priv = dev->dev_private;
|
||||
struct omap_dss_device *dssdev;
|
||||
struct videomode vm = { 0 };
|
||||
int ret;
|
||||
|
||||
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) {
|
||||
if (!dssdev->ops->check_timings)
|
||||
continue;
|
||||
|
||||
ret = dssdev->ops->check_timings(dssdev, &vm);
|
||||
if (ret) {
|
||||
dev_err(dev->dev, "invalid timings: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto done;
|
||||
}
|
||||
|
||||
drm_display_mode_from_videomode(&vm, &crtc_state->adjusted_mode);
|
||||
|
||||
return 0;
|
||||
done:
|
||||
if (ret)
|
||||
dev_err(dev->dev, "invalid timings: %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = {
|
||||
|
Reference in New Issue
Block a user