From 9b8449ae909e15ea9ed07838b655eba81e9f2f95 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 4 Apr 2014 20:22:55 +0200 Subject: [PATCH] winsys/radeon: unify radeon_bo::flink and radeon_bo::name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Both contained the GEM flink name. Reviewed-by: Michel Dänzer Reviewed-by: Christian König --- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 19 +++++++++---------- src/gallium/winsys/radeon/drm/radeon_drm_bo.h | 5 +---- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index e593af231a9..34f26bb4e0c 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -317,9 +317,9 @@ static void radeon_bo_destroy(struct pb_buffer *_buf) pipe_mutex_lock(bo->mgr->bo_handles_mutex); util_hash_table_remove(bo->mgr->bo_handles, (void*)(uintptr_t)bo->handle); - if (bo->name) { + if (bo->flink_name) { util_hash_table_remove(bo->mgr->bo_names, - (void*)(uintptr_t)bo->name); + (void*)(uintptr_t)bo->flink_name); } pipe_mutex_unlock(bo->mgr->bo_handles_mutex); @@ -893,7 +893,7 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws, } handle = open_arg.handle; size = open_arg.size; - bo->name = whandle->handle; + bo->flink_name = whandle->handle; } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) { size = lseek(whandle->handle, 0, SEEK_END); /* @@ -920,8 +920,8 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws, bo->va = 0; pipe_mutex_init(bo->map_mutex); - if (bo->name) - util_hash_table_set(mgr->bo_names, (void*)(uintptr_t)bo->name, bo); + if (bo->flink_name) + util_hash_table_set(mgr->bo_names, (void*)(uintptr_t)bo->flink_name, bo); util_hash_table_set(mgr->bo_handles, (void*)(uintptr_t)bo->handle, bo); @@ -989,21 +989,20 @@ static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer, memset(&flink, 0, sizeof(flink)); if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { - if (!bo->flinked) { + if (!bo->flink_name) { flink.handle = bo->handle; if (ioctl(bo->rws->fd, DRM_IOCTL_GEM_FLINK, &flink)) { return FALSE; } - bo->flinked = TRUE; - bo->flink = flink.name; + bo->flink_name = flink.name; pipe_mutex_lock(bo->mgr->bo_handles_mutex); - util_hash_table_set(bo->mgr->bo_names, (void*)(uintptr_t)bo->flink, bo); + util_hash_table_set(bo->mgr->bo_names, (void*)(uintptr_t)bo->flink_name, bo); pipe_mutex_unlock(bo->mgr->bo_handles_mutex); } - whandle->handle = bo->flink; + whandle->handle = bo->flink_name; } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { whandle->handle = bo->handle; } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) { diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h index 5536bc1022f..f5b122f17c7 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h @@ -54,7 +54,7 @@ struct radeon_bo { pipe_mutex map_mutex; uint32_t handle; - uint32_t name; + uint32_t flink_name; uint64_t va; enum radeon_bo_domain initial_domain; @@ -64,9 +64,6 @@ struct radeon_bo { /* how many command streams, which are being emitted in a separate * thread, is this bo referenced in? */ int num_active_ioctls; - - boolean flinked; - uint32_t flink; }; struct pb_manager *radeon_bomgr_create(struct radeon_drm_winsys *rws); -- 2.30.2