msm:disp:dpu1: add mixer selection for display topology
authorKalyan Thota <kalyan_t@codeaurora.org>
Mon, 25 Nov 2019 11:59:29 +0000 (17:29 +0530)
committerRob Clark <robdclark@chromium.org>
Thu, 2 Jan 2020 23:46:53 +0000 (15:46 -0800)
mixer selection in the display topology is based on multiple
factors
1) mixers available in the hw
2) interfaces to be enabled
3) merge capability

change will pickup mixer as per the topology need.

Signed-off-by: Kalyan Thota <kalyan_t@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h

index f96e142c43611c9a72c7a7bbcaeb8aa333019a64..8a6e0718bc17a6a603180e57dc324aa71cc73151 100644 (file)
@@ -58,7 +58,7 @@
 
 #define IDLE_SHORT_TIMEOUT     1
 
-#define MAX_VDISPLAY_SPLIT 1080
+#define MAX_HDISPLAY_SPLIT 1080
 
 /* timeout in frames waiting for frame done */
 #define DPU_ENCODER_FRAME_DONE_TIMEOUT_FRAMES 5
@@ -534,8 +534,23 @@ static struct msm_display_topology dpu_encoder_get_topology(
                if (dpu_enc->phys_encs[i])
                        intf_count++;
 
-       /* User split topology for width > 1080 */
-       topology.num_lm = (mode->vdisplay > MAX_VDISPLAY_SPLIT) ? 2 : 1;
+       /* Datapath topology selection
+        *
+        * Dual display
+        * 2 LM, 2 INTF ( Split display using 2 interfaces)
+        *
+        * Single display
+        * 1 LM, 1 INTF
+        * 2 LM, 1 INTF (stream merge to support high resolution interfaces)
+        *
+        */
+       if (intf_count == 2)
+               topology.num_lm = 2;
+       else if (!dpu_kms->catalog->caps->has_3d_merge)
+               topology.num_lm = 1;
+       else
+               topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
+
        topology.num_enc = 0;
        topology.num_intf = intf_count;
 
index e4880a1c0b0795916d544e62c299d27617011c04..69de2c3e965050e7b1fa349a4b2f5ec3cb27fe83 100644 (file)
@@ -67,6 +67,7 @@ static const struct dpu_caps sdm845_dpu_caps = {
        .has_src_split = true,
        .has_dim_layer = true,
        .has_idle_pc = true,
+       .has_3d_merge = true,
 };
 
 static const struct dpu_caps sc7180_dpu_caps = {
index e052360689a5a57deb0c83cb94334c5e5030e291..8ff532a6f0cc72a4e8b84b07a68d64643daab667 100644 (file)
@@ -287,6 +287,7 @@ struct dpu_qos_lut_tbl {
  * @has_src_split      source split feature status
  * @has_dim_layer      dim layer feature status
  * @has_idle_pc        indicate if idle power collapse feature is supported
+ * @has_3d_merge       indicate if 3D merge is supported
  */
 struct dpu_caps {
        u32 max_mixer_width;
@@ -297,6 +298,7 @@ struct dpu_caps {
        bool has_src_split;
        bool has_dim_layer;
        bool has_idle_pc;
+       bool has_3d_merge;
 };
 
 /**