summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon/drm
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-04-04 20:22:55 +0200
committerMarek Olšák <[email protected]>2014-04-10 20:50:17 +0200
commit9b8449ae909e15ea9ed07838b655eba81e9f2f95 (patch)
tree349de14c9e9354001ffac06e4ec08f0f1bd8e943 /src/gallium/winsys/radeon/drm
parent34564c875357a5d0a1f103f29949eafc2f8e1b35 (diff)
winsys/radeon: unify radeon_bo::flink and radeon_bo::name
Both contained the GEM flink name. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon/drm')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c19
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.h5
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);