From 5a3324638b3abb19b30e91ea4dfdd6e1764d6340 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 28 Feb 2014 09:24:39 -0500 Subject: freedreno: simplify device creation Signed-off-by: Rob Clark --- freedreno/freedreno_device.c | 27 +-------------------------- freedreno/kgsl/kgsl_bo.c | 1 - 2 files changed, 1 insertion(+), 27 deletions(-) (limited to 'freedreno') diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c index 23e086bb..532e65bb 100644 --- a/freedreno/freedreno_device.c +++ b/freedreno/freedreno_device.c @@ -34,7 +34,6 @@ #include "freedreno_priv.h" static pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER; -static void * dev_table; struct fd_device * kgsl_device_new(int fd); struct fd_device * msm_device_new(int fd); @@ -77,7 +76,7 @@ init_cache_buckets(struct fd_device *dev) } } -static struct fd_device * fd_device_new_impl(int fd) +struct fd_device * fd_device_new(int fd) { struct fd_device *dev; drmVersionPtr version; @@ -112,29 +111,6 @@ static struct fd_device * fd_device_new_impl(int fd) return dev; } -struct fd_device * fd_device_new(int fd) -{ - struct fd_device *dev = NULL; - int key = fd; - - pthread_mutex_lock(&table_lock); - - if (!dev_table) - dev_table = drmHashCreate(); - - if (drmHashLookup(dev_table, key, (void **)&dev)) { - dev = fd_device_new_impl(fd); - if (dev) - drmHashInsert(dev_table, key, dev); - } else { - dev = fd_device_ref(dev); - } - - pthread_mutex_unlock(&table_lock); - - return dev; -} - /* like fd_device_new() but creates it's own private dup() of the fd * which is close()d when the device is finalized. */ @@ -156,7 +132,6 @@ static void fd_device_del_impl(struct fd_device *dev) fd_cleanup_bo_cache(dev, 0); drmHashDestroy(dev->handle_table); drmHashDestroy(dev->name_table); - drmHashDelete(dev_table, dev->fd); if (dev->closefd) close(dev->fd); dev->funcs->destroy(dev); diff --git a/freedreno/kgsl/kgsl_bo.c b/freedreno/kgsl/kgsl_bo.c index 76d1f277..dd7b612d 100644 --- a/freedreno/kgsl/kgsl_bo.c +++ b/freedreno/kgsl/kgsl_bo.c @@ -222,7 +222,6 @@ fail: return NULL; } - uint32_t kgsl_bo_gpuaddr(struct kgsl_bo *kgsl_bo, uint32_t offset) { struct fd_bo *bo = &kgsl_bo->base; -- cgit v1.2.3