summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8978fba)
raw | patch | inline | side by side (parent: 8978fba)
author | Amarinder Bindra <a-bindra@ti.com> | |
Tue, 24 Sep 2013 14:50:36 +0000 (20:20 +0530) | ||
committer | Amarinder Bindra <a-bindra@ti.com> | |
Thu, 3 Oct 2013 14:01:06 +0000 (19:31 +0530) |
Added the support for deleting the devices and the file descriptor
used by the kms display. Also added the reference counting for the
displays to check before deleting the global file descriptor which
is used by all the displays.
Signed-off-by: Amarinder Bindra <a-bindra@ti.com>
used by the kms display. Also added the reference counting for the
displays to check before deleting the global file descriptor which
is used by all the displays.
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 ff4ca7d8eb081a01b152624fc10b0088f698aefd..74b59fd28b955e56cf6a3579fa9efb09b37a975e 100644 (file)
--- a/util/display-kms.c
+++ b/util/display-kms.c
static int global_fd = 0;
static uint32_t used_planes = 0;
+static int ndisplays = 0;
static struct omap_bo *
alloc_bo(struct display *disp, uint32_t bpp, uint32_t width, uint32_t height,
static void
close_kms(struct display *disp)
{
+ omap_device_del(disp->dev);
+ disp->dev = NULL;
+ if (used_planes) {
+ used_planes >>= 1;
+ }
+ if (--ndisplays == 0) {
+ close(global_fd);
+ }
}
static void
}
disp->fd = global_fd;
+ ndisplays++; /* increment the number of displays counter */
disp->dev = omap_device_new(disp->fd);
if (!disp->dev) {