[Mesa-dev] [PATCHv2 6/9] gallium: rename DRM_API_HANDLE_TYPE* WINSYS_HANDLE_TYPE*

Marc-André Lureau marcandre.lureau at gmail.com
Mon Jun 15 06:34:12 PDT 2015


The DRM prefix seems unnecessary as other kind of handle could be used.
---
 src/gallium/auxiliary/vl/vl_winsys_dri.c          |  2 +-
 src/gallium/drivers/freedreno/freedreno_screen.c  | 12 ++++++------
 src/gallium/drivers/nouveau/nouveau_screen.c      | 12 ++++++------
 src/gallium/drivers/vc4/vc4_screen.c              | 10 +++++-----
 src/gallium/include/state_tracker/winsys_handle.h |  6 +++---
 src/gallium/state_trackers/dri/dri2.c             | 20 ++++++++++----------
 src/gallium/state_trackers/nine/swapchain9.c      |  2 +-
 src/gallium/state_trackers/xa/xa_tracker.c        |  6 +++---
 src/gallium/winsys/i915/drm/i915_drm_buffer.c     | 10 +++++-----
 src/gallium/winsys/intel/drm/intel_drm_winsys.c   | 10 +++++-----
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c     | 14 +++++++-------
 src/gallium/winsys/svga/drm/vmw_screen_dri.c      | 14 +++++++-------
 src/gallium/winsys/svga/drm/vmw_screen_ioctl.c    |  6 +++---
 src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 12 ++++++------
 14 files changed, 68 insertions(+), 68 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c
index 7e61b88..79b77a3 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
@@ -223,7 +223,7 @@ vl_screen_texture_from_drawable(struct vl_screen *vscreen, Drawable drawable)
    }
 
    memset(&dri2_handle, 0, sizeof(dri2_handle));
-   dri2_handle.type = DRM_API_HANDLE_TYPE_SHARED;
+   dri2_handle.type = WINSYS_HANDLE_TYPE_SHARED;
    dri2_handle.handle = back_left->name;
    dri2_handle.stride = back_left->pitch;
 
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index 6a5748c..f4597a4 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -401,12 +401,12 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen,
 {
 	whandle->stride = stride;
 
-	if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+	if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
 		return fd_bo_get_name(bo, &whandle->handle) == 0;
-	} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+	} else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
 		whandle->handle = fd_bo_handle(bo);
 		return TRUE;
-	} else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+	} else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
 		whandle->handle = fd_bo_dmabuf(bo);
 		return TRUE;
 	} else {
@@ -422,11 +422,11 @@ fd_screen_bo_from_handle(struct pipe_screen *pscreen,
 	struct fd_screen *screen = fd_screen(pscreen);
 	struct fd_bo *bo;
 
-	if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+	if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
 		bo = fd_bo_from_name(screen->dev, whandle->handle);
-	} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+	} else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
 		bo = fd_bo_from_handle(screen->dev, whandle->handle, 0);
-	} else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+	} else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
 		bo = fd_bo_from_dmabuf(screen->dev, whandle->handle);
 	} else {
 		DBG("Attempt to import unsupported handle type %d", whandle->type);
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index b4f1413..6ce80bb 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -92,14 +92,14 @@ nouveau_screen_bo_from_handle(struct pipe_screen *pscreen,
 	struct nouveau_bo *bo = 0;
 	int ret;
 
-	if (whandle->type != DRM_API_HANDLE_TYPE_SHARED &&
-	    whandle->type != DRM_API_HANDLE_TYPE_FD) {
+	if (whandle->type != WINSYS_HANDLE_TYPE_SHARED &&
+	    whandle->type != WINSYS_HANDLE_TYPE_FD) {
 		debug_printf("%s: attempt to import unsupported handle type %d\n",
 			     __FUNCTION__, whandle->type);
 		return NULL;
 	}
 
-	if (whandle->type == DRM_API_HANDLE_TYPE_SHARED)
+	if (whandle->type == WINSYS_HANDLE_TYPE_SHARED)
 		ret = nouveau_bo_name_ref(dev, whandle->handle, &bo);
 	else
 		ret = nouveau_bo_prime_handle_ref(dev, whandle->handle, &bo);
@@ -123,12 +123,12 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
 {
 	whandle->stride = stride;
 
-	if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+	if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
 		return nouveau_bo_name_get(bo, &whandle->handle) == 0;
-	} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+	} else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
 		whandle->handle = bo->handle;
 		return TRUE;
-	} else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+	} else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
 		return nouveau_bo_set_prime(bo, (int *)&whandle->handle) == 0;
 	} else {
 		return FALSE;
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index f63bead..0d43c91 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -490,12 +490,12 @@ vc4_screen_bo_get_handle(struct pipe_screen *pscreen,
         whandle->stride = stride;
 
         switch (whandle->type) {
-        case DRM_API_HANDLE_TYPE_SHARED:
+        case WINSYS_HANDLE_TYPE_SHARED:
                 return vc4_bo_flink(bo, &whandle->handle);
-        case DRM_API_HANDLE_TYPE_KMS:
+        case WINSYS_HANDLE_TYPE_KMS:
                 whandle->handle = bo->handle;
                 return TRUE;
-        case DRM_API_HANDLE_TYPE_FD:
+        case WINSYS_HANDLE_TYPE_FD:
                 whandle->handle = vc4_bo_get_dmabuf(bo);
                 return whandle->handle != -1;
         }
@@ -510,9 +510,9 @@ vc4_screen_bo_from_handle(struct pipe_screen *pscreen,
         struct vc4_screen *screen = vc4_screen(pscreen);
 
         switch (whandle->type) {
-        case DRM_API_HANDLE_TYPE_SHARED:
+        case WINSYS_HANDLE_TYPE_SHARED:
                 return vc4_bo_open_name(screen, whandle->handle, whandle->stride);
-        case DRM_API_HANDLE_TYPE_FD:
+        case WINSYS_HANDLE_TYPE_FD:
                 return vc4_bo_open_dmabuf(screen, whandle->handle, whandle->stride);
         default:
                 fprintf(stderr,
diff --git a/src/gallium/include/state_tracker/winsys_handle.h b/src/gallium/include/state_tracker/winsys_handle.h
index 8a48028..55537ef 100644
--- a/src/gallium/include/state_tracker/winsys_handle.h
+++ b/src/gallium/include/state_tracker/winsys_handle.h
@@ -6,9 +6,9 @@
 extern "C" {
 #endif
 
-#define DRM_API_HANDLE_TYPE_SHARED 0
-#define DRM_API_HANDLE_TYPE_KMS    1
-#define DRM_API_HANDLE_TYPE_FD     2
+#define WINSYS_HANDLE_TYPE_SHARED 0
+#define WINSYS_HANDLE_TYPE_KMS    1
+#define WINSYS_HANDLE_TYPE_FD     2
 
 /**
  * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 8d93f78..d9d7b71 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -349,9 +349,9 @@ dri2_allocate_buffer(__DRIscreen *sPriv,
 
    memset(&whandle, 0, sizeof(whandle));
    if (screen->can_share_buffer)
-      whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+      whandle.type = WINSYS_HANDLE_TYPE_SHARED;
    else
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;
 
    screen->base.screen->resource_get_handle(screen->base.screen,
          buffer->resource, &whandle);
@@ -534,9 +534,9 @@ dri2_allocate_textures(struct dri_context *ctx,
          whandle.handle = buf->name;
          whandle.stride = buf->pitch;
          if (screen->can_share_buffer)
-            whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+            whandle.type = WINSYS_HANDLE_TYPE_SHARED;
          else
-            whandle.type = DRM_API_HANDLE_TYPE_KMS;
+            whandle.type = WINSYS_HANDLE_TYPE_KMS;
          drawable->textures[statt] =
             screen->base.screen->resource_from_handle(screen->base.screen,
                   &templ, &whandle);
@@ -778,7 +778,7 @@ dri2_create_image_from_name(__DRIscreen *_screen,
    struct winsys_handle whandle;
 
    memset(&whandle, 0, sizeof(whandle));
-   whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+   whandle.type = WINSYS_HANDLE_TYPE_SHARED;
    whandle.handle = name;
 
    return dri2_create_image_from_winsys(_screen, width, height, format,
@@ -796,7 +796,7 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
       return NULL;
 
    memset(&whandle, 0, sizeof(whandle));
-   whandle.type = DRM_API_HANDLE_TYPE_FD;
+   whandle.type = WINSYS_HANDLE_TYPE_FD;
    whandle.handle = (unsigned)fd;
 
    return dri2_create_image_from_winsys(_screen, width, height, format,
@@ -897,25 +897,25 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
 
    switch (attrib) {
    case __DRI_IMAGE_ATTRIB_STRIDE:
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;
       image->texture->screen->resource_get_handle(image->texture->screen,
             image->texture, &whandle);
       *value = whandle.stride;
       return GL_TRUE;
    case __DRI_IMAGE_ATTRIB_HANDLE:
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;
       image->texture->screen->resource_get_handle(image->texture->screen,
          image->texture, &whandle);
       *value = whandle.handle;
       return GL_TRUE;
    case __DRI_IMAGE_ATTRIB_NAME:
-      whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+      whandle.type = WINSYS_HANDLE_TYPE_SHARED;
       image->texture->screen->resource_get_handle(image->texture->screen,
          image->texture, &whandle);
       *value = whandle.handle;
       return GL_TRUE;
    case __DRI_IMAGE_ATTRIB_FD:
-      whandle.type= DRM_API_HANDLE_TYPE_FD;
+      whandle.type= WINSYS_HANDLE_TYPE_FD;
       image->texture->screen->resource_get_handle(image->texture->screen,
          image->texture, &whandle);
       *value = whandle.handle;
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index c40bc60..47d3083 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -86,7 +86,7 @@ D3DWindowBuffer_create(struct NineSwapChain9 *This,
     int stride, dmaBufFd;
 
     memset(&whandle, 0, sizeof(whandle));
-    whandle.type = DRM_API_HANDLE_TYPE_FD;
+    whandle.type = WINSYS_HANDLE_TYPE_FD;
     This->screen->resource_get_handle(This->screen, resource, &whandle);
     stride = whandle.stride;
     dmaBufFd = whandle.handle;
diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c
index 8901998..65329a0 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -382,7 +382,7 @@ xa_surface_from_handle(struct xa_tracker *xa,
 {
     struct winsys_handle whandle;
     memset(&whandle, 0, sizeof(whandle));
-    whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+    whandle.type = WINSYS_HANDLE_TYPE_SHARED;
     whandle.handle = handle;
     whandle.stride = stride;
     return surface_create(xa, width, height, depth, stype, xa_format, flags, &whandle);
@@ -513,11 +513,11 @@ xa_surface_handle(struct xa_surface *srf,
     memset(&whandle, 0, sizeof(whandle));
     switch (type) {
     case xa_handle_type_kms:
-	whandle.type = DRM_API_HANDLE_TYPE_KMS;
+	whandle.type = WINSYS_HANDLE_TYPE_KMS;
 	break;
     case xa_handle_type_shared:
     default:
-	whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+	whandle.type = WINSYS_HANDLE_TYPE_SHARED;
 	break;
     }
     res = screen->resource_get_handle(screen, srf->tex, &whandle);
diff --git a/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
index c069852..4c6164b 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_buffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
@@ -98,7 +98,7 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
    struct i915_drm_buffer *buf;
    uint32_t tile = 0, swizzle = 0;
 
-   if ((whandle->type != DRM_API_HANDLE_TYPE_SHARED) && (whandle->type != DRM_API_HANDLE_TYPE_FD))
+   if ((whandle->type != WINSYS_HANDLE_TYPE_SHARED) && (whandle->type != WINSYS_HANDLE_TYPE_FD))
       return NULL;
 
    buf = CALLOC_STRUCT(i915_drm_buffer);
@@ -107,9 +107,9 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
 
    buf->magic = 0xDEAD1337;
 
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED)
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED)
        buf->bo = drm_intel_bo_gem_create_from_name(idws->gem_manager, "gallium3d_from_handle", whandle->handle);
-   else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+   else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
        int fd = (int) whandle->handle;
        buf->bo = drm_intel_bo_gem_create_from_prime(idws->gem_manager, fd, height * whandle->stride);
    }
@@ -140,7 +140,7 @@ i915_drm_buffer_get_handle(struct i915_winsys *iws,
 {
    struct i915_drm_buffer *buf = i915_drm_buffer(buffer);
 
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
       if (!buf->flinked) {
          if (drm_intel_bo_flink(buf->bo, &buf->flink))
             return FALSE;
@@ -148,7 +148,7 @@ i915_drm_buffer_get_handle(struct i915_winsys *iws,
       }
 
       whandle->handle = buf->flink;
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
       whandle->handle = buf->bo->handle;
    } else {
       assert(!"unknown usage");
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
index 1c5aabe..a4d04e7 100644
--- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c
+++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
@@ -314,14 +314,14 @@ intel_winsys_import_handle(struct intel_winsys *winsys,
    int err;
 
    switch (handle->type) {
-   case DRM_API_HANDLE_TYPE_SHARED:
+   case WINSYS_HANDLE_TYPE_SHARED:
       {
          const uint32_t gem_name = handle->handle;
          bo = drm_intel_bo_gem_create_from_name(winsys->bufmgr,
                name, gem_name);
       }
       break;
-   case DRM_API_HANDLE_TYPE_FD:
+   case WINSYS_HANDLE_TYPE_FD:
       {
          const int fd = (int) handle->handle;
          bo = drm_intel_bo_gem_create_from_prime(winsys->bufmgr,
@@ -359,7 +359,7 @@ intel_winsys_export_handle(struct intel_winsys *winsys,
    int err = 0;
 
    switch (handle->type) {
-   case DRM_API_HANDLE_TYPE_SHARED:
+   case WINSYS_HANDLE_TYPE_SHARED:
       {
          uint32_t name;
 
@@ -368,10 +368,10 @@ intel_winsys_export_handle(struct intel_winsys *winsys,
             handle->handle = name;
       }
       break;
-   case DRM_API_HANDLE_TYPE_KMS:
+   case WINSYS_HANDLE_TYPE_KMS:
       handle->handle = gem_bo(bo)->handle;
       break;
-   case DRM_API_HANDLE_TYPE_FD:
+   case WINSYS_HANDLE_TYPE_FD:
       {
          int fd;
 
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index fe98870..66ccac2 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -953,10 +953,10 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
      * The list of pairs is guarded by a mutex, of course. */
     pipe_mutex_lock(mgr->bo_handles_mutex);
 
-    if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+    if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
         /* First check if there already is an existing bo for the handle. */
         bo = util_hash_table_get(mgr->bo_names, (void*)(uintptr_t)whandle->handle);
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
         /* We must first get the GEM handle, as fds are unreliable keys */
         r = drmPrimeFDToHandle(ws->fd, whandle->handle, &handle);
         if (r)
@@ -980,7 +980,7 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
         goto fail;
     }
 
-    if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+    if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
         struct drm_gem_open open_arg = {};
         memset(&open_arg, 0, sizeof(open_arg));
         /* Open the BO. */
@@ -992,7 +992,7 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
         handle = open_arg.handle;
         size = open_arg.size;
         bo->flink_name = whandle->handle;
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
         size = lseek(whandle->handle, 0, SEEK_END);
         /* 
          * Could check errno to determine whether the kernel is new enough, but
@@ -1086,7 +1086,7 @@ 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 (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
         if (!bo->flink_name) {
             flink.handle = bo->handle;
 
@@ -1101,9 +1101,9 @@ static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
             pipe_mutex_unlock(bo->mgr->bo_handles_mutex);
         }
         whandle->handle = bo->flink_name;
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
         whandle->handle = bo->handle;
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
         if (drmPrimeHandleToFD(bo->rws->fd, bo->handle, DRM_CLOEXEC, (int*)&whandle->handle))
             return FALSE;
     }
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_dri.c b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
index 9f33590..b84508c 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_dri.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
@@ -254,11 +254,11 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
     int i;
 
     switch (whandle->type) {
-    case DRM_API_HANDLE_TYPE_SHARED:
-    case DRM_API_HANDLE_TYPE_KMS:
+    case WINSYS_HANDLE_TYPE_SHARED:
+    case WINSYS_HANDLE_TYPE_KMS:
        handle = whandle->handle;
        break;
-    case DRM_API_HANDLE_TYPE_FD:
+    case WINSYS_HANDLE_TYPE_FD:
        ret = drmPrimeFDToHandle(vws->ioctl.drm_fd, whandle->handle,
                                 &handle);
        if (ret) {
@@ -283,7 +283,7 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
     /*
      * Need to close the handle we got from prime.
      */
-    if (whandle->type == DRM_API_HANDLE_TYPE_FD)
+    if (whandle->type == WINSYS_HANDLE_TYPE_FD)
        vmw_ioctl_surface_destroy(vws, handle);
 
     if (ret) {
@@ -359,11 +359,11 @@ vmw_drm_surface_get_handle(struct svga_winsys_screen *sws,
     whandle->stride = stride;
 
     switch (whandle->type) {
-    case DRM_API_HANDLE_TYPE_SHARED:
-    case DRM_API_HANDLE_TYPE_KMS:
+    case WINSYS_HANDLE_TYPE_SHARED:
+    case WINSYS_HANDLE_TYPE_KMS:
        whandle->handle = vsrf->sid;
        break;
-    case DRM_API_HANDLE_TYPE_FD:
+    case WINSYS_HANDLE_TYPE_FD:
        ret = drmPrimeHandleToFD(vws->ioctl.drm_fd, vsrf->sid, DRM_CLOEXEC,
 				(int *)&whandle->handle);
        if (ret) {
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
index 14c3b20..8237be9 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
@@ -274,13 +274,13 @@ vmw_ioctl_surface_req(const struct vmw_winsys_screen *vws,
    int ret;
 
    switch(whandle->type) {
-   case DRM_API_HANDLE_TYPE_SHARED:
-   case DRM_API_HANDLE_TYPE_KMS:
+   case WINSYS_HANDLE_TYPE_SHARED:
+   case WINSYS_HANDLE_TYPE_KMS:
       *needs_unref = FALSE;
       req->handle_type = DRM_VMW_HANDLE_LEGACY;
       req->sid = whandle->handle;
       break;
-   case DRM_API_HANDLE_TYPE_FD:
+   case WINSYS_HANDLE_TYPE_FD:
       if (!vws->ioctl.have_drm_2_6) {
          uint32_t handle;
 
diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
index 740b920..74a9efe 100644
--- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
@@ -262,11 +262,11 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws,
    struct kms_sw_winsys *kms_sw = kms_sw_winsys(ws);
    struct kms_sw_displaytarget *kms_sw_dt;
 
-   assert(whandle->type == DRM_API_HANDLE_TYPE_KMS ||
-          whandle->type == DRM_API_HANDLE_TYPE_FD);
+   assert(whandle->type == WINSYS_HANDLE_TYPE_KMS ||
+          whandle->type == WINSYS_HANDLE_TYPE_FD);
 
    switch(whandle->type) {
-   case DRM_API_HANDLE_TYPE_FD:
+   case WINSYS_HANDLE_TYPE_FD:
       kms_sw_dt = kms_sw_displaytarget_add_from_prime(kms_sw, whandle->handle);
       if (kms_sw_dt) {
          kms_sw_dt->ref_count++;
@@ -276,7 +276,7 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws,
          *stride = kms_sw_dt->stride;
       }
       return (struct sw_displaytarget *)kms_sw_dt;
-   case DRM_API_HANDLE_TYPE_KMS:
+   case WINSYS_HANDLE_TYPE_KMS:
       LIST_FOR_EACH_ENTRY(kms_sw_dt, &kms_sw->bo_list, link) {
          if (kms_sw_dt->handle == whandle->handle) {
             kms_sw_dt->ref_count++;
@@ -305,11 +305,11 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys,
    struct kms_sw_displaytarget *kms_sw_dt = kms_sw_displaytarget(dt);
 
    switch(whandle->type) {
-   case DRM_API_HANDLE_TYPE_KMS:
+   case WINSYS_HANDLE_TYPE_KMS:
       whandle->handle = kms_sw_dt->handle;
       whandle->stride = kms_sw_dt->stride;
       return TRUE;
-   case DRM_API_HANDLE_TYPE_FD:
+   case WINSYS_HANDLE_TYPE_FD:
       if (!drmPrimeHandleToFD(kms_sw->fd, kms_sw_dt->handle,
                              DRM_CLOEXEC, (int*)&whandle->handle)) {
          whandle->stride = kms_sw_dt->stride;
-- 
2.4.2



More information about the mesa-dev mailing list