dual display fix
authorAmarinder Bindra <a-bindra@ti.com>
Sun, 22 Sep 2013 09:31:09 +0000 (15:01 +0530)
committerAmarinder Bindra <a-bindra@ti.com>
Sun, 22 Sep 2013 09:31:09 +0000 (15:01 +0530)
Signed-off-by: Amarinder Bindra <a-bindra@ti.com>
util/display-kms.c

index 8fc38a1d6820f5160c973618727d563191feb76f..4265090450711b81dd0e9e36a7e12a7dfb5a0e51 100644 (file)
@@ -337,6 +337,7 @@ post_vid_buffer(struct display *disp, struct buffer *buf,
        struct buffer_kms *buf_kms = to_buffer_kms(buf);
        int ret = 0;
        uint32_t i, j;
+       int busy_planes = 0;
 
        /* ensure we have the overlay setup: */
        for (i = 0; i < disp_kms->connectors_count; i++) {
@@ -350,13 +351,14 @@ post_vid_buffer(struct display *disp, struct buffer *buf,
 
                if (! disp_kms->ovr[i]) {
 
-                       for (j = 0; j < disp_kms->plane_resources->count_planes; j++) {
+                       for (j = 0; j + used_planes < disp_kms->plane_resources->count_planes; j++) {
                                drmModePlane *ovr = drmModeGetPlane(disp->fd,
-                                               disp_kms->plane_resources->planes[j]);
+                                               disp_kms->plane_resources->planes[j + busy_planes]);
                                if ((ovr->possible_crtcs & (1 << connector->pipe)) &&
                                                !(used_planes & (1 << j))) {
                                        disp_kms->ovr[i] = ovr;
                                        used_planes |= (1 << j);
+printf("\nused_planes = %d\n", used_planes);
                                        break;
                                }
                        }