From ecfcf25387284f01131eeaf9ec3f72bc481f3cfe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 4 Aug 2011 03:07:42 +0200 Subject: [PATCH] r600g: get winsys_handle using radeon_winsys Reviewed-by: Alex Deucher --- src/gallium/winsys/r600/drm/r600_bo.c | 15 +-------------- src/gallium/winsys/r600/drm/r600_priv.h | 3 --- src/gallium/winsys/r600/drm/radeon_bo.c | 16 ---------------- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c index 0e41a1709ee..9e2c08ab56f 100644 --- a/src/gallium/winsys/r600/drm/r600_bo.c +++ b/src/gallium/winsys/r600/drm/r600_bo.c @@ -160,18 +160,5 @@ void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo) boolean r600_bo_get_winsys_handle(struct radeon *radeon, struct r600_bo *bo, unsigned stride, struct winsys_handle *whandle) { - whandle->stride = stride; - switch(whandle->type) { - case DRM_API_HANDLE_TYPE_KMS: - whandle->handle = bo->bo->handle; - break; - case DRM_API_HANDLE_TYPE_SHARED: - if (radeon_bo_get_name(radeon, bo->bo, &whandle->handle)) - return FALSE; - break; - default: - return FALSE; - } - - return TRUE; + return radeon->ws->buffer_get_handle(bo->bo->buf, stride, whandle); } diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h index 036468e3a31..0efb02aadae 100644 --- a/src/gallium/winsys/r600/drm/r600_priv.h +++ b/src/gallium/winsys/r600/drm/r600_priv.h @@ -98,9 +98,6 @@ int radeon_bo_fencelist(struct radeon *radeon, struct radeon_bo **bolist, uint32 int radeon_bo_get_tiling_flags(struct radeon *radeon, struct radeon_bo *bo, uint32_t *tiling_flags); -int radeon_bo_get_name(struct radeon *radeon, - struct radeon_bo *bo, - uint32_t *name); int radeon_bo_fixed_map(struct radeon *radeon, struct radeon_bo *bo); /* diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c index 536bbe45bff..9d351480d59 100644 --- a/src/gallium/winsys/r600/drm/radeon_bo.c +++ b/src/gallium/winsys/r600/drm/radeon_bo.c @@ -165,19 +165,3 @@ int radeon_bo_get_tiling_flags(struct radeon *radeon, *tiling_flags = args.tiling_flags; return ret; } - -int radeon_bo_get_name(struct radeon *radeon, - struct radeon_bo *bo, - uint32_t *name) -{ - struct drm_gem_flink flink; - int ret; - - flink.handle = bo->handle; - ret = drmIoctl(radeon->info.fd, DRM_IOCTL_GEM_FLINK, &flink); - if (ret) - return ret; - - *name = flink.name; - return ret; -} -- 2.30.2