diff options
author | Amine Najahi <anajahi@codeaurora.org> | 2020-07-07 18:06:59 -0400 |
---|---|---|
committer | Prashant Beniwal <pbeniw@codeaurora.org> | 2020-10-30 12:46:51 +0530 |
commit | 3d3dabb740f7071b11e1a2cb56f88940f4741dfb (patch) | |
tree | 1e0d7534b6bd7eade11cd61f7155a52baea68c2d /minui | |
parent | 5e24d39570d31249c869c86348c4cbfa91ccd531 (diff) |
Add support for 4 layer mixer staging logic
Currently plane staging logic assumes that only
2 planes (L/R) are required to drive the display.
When a 4LM topology is used, 4 adjacent planes are
needed to cover wider display resolutions.
This changes offsets plane src_x and dest_x coordinates
based on plane index and removes L/R assumption. It also
adds 4LM and VDC based topologies.
CRs-Fixed: 2672665
Test: boot-up test on 2LM and 4LM topologies
Change-Id: If33e9b22b5545e2187ab614eed390dfe09af56a9
Diffstat (limited to 'minui')
-rw-r--r-- | minui/graphics_drm.cpp | 33 | ||||
-rw-r--r-- | minui/graphics_drm.h | 4 |
2 files changed, 24 insertions, 13 deletions
diff --git a/minui/graphics_drm.cpp b/minui/graphics_drm.cpp index 3fee5a11..7deb5c01 100644 --- a/minui/graphics_drm.cpp +++ b/minui/graphics_drm.cpp @@ -92,28 +92,41 @@ * @SDE_RM_TOPOLOGY_NONE: No topology in use currently * @SDE_RM_TOPOLOGY_SINGLEPIPE: 1 LM, 1 PP, 1 INTF/WB * @SDE_RM_TOPOLOGY_SINGLEPIPE_DSC: 1 LM, 1 DSC, 1 PP, 1 INTF/WB + * @SDE_RM_TOPOLOGY_SINGLEPIPE_VDC: 1 LM, 1 VDC, 1 PP, 1 INTF/WB * @SDE_RM_TOPOLOGY_DUALPIPE: 2 LM, 2 PP, 2 INTF/WB * @SDE_RM_TOPOLOGY_DUALPIPE_DSC: 2 LM, 2 DSC, 2 PP, 2 INTF/WB * @SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE: 2 LM, 2 PP, 3DMux, 1 INTF/WB * @SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC: 2 LM, 2 PP, 3DMux, 1 DSC, 1 INTF/WB + * @SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_VDC: 2 LM, 2 PP, 3DMux, 1 VDC, 1 INTF/WB * @SDE_RM_TOPOLOGY_DUALPIPE_DSCMERGE: 2 LM, 2 PP, 2 DSC Merge, 1 INTF/WB * @SDE_RM_TOPOLOGY_PPSPLIT: 1 LM, 2 PPs, 2 INTF/WB + * @SDE_RM_TOPOLOGY_QUADPIPE_3DMERGE 4 LM, 4 PP, 3DMux, 2 INTF + * @SDE_RM_TOPOLOGY_QUADPIPE_3DMERGE_DSC 4 LM, 4 PP, 3DMux, 3 DSC, 2 INTF + * @SDE_RM_TOPOLOGY_QUADPIPE_DSCMERE 4 LM, 4 PP, 4 DSC Merge, 2 INTF + * @SDE_RM_TOPOLOGY_QUADPIPE_DSC4HSMERGE 4 LM, 4 PP, 4 DSC Merge, 1 INTF */ static uint32_t get_lm_number(const std::string &topology) { if (topology == "sde_singlepipe") return 1; if (topology == "sde_singlepipe_dsc") return 1; + if (topology == "sde_singlepipe_vdc") return 1; if (topology == "sde_dualpipe") return 2; if (topology == "sde_dualpipe_dsc") return 2; + if (topology == "sde_dualpipe_vdc") return 2; if (topology == "sde_dualpipemerge") return 2; if (topology == "sde_dualpipemerge_dsc") return 2; + if (topology == "sde_dualpipemerge_vdc") return 2; if (topology == "sde_dualpipe_dscmerge") return 2; if (topology == "sde_ppsplit") return 1; - return 2; + if (topology == "sde_quadpipemerge") return 4; + if (topology == "sde_quadpipe_3dmerge_dsc") return 4; + if (topology == "sde_quadpipe_dscmerge") return 4; + if (topology == "sde_quadpipe_dsc4hsmerge") return 4; + return DEFAULT_NUM_LMS; } static uint32_t get_topology_lm_number(int fd, uint32_t blob_id) { - uint32_t num_lm = 2; + uint32_t num_lm = DEFAULT_NUM_LMS; drmModePropertyBlobRes *blob = drmModeGetPropertyBlob(fd, blob_id); if (!blob) { @@ -128,6 +141,7 @@ static uint32_t get_topology_lm_number(int fd, uint32_t blob_id) { while (std::getline(stream, line)) { if (line.find(topology) != std::string::npos) { num_lm = get_lm_number(std::string(line, topology.length())); + break; } } @@ -187,14 +201,8 @@ int MinuiBackendDrm::AtomicPopulatePlane(int plane, drmModeAtomicReqPtr atomic_r crtc_y = 0; crtc_w = width/number_of_lms; crtc_h = height; - - if (plane == Left) { - src_x = 0; - crtc_x = 0; - } else { - src_x = width/number_of_lms; - crtc_x = width/number_of_lms; - } + src_x = (width/number_of_lms) * plane; + crtc_x = (width/number_of_lms) * plane; if (atomic_add_prop_to_plane(plane_res, atomic_req, plane_res[plane].plane->plane_id, "FB_ID", @@ -583,7 +591,7 @@ GRSurface* MinuiBackendDrm::Init() { drmModeRes* res = nullptr; drm_fd = -1; - number_of_lms = 2; + number_of_lms = DEFAULT_NUM_LMS; /* Consider DRM devices in order. */ for (int i = 0; i < DRM_MAX_MINOR; i++) { auto dev_name = android::base::StringPrintf(DRM_DEV_NAME, DRM_DIR_NAME, i); @@ -694,6 +702,9 @@ GRSurface* MinuiBackendDrm::Init() { conn_res.props_info[j] = drmModeGetProperty(drm_fd, conn_res.props->props[j]); + /* Get preferred mode information and extract the + * number of layer mixers needed from the topology name. + */ if (!strcmp(conn_res.props_info[j]->name, "mode_properties")) { number_of_lms = get_topology_lm_number(drm_fd, conn_res.props->prop_values[j]); printf("number of lms in topology %d\n", number_of_lms); diff --git a/minui/graphics_drm.h b/minui/graphics_drm.h index bda2d570..d0482831 100644 --- a/minui/graphics_drm.h +++ b/minui/graphics_drm.h @@ -27,7 +27,8 @@ #include "minui/minui.h" #define NUM_MAIN 1 -#define NUM_PLANES 2 +#define NUM_PLANES 4 +#define DEFAULT_NUM_LMS 2 struct Crtc { drmModeObjectProperties *props; @@ -81,7 +82,6 @@ class MinuiBackendDrm : public MinuiBackend { void Blank(bool) override; private: - enum screen_side{Left, Right}; int DrmDisableCrtc(drmModeAtomicReqPtr atomic_req); int DrmEnableCrtc(drmModeAtomicReqPtr atomic_req); void DisableNonMainCrtcs(int fd, drmModeRes* resources, drmModeCrtc* main_crtc); |