]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/omap: Remove unneeded fallback for missing .check_timings()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 5 Jun 2018 21:04:39 +0000 (00:04 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:29 +0000 (16:13 +0300)
The .check_timings() operation is present in all panels and connectors.
The fallback that uses .get_timings() in the absence of .check_timings()
is thus unneeded.

While it could be argued that the fallback implements a useful check
that should be extended to cover all fixed-resolution panels, the code
is currently unused and gets in the way of the ongoing refactoring.
Remove it, a similar feature can always be added later.

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>
drivers/gpu/drm/omapdrm/omap_connector.c
drivers/gpu/drm/omapdrm/omap_encoder.c

index 06c48a64b7456157ade7855f6a991753ef2d6d52..b58d9a0bb53d0b79c8d201d9ab7a9a4851a72710 100644 (file)
@@ -261,30 +261,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
        drm_display_mode_to_videomode(mode, &vm);
        mode->vrefresh = drm_mode_vrefresh(mode);
 
-       /*
-        * if the panel driver doesn't have a check_timings, it's most likely
-        * a fixed resolution panel, check if the timings match with the
-        * panel's timings
-        */
-       if (dssdev->ops->check_timings) {
-               r = dssdev->ops->check_timings(dssdev, &vm);
-       } else {
-               struct videomode t = {0};
-
-               dssdev->ops->get_timings(dssdev, &t);
-
-               /*
-                * Ignore the flags, as we don't get them from
-                * drm_display_mode_to_videomode.
-                */
-               t.flags = 0;
-
-               if (memcmp(&vm, &t, sizeof(vm)))
-                       r = -EINVAL;
-               else
-                       r = 0;
-       }
-
+       r = dssdev->ops->check_timings(dssdev, &vm);
        if (!r) {
                /* check if vrefresh is still valid */
                new_mode = drm_mode_duplicate(dev, mode);
index 94b75d018e7173b54865130bc2939e7f0b70249e..a6dce480b2cf6ae7e8879e0cdc8921e7e8ced9ea 100644 (file)
@@ -101,21 +101,9 @@ static int omap_encoder_update(struct drm_encoder *encoder,
        struct omap_dss_device *dssdev = omap_encoder->display;
        int ret;
 
-       if (dssdev->ops->check_timings) {
-               ret = dssdev->ops->check_timings(dssdev, vm);
-       } else {
-               struct videomode t = {0};
-
-               dssdev->ops->get_timings(dssdev, &t);
-
-               if (memcmp(vm, &t, sizeof(*vm)))
-                       ret = -EINVAL;
-               else
-                       ret = 0;
-       }
-
+       ret = dssdev->ops->check_timings(dssdev, vm);
        if (ret) {
-               dev_err(dev->dev, "could not set timings: %d\n", ret);
+               dev_err(dev->dev, "invalid timings: %d\n", ret);
                return ret;
        }