drm/omap: dsi: drop custom panel capability support
authorSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 15 Dec 2020 10:46:04 +0000 (12:46 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 15 Dec 2020 14:08:24 +0000 (16:08 +0200)
Due to previous changes the DSI encoder gets the capabilities
via DSI client's mode_flags and no longer needs the omapdss
specific caps. The core code now checks if the DSI encoder
is actually configured into command mode instead of just checking
the panel capabilities.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-32-tomi.valkeinen@ti.com
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
drivers/gpu/drm/omapdrm/dss/dsi.c
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/omap_crtc.c

index b72930d..da925d2 100644 (file)
@@ -593,9 +593,6 @@ static int dsicm_probe(struct mipi_dsi_device *dsi)
        dssdev->of_port = 0;
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
 
-       dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
-               OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
-
        omapdss_display_init(dssdev);
        omapdss_device_register(dssdev);
 
index 56cff14..be95f93 100644 (file)
@@ -4728,6 +4728,13 @@ static bool dsi_vm_calc(struct dsi_data *dsi,
                        dsi_vm_calc_pll_cb, ctx);
 }
 
+static bool dsi_is_video_mode(struct omap_dss_device *dssdev)
+{
+       struct dsi_data *dsi = to_dsi_data(dssdev);
+
+       return dsi->mode == OMAP_DSS_DSI_VIDEO_MODE;
+}
+
 static int dsi_set_config(struct omap_dss_device *dssdev,
                const struct omap_dss_dsi_config *config)
 {
@@ -4947,6 +4954,7 @@ static const struct omap_dss_device_ops dsi_ops = {
                .disable_video_output = dsi_disable_video_output,
 
                .update = dsi_update_all,
+               .is_video_mode = dsi_is_video_mode,
        },
 };
 
index 592c208..e0e058a 100644 (file)
@@ -123,11 +123,6 @@ enum omap_dss_dsi_mode {
        OMAP_DSS_DSI_VIDEO_MODE,
 };
 
-enum omap_display_caps {
-       OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE      = 1 << 0,
-       OMAP_DSS_DISPLAY_CAP_TEAR_ELIM          = 1 << 1,
-};
-
 enum omap_dss_display_state {
        OMAP_DSS_DISPLAY_DISABLED = 0,
        OMAP_DSS_DISPLAY_ACTIVE,
@@ -285,6 +280,7 @@ struct omap_dss_writeback_info {
 
 struct omapdss_dsi_ops {
        int (*update)(struct omap_dss_device *dssdev);
+       bool (*is_video_mode)(struct omap_dss_device *dssdev);
 
        /* legacy API used by omapdss panels */
        int (*set_config)(struct omap_dss_device *dssdev,
@@ -357,8 +353,6 @@ struct omap_dss_device {
        unsigned long ops_flags;
        u32 bus_flags;
 
-       enum omap_display_caps caps;
-
        enum omap_dss_display_state state;
 
        /* OMAP DSS output specific fields */
index 82c08af..1c7184b 100644 (file)
@@ -531,8 +531,7 @@ static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc,
         * valid DISPC mode. DSI will calculate and configure the
         * proper DISPC mode later.
         */
-       if (omap_crtc->pipe->output->next == NULL ||
-           omap_crtc->pipe->output->next->type != OMAP_DISPLAY_TYPE_DSI) {
+       if (omap_crtc->pipe->output->type != OMAP_DISPLAY_TYPE_DSI) {
                r = priv->dispc_ops->mgr_check_timings(priv->dispc,
                                                       omap_crtc->channel,
                                                       &vm);
@@ -584,17 +583,17 @@ static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
 static bool omap_crtc_is_manually_updated(struct drm_crtc *crtc)
 {
        struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
-       struct omap_dss_device *display = omap_crtc->pipe->output->next;
+       struct omap_dss_device *dssdev = omap_crtc->pipe->output;
 
-       if (!display)
+       if (dssdev->type != OMAP_DISPLAY_TYPE_DSI ||
+           !dssdev->ops->dsi.is_video_mode)
                return false;
 
-       if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
-               DBG("detected manually updated display!");
-               return true;
-       }
+       if (dssdev->ops->dsi.is_video_mode(dssdev))
+               return false;
 
-       return false;
+       DBG("detected manually updated display!");
+       return true;
 }
 
 static int omap_crtc_atomic_check(struct drm_crtc *crtc,