summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGowtham Tammana <g-tammana@ti.com>2017-01-18 16:33:41 -0600
committerGowtham Tammana <g-tammana@ti.com>2017-01-20 12:32:37 -0500
commite56836d72a854065210283bb611c597f897fb322 (patch)
treebf3000a1d0e85518c1234fb6499dc95eb802e948
parent8f464d5bf5b57ca573ec3c47b48e5d37ab7ee203 (diff)
downloaddra7xx-e56836d72a854065210283bb611c597f897fb322.tar.gz
hwc: Query available pipes from drm
Query available pipes directly from drm instead of relying on a predefined macro. Change-Id: I1ba9886515913843766c2b56dd87bb90e038f2a3 Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
-rw-r--r--hwcomposer/display.c7
-rw-r--r--hwcomposer/hwc.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/hwcomposer/display.c b/hwcomposer/display.c
index 8b459c6..dab97f1 100644
--- a/hwcomposer/display.c
+++ b/hwcomposer/display.c
@@ -1674,6 +1674,13 @@ int display_assign_pipes_for_composition(display_t *display, int disp)
return -EINVAL;
}
+ if (!disp) {
+ /* Total available DSS overlays, drm reports total number of
+ * planes not just for individual display*/
+ hwc_dev->num_ovls = planes_res->count_planes;
+ ALOGI("Number of available overlays: %d\n", hwc_dev->num_ovls);
+ }
+
for (i = 0; i < planes_res->count_planes; i++) {
plane = drmModeGetPlane(hwc_dev->drm_fd, planes_res->planes[i]);
diff --git a/hwcomposer/hwc.c b/hwcomposer/hwc.c
index 5a1600f..a1be62e 100644
--- a/hwcomposer/hwc.c
+++ b/hwcomposer/hwc.c
@@ -88,7 +88,7 @@ static void reserve_overlays_for_displays(omap_hwc_device_t *hwc_dev)
display_t *hdmi_display = hwc_dev->displays[HWC_DISPLAY_EXTERNAL];
composition_t *primary_comp = &primary_display->composition;
- uint32_t max_pipes = DSS_AVAILABLE_PIPES;
+ uint32_t max_pipes;
uint32_t avail_gfx_pipes = DSS_NONSCALING_PIPES;
/* TODO: omapdrm currently assigns GFX and VID1 pipes to primary and HDMI
@@ -100,6 +100,8 @@ static void reserve_overlays_for_displays(omap_hwc_device_t *hwc_dev)
exit(-1);
}
+ max_pipes = hwc_dev->num_ovls;
+ /* Two are currently assigned as primary planes */
max_pipes -= 2;
avail_gfx_pipes = 0;
@@ -161,7 +163,7 @@ static void hwc_check_dss_composition(omap_hwc_device_t *hwc_dev, int disp)
if (list->numHwLayers == 1)
return;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < DSS_AVAILABLE_PIPES; i++)
reset_drm_plane(&comp->plane_info[i]);
if (can_dss_render_all_layers(hwc_dev, disp)) {