sdm: dedicated pipelines per display

Pass possible_crtcs and crtc_index to SDM to support
dedicating pipelines to a specific display
during pipe allocation.

Change-Id: Id27a5c6a06dc40912bfeb5ebad9fe95eac35f072
Signed-off-by: Camus Wong <camusw@codeaurora.org>
diff --git a/libdrmutils/drm_interface.h b/libdrmutils/drm_interface.h
index 5620164..c22ed6f 100644
--- a/libdrmutils/drm_interface.h
+++ b/libdrmutils/drm_interface.h
@@ -34,6 +34,7 @@
 #include <string>
 #include <utility>
 #include <vector>
+#include <bitset>
 
 #include "xf86drm.h"
 #include "xf86drmMode.h"
@@ -551,6 +552,8 @@
   uint32_t dgm_csc_version = 0;  // csc used with DMA
   std::map<DRMTonemapLutType, uint32_t> tonemap_lut_version_map = {};
   bool block_sec_ui = false;
+  // Allow all planes to be usable on all displays by default
+  std::bitset<32> hw_block_mask = std::bitset<32>().set();
 };
 
 // All DRM Planes as map<Plane_id , plane_type_info> listed from highest to lowest priority
diff --git a/sdm/include/private/hw_info_types.h b/sdm/include/private/hw_info_types.h
index a723ce6..f1dfc0d 100644
--- a/sdm/include/private/hw_info_types.h
+++ b/sdm/include/private/hw_info_types.h
@@ -206,6 +206,8 @@
   uint32_t dgm_csc_version = 0;
   std::map<HWToneMapLut, uint32_t> tm_lut_version_map = {};
   bool block_sec_ui = false;
+  // Allow all pipelines to be usable on all displays by default
+  std::bitset<32> hw_block_mask = std::bitset<32>().set();
 };
 
 struct HWRotatorInfo {
@@ -743,6 +745,7 @@
   uint32_t height = 0;                                 // Layer mixer height
   uint32_t split_left = 0;
   LayerBufferFormat output_format = kFormatRGB101010;  // Layer mixer output format
+  uint32_t mixer_index = 0;
 
   bool operator !=(const HWMixerAttributes &mixer_attributes) {
     return ((width != mixer_attributes.width) ||
diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp
index a9531c7..c5cc2a9 100644
--- a/sdm/libs/core/drm/hw_device_drm.cpp
+++ b/sdm/libs/core/drm/hw_device_drm.cpp
@@ -1937,6 +1937,7 @@
   mixer_attributes_.split_left = display_attributes_[index].is_device_split
                                      ? hw_panel_info_.split_info.left_split
                                      : mixer_attributes_.width;
+  mixer_attributes_.mixer_index = token_.crtc_index;
   DLOGI("Mixer WxH %dx%d for %s", mixer_attributes_.width, mixer_attributes_.height, device_name_);
   update_mode_ = true;
 }
diff --git a/sdm/libs/core/drm/hw_info_drm.cpp b/sdm/libs/core/drm/hw_info_drm.cpp
index eb8b38e..11a05ba 100644
--- a/sdm/libs/core/drm/hw_info_drm.cpp
+++ b/sdm/libs/core/drm/hw_info_drm.cpp
@@ -418,9 +418,10 @@
     pipe_caps.id = pipe_obj.first;
     pipe_caps.master_pipe_id = pipe_obj.second.master_plane_id;
     pipe_caps.block_sec_ui = pipe_obj.second.block_sec_ui;
-    DLOGI("Adding %s Pipe : Id %d, master_pipe_id : Id %d block_sec_ui: %d",
+    pipe_caps.hw_block_mask = pipe_obj.second.hw_block_mask;
+    DLOGI("Adding %s Pipe : Id %d, master_pipe_id : Id %d block_sec_ui: %d hw_block_mask: 0x%x",
           name.c_str(), pipe_obj.first, pipe_obj.second.master_plane_id,
-          pipe_obj.second.block_sec_ui);
+          pipe_obj.second.block_sec_ui, pipe_obj.second.hw_block_mask.to_ulong());
     pipe_caps.inverse_pma = pipe_obj.second.inverse_pma;
     pipe_caps.dgm_csc_version = pipe_obj.second.dgm_csc_version;
     // disable src tonemap feature if its disabled using property.