drm/msm/dsi: Split mode_flags out of msm_dsi_host_get_panel() [Linux 5.3]

This Linux kernel change "drm/msm/dsi: Split mode_flags out of msm_dsi_host_get_panel()" is included in the Linux 5.3 release. This change is authored by Sean Paul <seanpaul [at] chromium.org> on Mon Jun 17 16:12:52 2019 -0400. The commit for this change in Linux stable tree is e3a91f8 (patch).

drm/msm/dsi: Split mode_flags out of msm_dsi_host_get_panel()

We use the flags in more places than just get_panel, so split them out
into a separate function.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190617201301.133275-4-sean@poorly.run

There are 26 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/gpu/drm/msm/dsi/dsi.h         |  4 ++--
 drivers/gpu/drm/msm/dsi/dsi_host.c    | 15 ++++++---------
 drivers/gpu/drm/msm/dsi/dsi_manager.c |  7 ++++---
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
index 9c6b31c..8bdc48c 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.h
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
@@ -169,8 +169,8 @@ int msm_dsi_host_power_on(struct mipi_dsi_host *host,
 int msm_dsi_host_power_off(struct mipi_dsi_host *host);
 int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host,
                  const struct drm_display_mode *mode);
-struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host,
-                   unsigned long *panel_flags);
+struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host);
+unsigned long msm_dsi_host_get_mode_flags(struct mipi_dsi_host *host);
 struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host);
 int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer);
 void msm_dsi_host_unregister(struct mipi_dsi_host *host);
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index dc16067..2594ecf 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -2442,17 +2442,14 @@ int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host,
    return 0;
 }

-struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host,
-               unsigned long *panel_flags)
+struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host)
 {
-   struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
-   struct drm_panel *panel;
-
-   panel = of_drm_find_panel(msm_host->device_node);
-   if (panel_flags)
-           *panel_flags = msm_host->mode_flags;
+   return of_drm_find_panel(to_msm_dsi_host(host)->device_node);
+}

-   return panel;
+unsigned long msm_dsi_host_get_mode_flags(struct mipi_dsi_host *host)
+{
+   return to_msm_dsi_host(host)->mode_flags;
 }

 struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 72ac869..47b349a 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -244,8 +244,9 @@ static enum drm_connector_status dsi_mgr_connector_detect(

    DBG("id=%d", id);
    if (!msm_dsi->panel) {
-       msm_dsi->panel = msm_dsi_host_get_panel(msm_dsi->host,
-                       &msm_dsi->device_flags);
+       msm_dsi->panel = msm_dsi_host_get_panel(msm_dsi->host);
+       msm_dsi->device_flags = msm_dsi_host_get_mode_flags(
+                       msm_dsi->host);

        /* There is only 1 panel in the global panel list
         * for dual DSI mode. Therefore slave dsi should get
@@ -255,7 +256,7 @@ static enum drm_connector_status dsi_mgr_connector_detect(
        if (!msm_dsi->panel && IS_DUAL_DSI() &&
            !IS_MASTER_DSI_LINK(id) && other_dsi)
            msm_dsi->panel = msm_dsi_host_get_panel(
-                   other_dsi->host, NULL);
+                       other_dsi->host);

        if (msm_dsi->panel && kms->funcs->set_encoder_mode) {

Leave a Reply

Your email address will not be published. Required fields are marked *