<div dir="ltr"><div>For the series:</div><div><br></div><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 28, 2018 at 9:26 PM, Dave Airlie <span dir="ltr"><<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
<br>
This just renames this as we want to add an shm handle which<br>
isn't really drm related.<br>
<br>
Originally by: Marc-André Lureau <<a href="mailto:marcandre.lureau@gmail.com">marcandre.lureau@gmail.com</a>><br>
(airlied: I used this sed script instead)<br>
This was generated with:<br>
 git grep -l 'DRM_API_' | xargs sed -i 's/DRM_API_/WINSYS_/g'<br>
---<br>
 src/gallium/auxiliary/<wbr>renderonly/renderonly.c |  4 +--<br>
 src/gallium/auxiliary/<wbr>renderonly/renderonly.h |  2 +-<br>
 src/gallium/auxiliary/vl/vl_<wbr>winsys_dri.c      |  2 +-<br>
 src/gallium/auxiliary/vl/vl_<wbr>winsys_dri3.c     |  4 +--<br>
 .../drivers/etnaviv/etnaviv_<wbr>resource.c        |  8 ++---<br>
 src/gallium/drivers/etnaviv/<wbr>etnaviv_screen.c  |  4 +--<br>
 .../drivers/freedreno/<wbr>freedreno_screen.c      | 12 ++++----<br>
 src/gallium/drivers/nouveau/<wbr>nouveau_screen.c  | 12 ++++----<br>
 src/gallium/drivers/radeonsi/<wbr>si_texture.c     |  2 +-<br>
 src/gallium/drivers/tegra/<wbr>tegra_screen.c      |  4 +--<br>
 src/gallium/drivers/v3d/v3d_<wbr>resource.c        | 10 +++----<br>
 src/gallium/drivers/vc4/vc4_<wbr>resource.c        | 10 +++----<br>
 src/gallium/include/pipe/p_<wbr>screen.h           |  6 ++--<br>
 .../include/state_tracker/<wbr>winsys_handle.h     |  6 ++--<br>
 src/gallium/state_trackers/<wbr>dri/dri2.c         | 30 +++++++++----------<br>
 src/gallium/state_trackers/<wbr>nine/swapchain9.c  |  2 +-<br>
 src/gallium/state_trackers/va/<wbr>buffer.c        |  2 +-<br>
 src/gallium/state_trackers/va/<wbr>surface.c       |  4 +--<br>
 src/gallium/state_trackers/<wbr>vdpau/output.c     |  2 +-<br>
 src/gallium/state_trackers/<wbr>vdpau/surface.c    |  2 +-<br>
 src/gallium/state_trackers/xa/<wbr>xa_tracker.c    |  8 ++---<br>
 src/gallium/winsys/amdgpu/drm/<wbr>amdgpu_bo.c     | 10 +++----<br>
 src/gallium/winsys/i915/drm/<wbr>i915_drm_buffer.c | 12 ++++----<br>
 src/gallium/winsys/radeon/drm/<wbr>radeon_drm_bo.c | 14 ++++-----<br>
 src/gallium/winsys/svga/drm/<wbr>vmw_screen_dri.c  | 14 ++++-----<br>
 .../winsys/svga/drm/vmw_<wbr>screen_ioctl.c        |  6 ++--<br>
 .../winsys/sw/kms-dri/kms_dri_<wbr>sw_winsys.c     | 12 ++++----<br>
 .../winsys/virgl/drm/virgl_<wbr>drm_winsys.c       | 12 ++++----<br>
 src/mesa/state_tracker/st_cb_<wbr>memoryobjects.c  |  2 +-<br>
 src/mesa/state_tracker/st_<wbr>vdpau.c             |  2 +-<br>
 30 files changed, 110 insertions(+), 110 deletions(-)<br>
<br>
diff --git a/src/gallium/auxiliary/<wbr>renderonly/renderonly.c b/src/gallium/auxiliary/<wbr>renderonly/renderonly.c<br>
index d31f458845c..f83910a9404 100644<br>
--- a/src/gallium/auxiliary/<wbr>renderonly/renderonly.c<br>
+++ b/src/gallium/auxiliary/<wbr>renderonly/renderonly.c<br>
@@ -98,7 +98,7 @@ renderonly_create_kms_dumb_<wbr>buffer_for_resource(struct pipe_resource *rsc,<br>
<br>
    /* fill in winsys handle */<br>
    memset(out_handle, 0, sizeof(*out_handle));<br>
-   out_handle->type = DRM_API_HANDLE_TYPE_FD;<br>
+   out_handle->type = WINSYS_HANDLE_TYPE_FD;<br>
    out_handle->stride = create_dumb.pitch;<br>
<br>
    err = drmPrimeHandleToFD(ro->kms_fd, create_dumb.handle, O_CLOEXEC,<br>
@@ -130,7 +130,7 @@ renderonly_create_gpu_import_<wbr>for_resource(struct pipe_resource *rsc,<br>
    boolean status;<br>
    int fd, err;<br>
    struct winsys_handle handle = {<br>
-      .type = DRM_API_HANDLE_TYPE_FD<br>
+      .type = WINSYS_HANDLE_TYPE_FD<br>
    };<br>
<br>
    scanout = CALLOC_STRUCT(renderonly_<wbr>scanout);<br>
diff --git a/src/gallium/auxiliary/<wbr>renderonly/renderonly.h b/src/gallium/auxiliary/<wbr>renderonly/renderonly.h<br>
index 6a89c29e2ef..a8d6a686ed4 100644<br>
--- a/src/gallium/auxiliary/<wbr>renderonly/renderonly.h<br>
+++ b/src/gallium/auxiliary/<wbr>renderonly/renderonly.h<br>
@@ -85,7 +85,7 @@ renderonly_get_handle(struct renderonly_scanout *scanout,<br>
    if (!scanout)<br>
       return FALSE;<br>
<br>
-   assert(handle->type == DRM_API_HANDLE_TYPE_KMS);<br>
+   assert(handle->type == WINSYS_HANDLE_TYPE_KMS);<br>
    handle->handle = scanout->handle;<br>
    handle->stride = scanout->stride;<br>
<br>
diff --git a/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri.c b/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri.c<br>
index 79ebf750cdb..bb1ff504886 100644<br>
--- a/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri.c<br>
+++ b/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri.c<br>
@@ -231,7 +231,7 @@ vl_dri2_screen_texture_from_<wbr>drawable(struct vl_screen *vscreen, void *drawable)<br>
    }<br>
<br>
    memset(&dri2_handle, 0, sizeof(dri2_handle));<br>
-   dri2_handle.type = DRM_API_HANDLE_TYPE_SHARED;<br>
+   dri2_handle.type = WINSYS_HANDLE_TYPE_SHARED;<br>
    dri2_handle.handle = back_left->name;<br>
    dri2_handle.stride = back_left->pitch;<br>
<br>
diff --git a/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri3.c b/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri3.c<br>
index 8251087f3f9..8e3c4a0e04d 100644<br>
--- a/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri3.c<br>
+++ b/src/gallium/auxiliary/vl/vl_<wbr>winsys_dri3.c<br>
@@ -271,7 +271,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)<br>
       pixmap_buffer_texture = buffer->texture;<br>
    }<br>
    memset(&whandle, 0, sizeof(whandle));<br>
-   whandle.type= DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type= WINSYS_HANDLE_TYPE_FD;<br>
    usage = PIPE_HANDLE_USAGE_EXPLICIT_<wbr>FLUSH | PIPE_HANDLE_USAGE_READ;<br>
    scrn->base.pscreen->resource_<wbr>get_handle(scrn->base.pscreen, NULL,<br>
                                            pixmap_buffer_texture, &whandle,<br>
@@ -492,7 +492,7 @@ dri3_get_front_buffer(struct vl_dri3_screen *scrn)<br>
       goto free_reply;<br>
<br>
    memset(&whandle, 0, sizeof(whandle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
    whandle.handle = (unsigned)fds[0];<br>
    whandle.stride = bp_reply->stride;<br>
    memset(&templ, 0, sizeof(templ));<br>
diff --git a/src/gallium/drivers/etnaviv/<wbr>etnaviv_resource.c b/src/gallium/drivers/etnaviv/<wbr>etnaviv_resource.c<br>
index c600eff45ce..7fd374ae23d 100644<br>
--- a/src/gallium/drivers/etnaviv/<wbr>etnaviv_resource.c<br>
+++ b/src/gallium/drivers/etnaviv/<wbr>etnaviv_resource.c<br>
@@ -250,7 +250,7 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,<br>
       if (!scanout)<br>
          return NULL;<br>
<br>
-      assert(handle.type == DRM_API_HANDLE_TYPE_FD);<br>
+      assert(handle.type == WINSYS_HANDLE_TYPE_FD);<br>
       handle.modifier = modifier;<br>
       rsc = etna_resource(pscreen-><wbr>resource_from_handle(pscreen, templat,<br>
                                                         &handle,<br>
@@ -600,16 +600,16 @@ etna_resource_get_handle(<wbr>struct pipe_screen *pscreen,<br>
    handle->stride = rsc->levels[0].stride;<br>
    handle->modifier = layout_to_modifier(rsc-><wbr>layout);<br>
<br>
-   if (handle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+   if (handle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
       return etna_bo_get_name(rsc->bo, &handle->handle) == 0;<br>
-   } else if (handle->type == DRM_API_HANDLE_TYPE_KMS) {<br>
+   } else if (handle->type == WINSYS_HANDLE_TYPE_KMS) {<br>
       if (renderonly_get_handle(<wbr>scanout, handle)) {<br>
          return TRUE;<br>
       } else {<br>
          handle->handle = etna_bo_handle(rsc->bo);<br>
          return TRUE;<br>
       }<br>
-   } else if (handle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   } else if (handle->type == WINSYS_HANDLE_TYPE_FD) {<br>
       handle->handle = etna_bo_dmabuf(rsc->bo);<br>
       return TRUE;<br>
    } else {<br>
diff --git a/src/gallium/drivers/etnaviv/<wbr>etnaviv_screen.c b/src/gallium/drivers/etnaviv/<wbr>etnaviv_screen.c<br>
index cada83609a8..10e60f5f9e5 100644<br>
--- a/src/gallium/drivers/etnaviv/<wbr>etnaviv_screen.c<br>
+++ b/src/gallium/drivers/etnaviv/<wbr>etnaviv_screen.c<br>
@@ -855,9 +855,9 @@ etna_screen_bo_from_handle(<wbr>struct pipe_screen *pscreen,<br>
    struct etna_screen *screen = etna_screen(pscreen);<br>
    struct etna_bo *bo;<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
       bo = etna_bo_from_name(screen->dev, whandle->handle);<br>
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
       bo = etna_bo_from_dmabuf(screen-><wbr>dev, whandle->handle);<br>
    } else {<br>
       DBG("Attempt to import unsupported handle type %d", whandle->type);<br>
diff --git a/src/gallium/drivers/<wbr>freedreno/freedreno_screen.c b/src/gallium/drivers/<wbr>freedreno/freedreno_screen.c<br>
index c59995c75d1..7b97b79557d 100644<br>
--- a/src/gallium/drivers/<wbr>freedreno/freedreno_screen.c<br>
+++ b/src/gallium/drivers/<wbr>freedreno/freedreno_screen.c<br>
@@ -729,12 +729,12 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen,<br>
 {<br>
        whandle->stride = stride;<br>
<br>
-       if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+       if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
                return fd_bo_get_name(bo, &whandle->handle) == 0;<br>
-       } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {<br>
+       } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {<br>
                whandle->handle = fd_bo_handle(bo);<br>
                return TRUE;<br>
-       } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+       } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
                whandle->handle = fd_bo_dmabuf(bo);<br>
                return TRUE;<br>
        } else {<br>
@@ -749,11 +749,11 @@ fd_screen_bo_from_handle(<wbr>struct pipe_screen *pscreen,<br>
        struct fd_screen *screen = fd_screen(pscreen);<br>
        struct fd_bo *bo;<br>
<br>
-       if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+       if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
                bo = fd_bo_from_name(screen->dev, whandle->handle);<br>
-       } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {<br>
+       } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {<br>
                bo = fd_bo_from_handle(screen->dev, whandle->handle, 0);<br>
-       } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+       } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
                bo = fd_bo_from_dmabuf(screen->dev, whandle->handle);<br>
        } else {<br>
                DBG("Attempt to import unsupported handle type %d", whandle->type);<br>
diff --git a/src/gallium/drivers/nouveau/<wbr>nouveau_screen.c b/src/gallium/drivers/nouveau/<wbr>nouveau_screen.c<br>
index c144b39b2dd..c97b707955c 100644<br>
--- a/src/gallium/drivers/nouveau/<wbr>nouveau_screen.c<br>
+++ b/src/gallium/drivers/nouveau/<wbr>nouveau_screen.c<br>
@@ -102,14 +102,14 @@ nouveau_screen_bo_from_handle(<wbr>struct pipe_screen *pscreen,<br>
       return NULL;<br>
    }<br>
<br>
-   if (whandle->type != DRM_API_HANDLE_TYPE_SHARED &&<br>
-       whandle->type != DRM_API_HANDLE_TYPE_FD) {<br>
+   if (whandle->type != WINSYS_HANDLE_TYPE_SHARED &&<br>
+       whandle->type != WINSYS_HANDLE_TYPE_FD) {<br>
       debug_printf("%s: attempt to import unsupported handle type %d\n",<br>
                    __FUNCTION__, whandle->type);<br>
       return NULL;<br>
    }<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED)<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED)<br>
       ret = nouveau_bo_name_ref(dev, whandle->handle, &bo);<br>
    else<br>
       ret = nouveau_bo_prime_handle_ref(<wbr>dev, whandle->handle, &bo);<br>
@@ -133,12 +133,12 @@ nouveau_screen_bo_get_handle(<wbr>struct pipe_screen *pscreen,<br>
 {<br>
    whandle->stride = stride;<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
       return nouveau_bo_name_get(bo, &whandle->handle) == 0;<br>
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {<br>
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {<br>
       whandle->handle = bo->handle;<br>
       return true;<br>
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
       return nouveau_bo_set_prime(bo, (int *)&whandle->handle) == 0;<br>
    } else {<br>
       return false;<br>
diff --git a/src/gallium/drivers/<wbr>radeonsi/si_texture.c b/src/gallium/drivers/<wbr>radeonsi/si_texture.c<br>
index d2814c4f300..7f1eff8f5d9 100644<br>
--- a/src/gallium/drivers/<wbr>radeonsi/si_texture.c<br>
+++ b/src/gallium/drivers/<wbr>radeonsi/si_texture.c<br>
@@ -713,7 +713,7 @@ static boolean si_texture_get_handle(struct pipe_screen* screen,<br>
                    rtex->surface.tile_swizzle ||<br>
                    (rtex->buffer.flags & RADEON_FLAG_NO_INTERPROCESS_<wbr>SHARING &&<br>
                     sscreen->info.has_local_<wbr>buffers &&<br>
-                    whandle->type != DRM_API_HANDLE_TYPE_KMS)) {<br>
+                    whandle->type != WINSYS_HANDLE_TYPE_KMS)) {<br>
                        assert(!res->b.is_shared);<br>
                        si_reallocate_texture_inplace(<wbr>sctx, rtex,<br>
                                                        PIPE_BIND_SHARED, false);<br>
diff --git a/src/gallium/drivers/tegra/<wbr>tegra_screen.c b/src/gallium/drivers/tegra/<wbr>tegra_screen.c<br>
index 669f22a1944..c2f60fd06e1 100644<br>
--- a/src/gallium/drivers/tegra/<wbr>tegra_screen.c<br>
+++ b/src/gallium/drivers/tegra/<wbr>tegra_screen.c<br>
@@ -230,7 +230,7 @@ static int tegra_screen_import_resource(<wbr>struct tegra_screen *screen,<br>
<br>
    memset(&handle, 0, sizeof(handle));<br>
    handle.modifier = DRM_FORMAT_MOD_INVALID;<br>
-   handle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   handle.type = WINSYS_HANDLE_TYPE_FD;<br>
<br>
    status = screen->gpu->resource_get_<wbr>handle(screen->gpu, NULL, resource->gpu,<br>
                                              &handle, usage);<br>
@@ -432,7 +432,7 @@ tegra_screen_resource_get_<wbr>handle(struct pipe_screen *pscreen,<br>
     * to pass buffers into Tegra DRM for display. In all other cases, return<br>
     * the Nouveau handle, assuming they will be used for sharing in DRI2/3.<br>
     */<br>
-   if (handle->type == DRM_API_HANDLE_TYPE_KMS &&<br>
+   if (handle->type == WINSYS_HANDLE_TYPE_KMS &&<br>
        presource->bind & PIPE_BIND_SCANOUT) {<br>
       handle->modifier = resource->modifier;<br>
       handle->handle = resource->handle;<br>
diff --git a/src/gallium/drivers/v3d/v3d_<wbr>resource.c b/src/gallium/drivers/v3d/v3d_<wbr>resource.c<br>
index d9b254a93e0..b91ab30708e 100644<br>
--- a/src/gallium/drivers/v3d/v3d_<wbr>resource.c<br>
+++ b/src/gallium/drivers/v3d/v3d_<wbr>resource.c<br>
@@ -324,12 +324,12 @@ v3d_resource_get_handle(struct pipe_screen *pscreen,<br>
         bo->private = false;<br>
<br>
         switch (whandle->type) {<br>
-        case DRM_API_HANDLE_TYPE_SHARED:<br>
+        case WINSYS_HANDLE_TYPE_SHARED:<br>
                 return v3d_bo_flink(bo, &whandle->handle);<br>
-        case DRM_API_HANDLE_TYPE_KMS:<br>
+        case WINSYS_HANDLE_TYPE_KMS:<br>
                 whandle->handle = bo->handle;<br>
                 return TRUE;<br>
-        case DRM_API_HANDLE_TYPE_FD:<br>
+        case WINSYS_HANDLE_TYPE_FD:<br>
                 whandle->handle = v3d_bo_get_dmabuf(bo);<br>
                 return whandle->handle != -1;<br>
         }<br>
@@ -715,11 +715,11 @@ v3d_resource_from_handle(<wbr>struct pipe_screen *pscreen,<br>
         }<br>
<br>
         switch (whandle->type) {<br>
-        case DRM_API_HANDLE_TYPE_SHARED:<br>
+        case WINSYS_HANDLE_TYPE_SHARED:<br>
                 rsc->bo = v3d_bo_open_name(screen,<br>
                                            whandle->handle, whandle->stride);<br>
                 break;<br>
-        case DRM_API_HANDLE_TYPE_FD:<br>
+        case WINSYS_HANDLE_TYPE_FD:<br>
                 rsc->bo = v3d_bo_open_dmabuf(screen,<br>
                                              whandle->handle, whandle->stride);<br>
                 break;<br>
diff --git a/src/gallium/drivers/vc4/vc4_<wbr>resource.c b/src/gallium/drivers/vc4/vc4_<wbr>resource.c<br>
index a86bd814d20..3ea45ba080b 100644<br>
--- a/src/gallium/drivers/vc4/vc4_<wbr>resource.c<br>
+++ b/src/gallium/drivers/vc4/vc4_<wbr>resource.c<br>
@@ -403,7 +403,7 @@ vc4_resource_get_handle(struct pipe_screen *pscreen,<br>
                 whandle->modifier = DRM_FORMAT_MOD_LINEAR;<br>
<br>
         switch (whandle->type) {<br>
-        case DRM_API_HANDLE_TYPE_SHARED:<br>
+        case WINSYS_HANDLE_TYPE_SHARED:<br>
                 if (screen->ro) {<br>
                         /* This could probably be supported, assuming that a<br>
                          * control node was used for pl111.<br>
@@ -413,12 +413,12 @@ vc4_resource_get_handle(struct pipe_screen *pscreen,<br>
                 }<br>
<br>
                 return vc4_bo_flink(rsc->bo, &whandle->handle);<br>
-        case DRM_API_HANDLE_TYPE_KMS:<br>
+        case WINSYS_HANDLE_TYPE_KMS:<br>
                 if (screen->ro && renderonly_get_handle(rsc-><wbr>scanout, whandle))<br>
                         return TRUE;<br>
                 whandle->handle = rsc->bo->handle;<br>
                 return TRUE;<br>
-        case DRM_API_HANDLE_TYPE_FD:<br>
+        case WINSYS_HANDLE_TYPE_FD:<br>
                 /* FDs are cross-device, so we can export directly from vc4.<br>
                  */<br>
                 whandle->handle = vc4_bo_get_dmabuf(rsc->bo);<br>
@@ -708,11 +708,11 @@ vc4_resource_from_handle(<wbr>struct pipe_screen *pscreen,<br>
                 return NULL;<br>
<br>
         switch (whandle->type) {<br>
-        case DRM_API_HANDLE_TYPE_SHARED:<br>
+        case WINSYS_HANDLE_TYPE_SHARED:<br>
                 rsc->bo = vc4_bo_open_name(screen,<br>
                                            whandle->handle, whandle->stride);<br>
                 break;<br>
-        case DRM_API_HANDLE_TYPE_FD:<br>
+        case WINSYS_HANDLE_TYPE_FD:<br>
                 rsc->bo = vc4_bo_open_dmabuf(screen,<br>
                                              whandle->handle, whandle->stride);<br>
                 break;<br>
diff --git a/src/gallium/include/pipe/p_<wbr>screen.h b/src/gallium/include/pipe/p_<wbr>screen.h<br>
index 101e229088b..8fd81a4e9a9 100644<br>
--- a/src/gallium/include/pipe/p_<wbr>screen.h<br>
+++ b/src/gallium/include/pipe/p_<wbr>screen.h<br>
@@ -191,7 +191,7 @@ struct pipe_screen {<br>
     * another process by first creating a pipe texture and then calling<br>
     * resource_get_handle.<br>
     *<br>
-    * NOTE: in the case of DRM_API_HANDLE_TYPE_FD handles, the caller<br>
+    * NOTE: in the case of WINSYS_HANDLE_TYPE_FD handles, the caller<br>
     * retains ownership of the FD.  (This is consistent with<br>
     * EGL_EXT_image_dma_buf_import)<br>
     *<br>
@@ -238,7 +238,7 @@ struct pipe_screen {<br>
     * the resource into a format compatible for sharing. The use case is<br>
     * OpenGL-OpenCL interop. The context parameter is allowed to be NULL.<br>
     *<br>
-    * NOTE: in the case of DRM_API_HANDLE_TYPE_FD handles, the caller<br>
+    * NOTE: in the case of WINSYS_HANDLE_TYPE_FD handles, the caller<br>
     * takes ownership of the FD.  (This is consistent with<br>
     * EGL_MESA_image_dma_buf_export)<br>
     *<br>
@@ -389,7 +389,7 @@ struct pipe_screen {<br>
     * Then the underlying memory object is then exported through interfaces<br>
     * compatible with EXT_external_resources.<br>
     *<br>
-    * Note: For DRM_API_HANDLE_TYPE_FD handles, the caller retains ownership<br>
+    * Note: For WINSYS_HANDLE_TYPE_FD handles, the caller retains ownership<br>
     * of the fd.<br>
     *<br>
     * \param handle  A handle representing the memory object to import<br>
diff --git a/src/gallium/include/state_<wbr>tracker/winsys_handle.h b/src/gallium/include/state_<wbr>tracker/winsys_handle.h<br>
index 9217e4dcbfc..746e87683a7 100644<br>
--- a/src/gallium/include/state_<wbr>tracker/winsys_handle.h<br>
+++ b/src/gallium/include/state_<wbr>tracker/winsys_handle.h<br>
@@ -6,9 +6,9 @@<br>
 extern "C" {<br>
 #endif<br>
<br>
-#define DRM_API_HANDLE_TYPE_SHARED 0<br>
-#define DRM_API_HANDLE_TYPE_KMS    1<br>
-#define DRM_API_HANDLE_TYPE_FD     2<br>
+#define WINSYS_HANDLE_TYPE_SHARED 0<br>
+#define WINSYS_HANDLE_TYPE_KMS    1<br>
+#define WINSYS_HANDLE_TYPE_FD     2<br>
<br>
 /**<br>
  * For use with pipe_screen::{texture_from_<wbr>handle|texture_get_handle}.<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/dri2.c b/src/gallium/state_trackers/<wbr>dri/dri2.c<br>
index 58a6757f037..e980698cfb6 100644<br>
--- a/src/gallium/state_trackers/<wbr>dri/dri2.c<br>
+++ b/src/gallium/state_trackers/<wbr>dri/dri2.c<br>
@@ -620,9 +620,9 @@ dri2_allocate_buffer(__<wbr>DRIscreen *sPriv,<br>
<br>
    memset(&whandle, 0, sizeof(whandle));<br>
    if (screen->can_share_buffer)<br>
-      whandle.type = DRM_API_HANDLE_TYPE_SHARED;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_SHARED;<br>
    else<br>
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;<br>
<br>
    screen->base.screen->resource_<wbr>get_handle(screen->base.<wbr>screen, NULL,<br>
          buffer->resource, &whandle,<br>
@@ -808,9 +808,9 @@ dri2_allocate_textures(struct dri_context *ctx,<br>
          whandle.offset = 0;<br>
          whandle.modifier = DRM_FORMAT_MOD_INVALID;<br>
          if (screen->can_share_buffer)<br>
-            whandle.type = DRM_API_HANDLE_TYPE_SHARED;<br>
+            whandle.type = WINSYS_HANDLE_TYPE_SHARED;<br>
          else<br>
-            whandle.type = DRM_API_HANDLE_TYPE_KMS;<br>
+            whandle.type = WINSYS_HANDLE_TYPE_KMS;<br>
          drawable->textures[statt] =<br>
             screen->base.screen->resource_<wbr>from_handle(screen->base.<wbr>screen,<br>
                   &templ, &whandle,<br>
@@ -1068,7 +1068,7 @@ dri2_create_image_from_name(__<wbr>DRIscreen *_screen,<br>
    enum pipe_format pf;<br>
<br>
    memset(&whandle, 0, sizeof(whandle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_SHARED;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_SHARED;<br>
    whandle.handle = name;<br>
    whandle.modifier = DRM_FORMAT_MOD_INVALID;<br>
<br>
@@ -1127,7 +1127,7 @@ dri2_create_image_from_fd(__<wbr>DRIscreen *_screen,<br>
          goto exit;<br>
       }<br>
<br>
-      whandles[i].type = DRM_API_HANDLE_TYPE_FD;<br>
+      whandles[i].type = WINSYS_HANDLE_TYPE_FD;<br>
       whandles[i].handle = (unsigned)fds[i];<br>
       whandles[i].stride = (unsigned)strides[i];<br>
       whandles[i].offset = (unsigned)offsets[i];<br>
@@ -1267,35 +1267,35 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)<br>
<br>
    switch (attrib) {<br>
    case __DRI_IMAGE_ATTRIB_STRIDE:<br>
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;<br>
       if (!image->texture->screen-><wbr>resource_get_handle(image-><wbr>texture->screen,<br>
             NULL, image->texture, &whandle, usage))<br>
          return GL_FALSE;<br>
       *value = whandle.stride;<br>
       return GL_TRUE;<br>
    case __DRI_IMAGE_ATTRIB_OFFSET:<br>
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;<br>
       if (!image->texture->screen-><wbr>resource_get_handle(image-><wbr>texture->screen,<br>
             NULL, image->texture, &whandle, usage))<br>
          return GL_FALSE;<br>
       *value = whandle.offset;<br>
       return GL_TRUE;<br>
    case __DRI_IMAGE_ATTRIB_HANDLE:<br>
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;<br>
       if (!image->texture->screen-><wbr>resource_get_handle(image-><wbr>texture->screen,<br>
          NULL, image->texture, &whandle, usage))<br>
          return GL_FALSE;<br>
       *value = whandle.handle;<br>
       return GL_TRUE;<br>
    case __DRI_IMAGE_ATTRIB_NAME:<br>
-      whandle.type = DRM_API_HANDLE_TYPE_SHARED;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_SHARED;<br>
       if (!image->texture->screen-><wbr>resource_get_handle(image-><wbr>texture->screen,<br>
          NULL, image->texture, &whandle, usage))<br>
          return GL_FALSE;<br>
       *value = whandle.handle;<br>
       return GL_TRUE;<br>
    case __DRI_IMAGE_ATTRIB_FD:<br>
-      whandle.type= DRM_API_HANDLE_TYPE_FD;<br>
+      whandle.type= WINSYS_HANDLE_TYPE_FD;<br>
       if (!image->texture->screen-><wbr>resource_get_handle(image-><wbr>texture->screen,<br>
             NULL, image->texture, &whandle, usage))<br>
          return GL_FALSE;<br>
@@ -1323,7 +1323,7 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)<br>
       *value = 1;<br>
       return GL_TRUE;<br>
    case __DRI_IMAGE_ATTRIB_MODIFIER_<wbr>UPPER:<br>
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;<br>
       whandle.modifier = DRM_FORMAT_MOD_INVALID;<br>
       if (!image->texture->screen-><wbr>resource_get_handle(image-><wbr>texture->screen,<br>
             NULL, image->texture, &whandle, usage))<br>
@@ -1333,7 +1333,7 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)<br>
       *value = (whandle.modifier >> 32) & 0xffffffff;<br>
       return GL_TRUE;<br>
    case __DRI_IMAGE_ATTRIB_MODIFIER_<wbr>LOWER:<br>
-      whandle.type = DRM_API_HANDLE_TYPE_KMS;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_KMS;<br>
       whandle.modifier = DRM_FORMAT_MOD_INVALID;<br>
       if (!image->texture->screen-><wbr>resource_get_handle(image-><wbr>texture->screen,<br>
             NULL, image->texture, &whandle, usage))<br>
@@ -1413,7 +1413,7 @@ dri2_from_names(__DRIscreen *screen, int width, int height, int format,<br>
       return NULL;<br>
<br>
    memset(&whandle, 0, sizeof(whandle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_SHARED;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_SHARED;<br>
    whandle.handle = names[0];<br>
    whandle.stride = strides[0];<br>
    whandle.offset = offsets[0];<br>
@@ -1945,7 +1945,7 @@ dri2_interop_export_object(__<wbr>DRIcontext *_ctx,<br>
    }<br>
<br>
    memset(&whandle, 0, sizeof(whandle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
<br>
    success = screen->resource_get_handle(<wbr>screen, st->pipe, res, &whandle,<br>
                                          usage);<br>
diff --git a/src/gallium/state_trackers/<wbr>nine/swapchain9.c b/src/gallium/state_trackers/<wbr>nine/swapchain9.c<br>
index f24a7d05437..7cf5c54bfa8 100644<br>
--- a/src/gallium/state_trackers/<wbr>nine/swapchain9.c<br>
+++ b/src/gallium/state_trackers/<wbr>nine/swapchain9.c<br>
@@ -96,7 +96,7 @@ D3DWindowBuffer_create(struct NineSwapChain9 *This,<br>
     HRESULT hr;<br>
<br>
     memset(&whandle, 0, sizeof(whandle));<br>
-    whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+    whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
     This->screen->resource_get_<wbr>handle(This->screen, pipe, resource,<br>
                                       &whandle,<br>
                                       for_frontbuffer_reading ?<br>
diff --git a/src/gallium/state_trackers/<wbr>va/buffer.c b/src/gallium/state_trackers/<wbr>va/buffer.c<br>
index deaeb1939fe..42ec9730fc1 100644<br>
--- a/src/gallium/state_trackers/<wbr>va/buffer.c<br>
+++ b/src/gallium/state_trackers/<wbr>va/buffer.c<br>
@@ -305,7 +305,7 @@ vlVaAcquireBufferHandle(<wbr>VADriverContextP ctx, VABufferID buf_id,<br>
          drv->pipe->flush(drv->pipe, NULL, 0);<br>
<br>
          memset(&whandle, 0, sizeof(whandle));<br>
-         whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+         whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
<br>
          if (!screen->resource_get_handle(<wbr>screen, drv->pipe,<br>
                                           buf->derived_surface.resource,<br>
diff --git a/src/gallium/state_trackers/<wbr>va/surface.c b/src/gallium/state_trackers/<wbr>va/surface.c<br>
index 003f88f1f9e..cc26efe1c1a 100644<br>
--- a/src/gallium/state_trackers/<wbr>va/surface.c<br>
+++ b/src/gallium/state_trackers/<wbr>va/surface.c<br>
@@ -568,7 +568,7 @@ surface_from_external_memory(<wbr>VADriverContextP ctx, vlVaSurface *surface,<br>
    res_templ.usage = PIPE_USAGE_DEFAULT;<br>
<br>
    memset(&whandle, 0, sizeof(struct winsys_handle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
    whandle.handle = memory_attribute->buffers[<wbr>index];<br>
<br>
    // Create a resource for each plane.<br>
@@ -1050,7 +1050,7 @@ vlVaExportSurfaceHandle(<wbr>VADriverContextP ctx,<br>
       }<br>
<br>
       memset(&whandle, 0, sizeof(whandle));<br>
-      whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+      whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
<br>
       if (!screen->resource_get_handle(<wbr>screen, drv->pipe, resource,<br>
                                        &whandle, usage)) {<br>
diff --git a/src/gallium/state_trackers/<wbr>vdpau/output.c b/src/gallium/state_trackers/<wbr>vdpau/output.c<br>
index 8ef826836c1..6ef7a404474 100644<br>
--- a/src/gallium/state_trackers/<wbr>vdpau/output.c<br>
+++ b/src/gallium/state_trackers/<wbr>vdpau/output.c<br>
@@ -805,7 +805,7 @@ VdpStatus vlVdpOutputSurfaceDMABuf(<wbr>VdpOutputSurface surface,<br>
    vlsurface->device->context-><wbr>flush(vlsurface->device-><wbr>context, NULL, 0);<br>
<br>
    memset(&whandle, 0, sizeof(struct winsys_handle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
<br>
    pscreen = vlsurface->surface->texture-><wbr>screen;<br>
    if (!pscreen->resource_get_<wbr>handle(pscreen, vlsurface->device->context,<br>
diff --git a/src/gallium/state_trackers/<wbr>vdpau/surface.c b/src/gallium/state_trackers/<wbr>vdpau/surface.c<br>
index 012d3036411..95bab8790db 100644<br>
--- a/src/gallium/state_trackers/<wbr>vdpau/surface.c<br>
+++ b/src/gallium/state_trackers/<wbr>vdpau/surface.c<br>
@@ -526,7 +526,7 @@ VdpStatus vlVdpVideoSurfaceDMABuf(<wbr>VdpVideoSurface surface,<br>
    }<br>
<br>
    memset(&whandle, 0, sizeof(struct winsys_handle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
    whandle.layer = surf->u.tex.first_layer;<br>
<br>
    pscreen = surf->texture->screen;<br>
diff --git a/src/gallium/state_trackers/<wbr>xa/xa_tracker.c b/src/gallium/state_trackers/<wbr>xa/xa_tracker.c<br>
index 03a3abf6835..3d268a17750 100644<br>
--- a/src/gallium/state_trackers/<wbr>xa/xa_tracker.c<br>
+++ b/src/gallium/state_trackers/<wbr>xa/xa_tracker.c<br>
@@ -311,12 +311,12 @@ handle_type(enum xa_handle_type type)<br>
 {<br>
     switch (type) {<br>
     case xa_handle_type_kms:<br>
-       return DRM_API_HANDLE_TYPE_KMS;<br>
+       return WINSYS_HANDLE_TYPE_KMS;<br>
     case xa_handle_type_fd:<br>
-        return DRM_API_HANDLE_TYPE_FD;<br>
+        return WINSYS_HANDLE_TYPE_FD;<br>
     case xa_handle_type_shared:<br>
     default:<br>
-       return DRM_API_HANDLE_TYPE_SHARED;<br>
+       return WINSYS_HANDLE_TYPE_SHARED;<br>
     }<br>
 }<br>
<br>
@@ -404,7 +404,7 @@ xa_surface_from_handle(struct xa_tracker *xa,<br>
                  uint32_t handle, uint32_t stride)<br>
 {<br>
     return xa_surface_from_handle2(xa, width, height, depth, stype, xa_format,<br>
-                                   DRM_API_HANDLE_TYPE_SHARED, flags, handle,<br>
+                                   WINSYS_HANDLE_TYPE_SHARED, flags, handle,<br>
                                    stride);<br>
 }<br>
<br>
diff --git a/src/gallium/winsys/amdgpu/<wbr>drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/<wbr>drm/amdgpu_bo.c<br>
index 9b6d6e83032..df8b8292fa0 100644<br>
--- a/src/gallium/winsys/amdgpu/<wbr>drm/amdgpu_bo.c<br>
+++ b/src/gallium/winsys/amdgpu/<wbr>drm/amdgpu_bo.c<br>
@@ -1277,10 +1277,10 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws,<br>
    }<br>
<br>
    switch (whandle->type) {<br>
-   case DRM_API_HANDLE_TYPE_SHARED:<br>
+   case WINSYS_HANDLE_TYPE_SHARED:<br>
       type = amdgpu_bo_handle_type_gem_<wbr>flink_name;<br>
       break;<br>
-   case DRM_API_HANDLE_TYPE_FD:<br>
+   case WINSYS_HANDLE_TYPE_FD:<br>
       type = amdgpu_bo_handle_type_dma_buf_<wbr>fd;<br>
       break;<br>
    default:<br>
@@ -1365,13 +1365,13 @@ static bool amdgpu_bo_get_handle(struct pb_buffer *buffer,<br>
    bo->u.real.use_reusable_pool = false;<br>
<br>
    switch (whandle->type) {<br>
-   case DRM_API_HANDLE_TYPE_SHARED:<br>
+   case WINSYS_HANDLE_TYPE_SHARED:<br>
       type = amdgpu_bo_handle_type_gem_<wbr>flink_name;<br>
       break;<br>
-   case DRM_API_HANDLE_TYPE_FD:<br>
+   case WINSYS_HANDLE_TYPE_FD:<br>
       type = amdgpu_bo_handle_type_dma_buf_<wbr>fd;<br>
       break;<br>
-   case DRM_API_HANDLE_TYPE_KMS:<br>
+   case WINSYS_HANDLE_TYPE_KMS:<br>
       type = amdgpu_bo_handle_type_kms;<br>
       break;<br>
    default:<br>
diff --git a/src/gallium/winsys/i915/drm/<wbr>i915_drm_buffer.c b/src/gallium/winsys/i915/drm/<wbr>i915_drm_buffer.c<br>
index 890f7dc2833..509984ac6ac 100644<br>
--- a/src/gallium/winsys/i915/drm/<wbr>i915_drm_buffer.c<br>
+++ b/src/gallium/winsys/i915/drm/<wbr>i915_drm_buffer.c<br>
@@ -98,7 +98,7 @@ i915_drm_buffer_from_handle(<wbr>struct i915_winsys *iws,<br>
    struct i915_drm_buffer *buf;<br>
    uint32_t tile = 0, swizzle = 0;<br>
<br>
-   if ((whandle->type != DRM_API_HANDLE_TYPE_SHARED) && (whandle->type != DRM_API_HANDLE_TYPE_FD))<br>
+   if ((whandle->type != WINSYS_HANDLE_TYPE_SHARED) && (whandle->type != WINSYS_HANDLE_TYPE_FD))<br>
       return NULL;<br>
<br>
    if (whandle->offset != 0)<br>
@@ -110,9 +110,9 @@ i915_drm_buffer_from_handle(<wbr>struct i915_winsys *iws,<br>
<br>
    buf->magic = 0xDEAD1337;<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED)<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED)<br>
        buf->bo = drm_intel_bo_gem_create_from_<wbr>name(idws->gem_manager, "gallium3d_from_handle", whandle->handle);<br>
-   else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
        int fd = (int) whandle->handle;<br>
        buf->bo = drm_intel_bo_gem_create_from_<wbr>prime(idws->gem_manager, fd, height * whandle->stride);<br>
    }<br>
@@ -143,7 +143,7 @@ i915_drm_buffer_get_handle(<wbr>struct i915_winsys *iws,<br>
 {<br>
    struct i915_drm_buffer *buf = i915_drm_buffer(buffer);<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
       if (!buf->flinked) {<br>
          if (drm_intel_bo_flink(buf->bo, &buf->flink))<br>
             return FALSE;<br>
@@ -151,9 +151,9 @@ i915_drm_buffer_get_handle(<wbr>struct i915_winsys *iws,<br>
       }<br>
<br>
       whandle->handle = buf->flink;<br>
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {<br>
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {<br>
       whandle->handle = buf->bo->handle;<br>
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
       int fd;<br>
<br>
       if (drm_intel_bo_gem_export_to_<wbr>prime(buf->bo, &fd))<br>
diff --git a/src/gallium/winsys/radeon/<wbr>drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/<wbr>drm/radeon_drm_bo.c<br>
index 6652977e586..93ab4791c55 100644<br>
--- a/src/gallium/winsys/radeon/<wbr>drm/radeon_drm_bo.c<br>
+++ b/src/gallium/winsys/radeon/<wbr>drm/radeon_drm_bo.c<br>
@@ -1157,10 +1157,10 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(<wbr>struct radeon_winsys *rws,<br>
      * The list of pairs is guarded by a mutex, of course. */<br>
     mtx_lock(&ws->bo_handles_<wbr>mutex);<br>
<br>
-    if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+    if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
         /* First check if there already is an existing bo for the handle. */<br>
         bo = util_hash_table_get(ws->bo_<wbr>names, (void*)(uintptr_t)whandle-><wbr>handle);<br>
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
         /* We must first get the GEM handle, as fds are unreliable keys */<br>
         r = drmPrimeFDToHandle(ws->fd, whandle->handle, &handle);<br>
         if (r)<br>
@@ -1184,7 +1184,7 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(<wbr>struct radeon_winsys *rws,<br>
         goto fail;<br>
     }<br>
<br>
-    if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+    if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
         struct drm_gem_open open_arg = {};<br>
         memset(&open_arg, 0, sizeof(open_arg));<br>
         /* Open the BO. */<br>
@@ -1196,7 +1196,7 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(<wbr>struct radeon_winsys *rws,<br>
         handle = open_arg.handle;<br>
         size = open_arg.size;<br>
         bo->flink_name = whandle->handle;<br>
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
         size = lseek(whandle->handle, 0, SEEK_END);<br>
         /* <br>
          * Could check errno to determine whether the kernel is new enough, but<br>
@@ -1301,7 +1301,7 @@ static bool radeon_winsys_bo_get_handle(<wbr>struct pb_buffer *buffer,<br>
<br>
     bo->u.real.use_reusable_pool = false;<br>
<br>
-    if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+    if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
         if (!bo->flink_name) {<br>
             flink.handle = bo->handle;<br>
<br>
@@ -1316,9 +1316,9 @@ static bool radeon_winsys_bo_get_handle(<wbr>struct pb_buffer *buffer,<br>
             mtx_unlock(&ws->bo_handles_<wbr>mutex);<br>
         }<br>
         whandle->handle = bo->flink_name;<br>
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {<br>
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {<br>
         whandle->handle = bo->handle;<br>
-    } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+    } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
         if (drmPrimeHandleToFD(ws->fd, bo->handle, DRM_CLOEXEC, (int*)&whandle->handle))<br>
             return false;<br>
     }<br>
diff --git a/src/gallium/winsys/svga/drm/<wbr>vmw_screen_dri.c b/src/gallium/winsys/svga/drm/<wbr>vmw_screen_dri.c<br>
index 2a0ac7b3337..76f29e2aced 100644<br>
--- a/src/gallium/winsys/svga/drm/<wbr>vmw_screen_dri.c<br>
+++ b/src/gallium/winsys/svga/drm/<wbr>vmw_screen_dri.c<br>
@@ -234,11 +234,11 @@ vmw_drm_surface_from_handle(<wbr>struct svga_winsys_screen *sws,<br>
     }<br>
<br>
     switch (whandle->type) {<br>
-    case DRM_API_HANDLE_TYPE_SHARED:<br>
-    case DRM_API_HANDLE_TYPE_KMS:<br>
+    case WINSYS_HANDLE_TYPE_SHARED:<br>
+    case WINSYS_HANDLE_TYPE_KMS:<br>
        handle = whandle->handle;<br>
        break;<br>
-    case DRM_API_HANDLE_TYPE_FD:<br>
+    case WINSYS_HANDLE_TYPE_FD:<br>
        ret = drmPrimeFDToHandle(vws->ioctl.<wbr>drm_fd, whandle->handle,<br>
                                 &handle);<br>
        if (ret) {<br>
@@ -263,7 +263,7 @@ vmw_drm_surface_from_handle(<wbr>struct svga_winsys_screen *sws,<br>
     /*<br>
      * Need to close the handle we got from prime.<br>
      */<br>
-    if (whandle->type == DRM_API_HANDLE_TYPE_FD)<br>
+    if (whandle->type == WINSYS_HANDLE_TYPE_FD)<br>
        vmw_ioctl_surface_destroy(vws, handle);<br>
<br>
     if (ret) {<br>
@@ -340,11 +340,11 @@ vmw_drm_surface_get_handle(<wbr>struct svga_winsys_screen *sws,<br>
     whandle->offset = 0;<br>
<br>
     switch (whandle->type) {<br>
-    case DRM_API_HANDLE_TYPE_SHARED:<br>
-    case DRM_API_HANDLE_TYPE_KMS:<br>
+    case WINSYS_HANDLE_TYPE_SHARED:<br>
+    case WINSYS_HANDLE_TYPE_KMS:<br>
        whandle->handle = vsrf->sid;<br>
        break;<br>
-    case DRM_API_HANDLE_TYPE_FD:<br>
+    case WINSYS_HANDLE_TYPE_FD:<br>
        ret = drmPrimeHandleToFD(vws->ioctl.<wbr>drm_fd, vsrf->sid, DRM_CLOEXEC,<br>
                                (int *)&whandle->handle);<br>
        if (ret) {<br>
diff --git a/src/gallium/winsys/svga/drm/<wbr>vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/<wbr>vmw_screen_ioctl.c<br>
index 62a2af6d650..16dd5c8593a 100644<br>
--- a/src/gallium/winsys/svga/drm/<wbr>vmw_screen_ioctl.c<br>
+++ b/src/gallium/winsys/svga/drm/<wbr>vmw_screen_ioctl.c<br>
@@ -290,13 +290,13 @@ vmw_ioctl_surface_req(const struct vmw_winsys_screen *vws,<br>
    int ret;<br>
<br>
    switch(whandle->type) {<br>
-   case DRM_API_HANDLE_TYPE_SHARED:<br>
-   case DRM_API_HANDLE_TYPE_KMS:<br>
+   case WINSYS_HANDLE_TYPE_SHARED:<br>
+   case WINSYS_HANDLE_TYPE_KMS:<br>
       *needs_unref = FALSE;<br>
       req->handle_type = DRM_VMW_HANDLE_LEGACY;<br>
       req->sid = whandle->handle;<br>
       break;<br>
-   case DRM_API_HANDLE_TYPE_FD:<br>
+   case WINSYS_HANDLE_TYPE_FD:<br>
       if (!vws->ioctl.have_drm_2_6) {<br>
          uint32_t handle;<br>
<br>
diff --git a/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c<br>
index d842fe3257a..3fe1b1a7313 100644<br>
--- a/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c<br>
+++ b/src/gallium/winsys/sw/kms-<wbr>dri/kms_dri_sw_winsys.c<br>
@@ -385,11 +385,11 @@ kms_sw_displaytarget_from_<wbr>handle(struct sw_winsys *ws,<br>
    struct kms_sw_plane *kms_sw_pl;<br>
<br>
<br>
-   assert(whandle->type == DRM_API_HANDLE_TYPE_KMS ||<br>
-          whandle->type == DRM_API_HANDLE_TYPE_FD);<br>
+   assert(whandle->type == WINSYS_HANDLE_TYPE_KMS ||<br>
+          whandle->type == WINSYS_HANDLE_TYPE_FD);<br>
<br>
    switch(whandle->type) {<br>
-   case DRM_API_HANDLE_TYPE_FD:<br>
+   case WINSYS_HANDLE_TYPE_FD:<br>
       kms_sw_pl = kms_sw_displaytarget_add_from_<wbr>prime(kms_sw, whandle->handle,<br>
                                                       templ->format,<br>
                                                       templ->width0,<br>
@@ -399,7 +399,7 @@ kms_sw_displaytarget_from_<wbr>handle(struct sw_winsys *ws,<br>
       if (kms_sw_pl)<br>
          *stride = kms_sw_pl->stride;<br>
       return sw_displaytarget(kms_sw_pl);<br>
-   case DRM_API_HANDLE_TYPE_KMS:<br>
+   case WINSYS_HANDLE_TYPE_KMS:<br>
       kms_sw_dt = kms_sw_displaytarget_find_and_<wbr>ref(kms_sw, whandle->handle);<br>
       if (kms_sw_dt) {<br>
          struct kms_sw_plane *plane;<br>
@@ -430,12 +430,12 @@ kms_sw_displaytarget_get_<wbr>handle(struct sw_winsys *winsys,<br>
    struct kms_sw_displaytarget *kms_sw_dt = plane->dt;<br>
<br>
    switch(whandle->type) {<br>
-   case DRM_API_HANDLE_TYPE_KMS:<br>
+   case WINSYS_HANDLE_TYPE_KMS:<br>
       whandle->handle = kms_sw_dt->handle;<br>
       whandle->stride = plane->stride;<br>
       whandle->offset = plane->offset;<br>
       return TRUE;<br>
-   case DRM_API_HANDLE_TYPE_FD:<br>
+   case WINSYS_HANDLE_TYPE_FD:<br>
       if (!drmPrimeHandleToFD(kms_sw-><wbr>fd, kms_sw_dt->handle,<br>
                              DRM_CLOEXEC, (int*)&whandle->handle)) {<br>
          whandle->stride = plane->stride;<br>
diff --git a/src/gallium/winsys/virgl/<wbr>drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/<wbr>drm/virgl_drm_winsys.c<br>
index 4198ed7feb3..fb15708ddb1 100644<br>
--- a/src/gallium/winsys/virgl/<wbr>drm/virgl_drm_winsys.c<br>
+++ b/src/gallium/winsys/virgl/<wbr>drm/virgl_drm_winsys.c<br>
@@ -398,7 +398,7 @@ virgl_drm_winsys_resource_<wbr>create_handle(struct virgl_winsys *qws,<br>
<br>
    mtx_lock(&qdws->bo_handles_<wbr>mutex);<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
       res = util_hash_table_get(qdws->bo_<wbr>names, (void*)(uintptr_t)handle);<br>
       if (res) {<br>
          struct virgl_hw_res *r = NULL;<br>
@@ -407,7 +407,7 @@ virgl_drm_winsys_resource_<wbr>create_handle(struct virgl_winsys *qws,<br>
       }<br>
    }<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
       int r;<br>
       r = drmPrimeFDToHandle(qdws->fd, whandle->handle, &handle);<br>
       if (r) {<br>
@@ -428,7 +428,7 @@ virgl_drm_winsys_resource_<wbr>create_handle(struct virgl_winsys *qws,<br>
    if (!res)<br>
       goto done;<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
       res->bo_handle = handle;<br>
    } else {<br>
       fprintf(stderr, "gem open handle %d\n", handle);<br>
@@ -478,7 +478,7 @@ static boolean virgl_drm_winsys_resource_get_<wbr>handle(struct virgl_winsys *qws,<br>
    if (!res)<br>
        return FALSE;<br>
<br>
-   if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {<br>
+   if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {<br>
       if (!res->flinked) {<br>
          memset(&flink, 0, sizeof(flink));<br>
          flink.handle = res->bo_handle;<br>
@@ -494,9 +494,9 @@ static boolean virgl_drm_winsys_resource_get_<wbr>handle(struct virgl_winsys *qws,<br>
          mtx_unlock(&qdws->bo_handles_<wbr>mutex);<br>
       }<br>
       whandle->handle = res->flink;<br>
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {<br>
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {<br>
       whandle->handle = res->bo_handle;<br>
-   } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {<br>
+   } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {<br>
       if (drmPrimeHandleToFD(qdws->fd, res->bo_handle, DRM_CLOEXEC, (int*)&whandle->handle))<br>
             return FALSE;<br>
       mtx_lock(&qdws->bo_handles_<wbr>mutex);<br>
diff --git a/src/mesa/state_tracker/st_<wbr>cb_memoryobjects.c b/src/mesa/state_tracker/st_<wbr>cb_memoryobjects.c<br>
index 63a8c2a0e00..39174bc9f75 100644<br>
--- a/src/mesa/state_tracker/st_<wbr>cb_memoryobjects.c<br>
+++ b/src/mesa/state_tracker/st_<wbr>cb_memoryobjects.c<br>
@@ -65,7 +65,7 @@ st_import_memoryobj_fd(struct gl_context *ctx,<br>
    struct pipe_screen *screen = pipe->screen;<br>
    struct winsys_handle whandle;<br>
<br>
-   whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
    whandle.handle = fd;<br>
    whandle.offset = 0;<br>
    whandle.layer = 0;<br>
diff --git a/src/mesa/state_tracker/st_<wbr>vdpau.c b/src/mesa/state_tracker/st_<wbr>vdpau.c<br>
index eb61aef1116..d0b9cfbf4f8 100644<br>
--- a/src/mesa/state_tracker/st_<wbr>vdpau.c<br>
+++ b/src/mesa/state_tracker/st_<wbr>vdpau.c<br>
@@ -127,7 +127,7 @@ st_vdpau_resource_from_<wbr>description(struct gl_context *ctx,<br>
    templ.usage = PIPE_USAGE_DEFAULT;<br>
<br>
    memset(&whandle, 0, sizeof(whandle));<br>
-   whandle.type = DRM_API_HANDLE_TYPE_FD;<br>
+   whandle.type = WINSYS_HANDLE_TYPE_FD;<br>
    whandle.handle = desc->handle;<br>
    whandle.offset = desc->offset;<br>
    whandle.stride = desc->stride;<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>