summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2bb4841)
raw | patch | inline | side by side (parent: 2bb4841)
author | Amarinder Bindra <a-bindra@ti.com> | |
Tue, 24 Sep 2013 14:14:34 +0000 (19:44 +0530) | ||
committer | Amarinder Bindra <a-bindra@ti.com> | |
Thu, 3 Oct 2013 14:01:01 +0000 (19:31 +0530) |
For dual display, a single file descriptor or fd could be used for by the two
displays so that it has master permissions for display planes, hence using a
single global file descriptor for kms display.
Adding the mechanism where the second display or connector uses a different
plane.
Signed-off-by: Amarinder Bindra <a-bindra@ti.com>
displays so that it has master permissions for display planes, hence using a
single global file descriptor for kms display.
Adding the mechanism where the second display or connector uses a different
plane.
Signed-off-by: Amarinder Bindra <a-bindra@ti.com>
util/display-kms.c | patch | blob | history |
diff --git a/util/display-kms.c b/util/display-kms.c
index 8fc38a1d6820f5160c973618727d563191feb76f..ff4ca7d8eb081a01b152624fc10b0088f698aefd 100644 (file)
--- a/util/display-kms.c
+++ b/util/display-kms.c
uint32_t fb_id;
};
+static int global_fd = 0;
+static uint32_t used_planes = 0;
+
static struct omap_bo *
alloc_bo(struct display *disp, uint32_t bpp, uint32_t width, uint32_t height,
uint32_t *bo_handle, uint32_t *pitch)
/* ensure we have the overlay setup: */
for (i = 0; i < disp_kms->connectors_count; i++) {
struct connector *connector = &disp_kms->connector[i];
- uint32_t used_planes = 0;
drmModeModeInfo *mode = connector->mode;
if (! mode) {
if (! disp_kms->ovr[i]) {
for (j = 0; j < disp_kms->plane_resources->count_planes; j++) {
+ if (used_planes & (1 << j)) {
+ continue;
+ }
drmModePlane *ovr = drmModeGetPlane(disp->fd,
disp_kms->plane_resources->planes[j]);
- if ((ovr->possible_crtcs & (1 << connector->pipe)) &&
- !(used_planes & (1 << j))) {
+ if (ovr->possible_crtcs & (1 << connector->pipe)) {
disp_kms->ovr[i] = ovr;
used_planes |= (1 << j);
break;
}
disp = &disp_kms->base;
- disp->fd = drmOpen("omapdrm", NULL);
- if (disp->fd < 0) {
- ERROR("could not open drm device: %s (%d)", strerror(errno), errno);
- goto fail;
+ if (!global_fd) {
+ global_fd = drmOpen("omapdrm", NULL);
+ if (global_fd < 0) {
+ ERROR("could not open drm device: %s (%d)", strerror(errno), errno);
+ goto fail;
+ }
}
+ disp->fd = global_fd;
+
disp->dev = omap_device_new(disp->fd);
if (!disp->dev) {
ERROR("couldn't create device");