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);
}
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);
/*
*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;
-}