r600g: get winsys_handle using radeon_winsys
authorMarek Olšák <maraeo@gmail.com>
Thu, 4 Aug 2011 01:07:42 +0000 (03:07 +0200)
committerMarek Olšák <maraeo@gmail.com>
Tue, 16 Aug 2011 07:15:11 +0000 (09:15 +0200)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/winsys/r600/drm/r600_bo.c
src/gallium/winsys/r600/drm/r600_priv.h
src/gallium/winsys/r600/drm/radeon_bo.c

index 0e41a1709eeea6f8d5a06d2106d3a7a6dbc43c9d..9e2c08ab56fc9b705a63fd1e5581faed6eb8dd6e 100644 (file)
@@ -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);
 }
index 036468e3a31f14fcf1e7a6b1e2162adf999b4fc0..0efb02aadae746435c1cf14c7dced119b18bdc44 100644 (file)
@@ -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);
 
 /*
index 536bbe45bffcee1ede04e51682c9e6f976b61c4e..9d351480d59b89777de00870275655332e02fb56 100644 (file)
@@ -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;
-}