Commit b7ac0779 authored by Dave Airlie's avatar Dave Airlie
Browse files

gallium/winsys: rename DRM_API_HANDLE_* to WINSYS_HANDLE_*



This just renames this as we want to add an shm handle which
isn't really drm related.

Originally by: Marc-André Lureau <marcandre.lureau@gmail.com>
(airlied: I used this sed script instead)
This was generated with:
 git grep -l 'DRM_API_' | xargs sed -i 's/DRM_API_/WINSYS_/g'
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
parent d2eaff33
...@@ -98,7 +98,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc, ...@@ -98,7 +98,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc,
/* fill in winsys handle */ /* fill in winsys handle */
memset(out_handle, 0, sizeof(*out_handle)); memset(out_handle, 0, sizeof(*out_handle));
out_handle->type = DRM_API_HANDLE_TYPE_FD; out_handle->type = WINSYS_HANDLE_TYPE_FD;
out_handle->stride = create_dumb.pitch; out_handle->stride = create_dumb.pitch;
err = drmPrimeHandleToFD(ro->kms_fd, create_dumb.handle, O_CLOEXEC, err = drmPrimeHandleToFD(ro->kms_fd, create_dumb.handle, O_CLOEXEC,
...@@ -130,7 +130,7 @@ renderonly_create_gpu_import_for_resource(struct pipe_resource *rsc, ...@@ -130,7 +130,7 @@ renderonly_create_gpu_import_for_resource(struct pipe_resource *rsc,
boolean status; boolean status;
int fd, err; int fd, err;
struct winsys_handle handle = { struct winsys_handle handle = {
.type = DRM_API_HANDLE_TYPE_FD .type = WINSYS_HANDLE_TYPE_FD
}; };
scanout = CALLOC_STRUCT(renderonly_scanout); scanout = CALLOC_STRUCT(renderonly_scanout);
......
...@@ -85,7 +85,7 @@ renderonly_get_handle(struct renderonly_scanout *scanout, ...@@ -85,7 +85,7 @@ renderonly_get_handle(struct renderonly_scanout *scanout,
if (!scanout) if (!scanout)
return FALSE; return FALSE;
assert(handle->type == DRM_API_HANDLE_TYPE_KMS); assert(handle->type == WINSYS_HANDLE_TYPE_KMS);
handle->handle = scanout->handle; handle->handle = scanout->handle;
handle->stride = scanout->stride; handle->stride = scanout->stride;
......
...@@ -231,7 +231,7 @@ vl_dri2_screen_texture_from_drawable(struct vl_screen *vscreen, void *drawable) ...@@ -231,7 +231,7 @@ vl_dri2_screen_texture_from_drawable(struct vl_screen *vscreen, void *drawable)
} }
memset(&dri2_handle, 0, sizeof(dri2_handle)); 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.handle = back_left->name;
dri2_handle.stride = back_left->pitch; dri2_handle.stride = back_left->pitch;
......
...@@ -271,7 +271,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn) ...@@ -271,7 +271,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
pixmap_buffer_texture = buffer->texture; pixmap_buffer_texture = buffer->texture;
} }
memset(&whandle, 0, sizeof(whandle)); memset(&whandle, 0, sizeof(whandle));
whandle.type= DRM_API_HANDLE_TYPE_FD; whandle.type= WINSYS_HANDLE_TYPE_FD;
usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ; usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ;
scrn->base.pscreen->resource_get_handle(scrn->base.pscreen, NULL, scrn->base.pscreen->resource_get_handle(scrn->base.pscreen, NULL,
pixmap_buffer_texture, &whandle, pixmap_buffer_texture, &whandle,
...@@ -492,7 +492,7 @@ dri3_get_front_buffer(struct vl_dri3_screen *scrn) ...@@ -492,7 +492,7 @@ dri3_get_front_buffer(struct vl_dri3_screen *scrn)
goto free_reply; goto free_reply;
memset(&whandle, 0, sizeof(whandle)); memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_FD; whandle.type = WINSYS_HANDLE_TYPE_FD;
whandle.handle = (unsigned)fds[0]; whandle.handle = (unsigned)fds[0];
whandle.stride = bp_reply->stride; whandle.stride = bp_reply->stride;
memset(&templ, 0, sizeof(templ)); memset(&templ, 0, sizeof(templ));
......
...@@ -250,7 +250,7 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout, ...@@ -250,7 +250,7 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,
if (!scanout) if (!scanout)
return NULL; return NULL;
assert(handle.type == DRM_API_HANDLE_TYPE_FD); assert(handle.type == WINSYS_HANDLE_TYPE_FD);
handle.modifier = modifier; handle.modifier = modifier;
rsc = etna_resource(pscreen->resource_from_handle(pscreen, templat, rsc = etna_resource(pscreen->resource_from_handle(pscreen, templat,
&handle, &handle,
...@@ -600,16 +600,16 @@ etna_resource_get_handle(struct pipe_screen *pscreen, ...@@ -600,16 +600,16 @@ etna_resource_get_handle(struct pipe_screen *pscreen,
handle->stride = rsc->levels[0].stride; handle->stride = rsc->levels[0].stride;
handle->modifier = layout_to_modifier(rsc->layout); handle->modifier = layout_to_modifier(rsc->layout);
if (handle->type == DRM_API_HANDLE_TYPE_SHARED) { if (handle->type == WINSYS_HANDLE_TYPE_SHARED) {
return etna_bo_get_name(rsc->bo, &handle->handle) == 0; return etna_bo_get_name(rsc->bo, &handle->handle) == 0;
} else if (handle->type == DRM_API_HANDLE_TYPE_KMS) { } else if (handle->type == WINSYS_HANDLE_TYPE_KMS) {
if (renderonly_get_handle(scanout, handle)) { if (renderonly_get_handle(scanout, handle)) {
return TRUE; return TRUE;
} else { } else {
handle->handle = etna_bo_handle(rsc->bo); handle->handle = etna_bo_handle(rsc->bo);
return TRUE; return TRUE;
} }
} else if (handle->type == DRM_API_HANDLE_TYPE_FD) { } else if (handle->type == WINSYS_HANDLE_TYPE_FD) {
handle->handle = etna_bo_dmabuf(rsc->bo); handle->handle = etna_bo_dmabuf(rsc->bo);
return TRUE; return TRUE;
} else { } else {
......
...@@ -855,9 +855,9 @@ etna_screen_bo_from_handle(struct pipe_screen *pscreen, ...@@ -855,9 +855,9 @@ etna_screen_bo_from_handle(struct pipe_screen *pscreen,
struct etna_screen *screen = etna_screen(pscreen); struct etna_screen *screen = etna_screen(pscreen);
struct etna_bo *bo; struct etna_bo *bo;
if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
bo = etna_bo_from_name(screen->dev, whandle->handle); bo = etna_bo_from_name(screen->dev, whandle->handle);
} else if (whandle->type == DRM_API_HANDLE_TYPE_FD) { } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
bo = etna_bo_from_dmabuf(screen->dev, whandle->handle); bo = etna_bo_from_dmabuf(screen->dev, whandle->handle);
} else { } else {
DBG("Attempt to import unsupported handle type %d", whandle->type); DBG("Attempt to import unsupported handle type %d", whandle->type);
......
...@@ -729,12 +729,12 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen, ...@@ -729,12 +729,12 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen,
{ {
whandle->stride = stride; 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; 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); whandle->handle = fd_bo_handle(bo);
return TRUE; 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); whandle->handle = fd_bo_dmabuf(bo);
return TRUE; return TRUE;
} else { } else {
...@@ -749,11 +749,11 @@ fd_screen_bo_from_handle(struct pipe_screen *pscreen, ...@@ -749,11 +749,11 @@ fd_screen_bo_from_handle(struct pipe_screen *pscreen,
struct fd_screen *screen = fd_screen(pscreen); struct fd_screen *screen = fd_screen(pscreen);
struct fd_bo *bo; 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); 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); 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); bo = fd_bo_from_dmabuf(screen->dev, whandle->handle);
} else { } else {
DBG("Attempt to import unsupported handle type %d", whandle->type); DBG("Attempt to import unsupported handle type %d", whandle->type);
......
...@@ -102,14 +102,14 @@ nouveau_screen_bo_from_handle(struct pipe_screen *pscreen, ...@@ -102,14 +102,14 @@ nouveau_screen_bo_from_handle(struct pipe_screen *pscreen,
return NULL; return NULL;
} }
if (whandle->type != DRM_API_HANDLE_TYPE_SHARED && if (whandle->type != WINSYS_HANDLE_TYPE_SHARED &&
whandle->type != DRM_API_HANDLE_TYPE_FD) { whandle->type != WINSYS_HANDLE_TYPE_FD) {
debug_printf("%s: attempt to import unsupported handle type %d\n", debug_printf("%s: attempt to import unsupported handle type %d\n",
__FUNCTION__, whandle->type); __FUNCTION__, whandle->type);
return NULL; 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); ret = nouveau_bo_name_ref(dev, whandle->handle, &bo);
else else
ret = nouveau_bo_prime_handle_ref(dev, whandle->handle, &bo); ret = nouveau_bo_prime_handle_ref(dev, whandle->handle, &bo);
...@@ -133,12 +133,12 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen, ...@@ -133,12 +133,12 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
{ {
whandle->stride = stride; 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; 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; whandle->handle = bo->handle;
return true; 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; return nouveau_bo_set_prime(bo, (int *)&whandle->handle) == 0;
} else { } else {
return false; return false;
......
...@@ -713,7 +713,7 @@ static boolean si_texture_get_handle(struct pipe_screen* screen, ...@@ -713,7 +713,7 @@ static boolean si_texture_get_handle(struct pipe_screen* screen,
rtex->surface.tile_swizzle || rtex->surface.tile_swizzle ||
(rtex->buffer.flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && (rtex->buffer.flags & RADEON_FLAG_NO_INTERPROCESS_SHARING &&
sscreen->info.has_local_buffers && sscreen->info.has_local_buffers &&
whandle->type != DRM_API_HANDLE_TYPE_KMS)) { whandle->type != WINSYS_HANDLE_TYPE_KMS)) {
assert(!res->b.is_shared); assert(!res->b.is_shared);
si_reallocate_texture_inplace(sctx, rtex, si_reallocate_texture_inplace(sctx, rtex,
PIPE_BIND_SHARED, false); PIPE_BIND_SHARED, false);
......
...@@ -228,7 +228,7 @@ static int tegra_screen_import_resource(struct tegra_screen *screen, ...@@ -228,7 +228,7 @@ static int tegra_screen_import_resource(struct tegra_screen *screen,
memset(&handle, 0, sizeof(handle)); memset(&handle, 0, sizeof(handle));
handle.modifier = DRM_FORMAT_MOD_INVALID; handle.modifier = DRM_FORMAT_MOD_INVALID;
handle.type = DRM_API_HANDLE_TYPE_FD; handle.type = WINSYS_HANDLE_TYPE_FD;
status = screen->gpu->resource_get_handle(screen->gpu, NULL, resource->gpu, status = screen->gpu->resource_get_handle(screen->gpu, NULL, resource->gpu,
&handle, usage); &handle, usage);
...@@ -386,7 +386,7 @@ tegra_screen_resource_get_handle(struct pipe_screen *pscreen, ...@@ -386,7 +386,7 @@ tegra_screen_resource_get_handle(struct pipe_screen *pscreen,
* to pass buffers into Tegra DRM for display. In all other cases, return * to pass buffers into Tegra DRM for display. In all other cases, return
* the Nouveau handle, assuming they will be used for sharing in DRI2/3. * the Nouveau handle, assuming they will be used for sharing in DRI2/3.
*/ */
if (handle->type == DRM_API_HANDLE_TYPE_KMS && if (handle->type == WINSYS_HANDLE_TYPE_KMS &&
presource->bind & PIPE_BIND_SCANOUT) { presource->bind & PIPE_BIND_SCANOUT) {
handle->modifier = resource->modifier; handle->modifier = resource->modifier;
handle->handle = resource->handle; handle->handle = resource->handle;
......
...@@ -324,12 +324,12 @@ v3d_resource_get_handle(struct pipe_screen *pscreen, ...@@ -324,12 +324,12 @@ v3d_resource_get_handle(struct pipe_screen *pscreen,
bo->private = false; bo->private = false;
switch (whandle->type) { switch (whandle->type) {
case DRM_API_HANDLE_TYPE_SHARED: case WINSYS_HANDLE_TYPE_SHARED:
return v3d_bo_flink(bo, &whandle->handle); return v3d_bo_flink(bo, &whandle->handle);
case DRM_API_HANDLE_TYPE_KMS: case WINSYS_HANDLE_TYPE_KMS:
whandle->handle = bo->handle; whandle->handle = bo->handle;
return TRUE; return TRUE;
case DRM_API_HANDLE_TYPE_FD: case WINSYS_HANDLE_TYPE_FD:
whandle->handle = v3d_bo_get_dmabuf(bo); whandle->handle = v3d_bo_get_dmabuf(bo);
return whandle->handle != -1; return whandle->handle != -1;
} }
...@@ -715,11 +715,11 @@ v3d_resource_from_handle(struct pipe_screen *pscreen, ...@@ -715,11 +715,11 @@ v3d_resource_from_handle(struct pipe_screen *pscreen,
} }
switch (whandle->type) { switch (whandle->type) {
case DRM_API_HANDLE_TYPE_SHARED: case WINSYS_HANDLE_TYPE_SHARED:
rsc->bo = v3d_bo_open_name(screen, rsc->bo = v3d_bo_open_name(screen,
whandle->handle, whandle->stride); whandle->handle, whandle->stride);
break; break;
case DRM_API_HANDLE_TYPE_FD: case WINSYS_HANDLE_TYPE_FD:
rsc->bo = v3d_bo_open_dmabuf(screen, rsc->bo = v3d_bo_open_dmabuf(screen,
whandle->handle, whandle->stride); whandle->handle, whandle->stride);
break; break;
......
...@@ -403,7 +403,7 @@ vc4_resource_get_handle(struct pipe_screen *pscreen, ...@@ -403,7 +403,7 @@ vc4_resource_get_handle(struct pipe_screen *pscreen,
whandle->modifier = DRM_FORMAT_MOD_LINEAR; whandle->modifier = DRM_FORMAT_MOD_LINEAR;
switch (whandle->type) { switch (whandle->type) {
case DRM_API_HANDLE_TYPE_SHARED: case WINSYS_HANDLE_TYPE_SHARED:
if (screen->ro) { if (screen->ro) {
/* This could probably be supported, assuming that a /* This could probably be supported, assuming that a
* control node was used for pl111. * control node was used for pl111.
...@@ -413,12 +413,12 @@ vc4_resource_get_handle(struct pipe_screen *pscreen, ...@@ -413,12 +413,12 @@ vc4_resource_get_handle(struct pipe_screen *pscreen,
} }
return vc4_bo_flink(rsc->bo, &whandle->handle); return vc4_bo_flink(rsc->bo, &whandle->handle);
case DRM_API_HANDLE_TYPE_KMS: case WINSYS_HANDLE_TYPE_KMS:
if (screen->ro && renderonly_get_handle(rsc->scanout, whandle)) if (screen->ro && renderonly_get_handle(rsc->scanout, whandle))
return TRUE; return TRUE;
whandle->handle = rsc->bo->handle; whandle->handle = rsc->bo->handle;
return TRUE; return TRUE;
case DRM_API_HANDLE_TYPE_FD: case WINSYS_HANDLE_TYPE_FD:
/* FDs are cross-device, so we can export directly from vc4. /* FDs are cross-device, so we can export directly from vc4.
*/ */
whandle->handle = vc4_bo_get_dmabuf(rsc->bo); whandle->handle = vc4_bo_get_dmabuf(rsc->bo);
...@@ -708,11 +708,11 @@ vc4_resource_from_handle(struct pipe_screen *pscreen, ...@@ -708,11 +708,11 @@ vc4_resource_from_handle(struct pipe_screen *pscreen,
return NULL; return NULL;
switch (whandle->type) { switch (whandle->type) {
case DRM_API_HANDLE_TYPE_SHARED: case WINSYS_HANDLE_TYPE_SHARED:
rsc->bo = vc4_bo_open_name(screen, rsc->bo = vc4_bo_open_name(screen,
whandle->handle, whandle->stride); whandle->handle, whandle->stride);
break; break;
case DRM_API_HANDLE_TYPE_FD: case WINSYS_HANDLE_TYPE_FD:
rsc->bo = vc4_bo_open_dmabuf(screen, rsc->bo = vc4_bo_open_dmabuf(screen,
whandle->handle, whandle->stride); whandle->handle, whandle->stride);
break; break;
......
...@@ -191,7 +191,7 @@ struct pipe_screen { ...@@ -191,7 +191,7 @@ struct pipe_screen {
* another process by first creating a pipe texture and then calling * another process by first creating a pipe texture and then calling
* resource_get_handle. * resource_get_handle.
* *
* NOTE: in the case of DRM_API_HANDLE_TYPE_FD handles, the caller * NOTE: in the case of WINSYS_HANDLE_TYPE_FD handles, the caller
* retains ownership of the FD. (This is consistent with * retains ownership of the FD. (This is consistent with
* EGL_EXT_image_dma_buf_import) * EGL_EXT_image_dma_buf_import)
* *
...@@ -238,7 +238,7 @@ struct pipe_screen { ...@@ -238,7 +238,7 @@ struct pipe_screen {
* the resource into a format compatible for sharing. The use case is * the resource into a format compatible for sharing. The use case is
* OpenGL-OpenCL interop. The context parameter is allowed to be NULL. * OpenGL-OpenCL interop. The context parameter is allowed to be NULL.
* *
* NOTE: in the case of DRM_API_HANDLE_TYPE_FD handles, the caller * NOTE: in the case of WINSYS_HANDLE_TYPE_FD handles, the caller
* takes ownership of the FD. (This is consistent with * takes ownership of the FD. (This is consistent with
* EGL_MESA_image_dma_buf_export) * EGL_MESA_image_dma_buf_export)
* *
...@@ -389,7 +389,7 @@ struct pipe_screen { ...@@ -389,7 +389,7 @@ struct pipe_screen {
* Then the underlying memory object is then exported through interfaces * Then the underlying memory object is then exported through interfaces
* compatible with EXT_external_resources. * compatible with EXT_external_resources.
* *
* Note: For DRM_API_HANDLE_TYPE_FD handles, the caller retains ownership * Note: For WINSYS_HANDLE_TYPE_FD handles, the caller retains ownership
* of the fd. * of the fd.
* *
* \param handle A handle representing the memory object to import * \param handle A handle representing the memory object to import
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
extern "C" { extern "C" {
#endif #endif
#define DRM_API_HANDLE_TYPE_SHARED 0 #define WINSYS_HANDLE_TYPE_SHARED 0
#define DRM_API_HANDLE_TYPE_KMS 1 #define WINSYS_HANDLE_TYPE_KMS 1
#define DRM_API_HANDLE_TYPE_FD 2 #define WINSYS_HANDLE_TYPE_FD 2
/** /**
* For use with pipe_screen::{texture_from_handle|texture_get_handle}. * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
......
...@@ -620,9 +620,9 @@ dri2_allocate_buffer(__DRIscreen *sPriv, ...@@ -620,9 +620,9 @@ dri2_allocate_buffer(__DRIscreen *sPriv,
memset(&whandle, 0, sizeof(whandle)); memset(&whandle, 0, sizeof(whandle));
if (screen->can_share_buffer) if (screen->can_share_buffer)
whandle.type = DRM_API_HANDLE_TYPE_SHARED; whandle.type = WINSYS_HANDLE_TYPE_SHARED;
else else
whandle.type = DRM_API_HANDLE_TYPE_KMS; whandle.type = WINSYS_HANDLE_TYPE_KMS;
screen->base.screen->resource_get_handle(screen->base.screen, NULL, screen->base.screen->resource_get_handle(screen->base.screen, NULL,
buffer->resource, &whandle, buffer->resource, &whandle,
...@@ -808,9 +808,9 @@ dri2_allocate_textures(struct dri_context *ctx, ...@@ -808,9 +808,9 @@ dri2_allocate_textures(struct dri_context *ctx,
whandle.offset = 0; whandle.offset = 0;
whandle.modifier = DRM_FORMAT_MOD_INVALID; whandle.modifier = DRM_FORMAT_MOD_INVALID;
if (screen->can_share_buffer) if (screen->can_share_buffer)
whandle.type = DRM_API_HANDLE_TYPE_SHARED; whandle.type = WINSYS_HANDLE_TYPE_SHARED;
else else
whandle.type = DRM_API_HANDLE_TYPE_KMS; whandle.type = WINSYS_HANDLE_TYPE_KMS;
drawable->textures[statt] = drawable->textures[statt] =
screen->base.screen->resource_from_handle(screen->base.screen, screen->base.screen->resource_from_handle(screen->base.screen,
&templ, &whandle, &templ, &whandle,
...@@ -1068,7 +1068,7 @@ dri2_create_image_from_name(__DRIscreen *_screen, ...@@ -1068,7 +1068,7 @@ dri2_create_image_from_name(__DRIscreen *_screen,
enum pipe_format pf; enum pipe_format pf;
memset(&whandle, 0, sizeof(whandle)); memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_SHARED; whandle.type = WINSYS_HANDLE_TYPE_SHARED;
whandle.handle = name; whandle.handle = name;
whandle.modifier = DRM_FORMAT_MOD_INVALID; whandle.modifier = DRM_FORMAT_MOD_INVALID;
...@@ -1127,7 +1127,7 @@ dri2_create_image_from_fd(__DRIscreen *_screen, ...@@ -1127,7 +1127,7 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
goto exit; goto exit;
} }
whandles[i].type = DRM_API_HANDLE_TYPE_FD; whandles[i].type = WINSYS_HANDLE_TYPE_FD;
whandles[i].handle = (unsigned)fds[i]; whandles[i].handle = (unsigned)fds[i];
whandles[i].stride = (unsigned)strides[i]; whandles[i].stride = (unsigned)strides[i];
whandles[i].offset = (unsigned)offsets[i]; whandles[i].offset = (unsigned)offsets[i];
...@@ -1267,35 +1267,35 @@ dri2_query_image(__DRIimage *image, int attrib, int *value) ...@@ -1267,35 +1267,35 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
switch (attrib) { switch (attrib) {
case __DRI_IMAGE_ATTRIB_STRIDE: case __DRI_IMAGE_ATTRIB_STRIDE:
whandle.type = DRM_API_HANDLE_TYPE_KMS; whandle.type = WINSYS_HANDLE_TYPE_KMS;
if (!image->texture->screen->resource_get_handle(image->texture->screen, if (!image->texture->screen->resource_get_handle(image->texture->screen,
NULL, image->texture, &whandle, usage)) NULL, image->texture, &whandle, usage))
return GL_FALSE; return GL_FALSE;
*value = whandle.stride; *value = whandle.stride;
return GL_TRUE; return GL_TRUE;
case __DRI_IMAGE_ATTRIB_OFFSET: case __DRI_IMAGE_ATTRIB_OFFSET:
whandle.type = DRM_API_HANDLE_TYPE_KMS; whandle.type = WINSYS_HANDLE_TYPE_KMS;
if (!image->texture->screen->resource_get_handle(image->texture->screen, if (!image->texture->screen->resource_get_handle(image->texture->screen,
NULL, image->texture, &whandle, usage)) NULL, image->texture, &whandle, usage))
return GL_FALSE; return GL_FALSE;
*value = whandle.offset; *value = whandle.offset;
return GL_TRUE; return GL_TRUE;
case __DRI_IMAGE_ATTRIB_HANDLE: case __DRI_IMAGE_ATTRIB_HANDLE:
whandle.type = DRM_API_HANDLE_TYPE_KMS; whandle.type = WINSYS_HANDLE_TYPE_KMS;
if (!image->texture->screen->resource_get_handle(image->texture->screen, if (!image->texture->screen->resource_get_handle(image->texture->screen,
NULL, image->texture, &whandle, usage)) NULL, image->texture, &whandle, usage))
return GL_FALSE; return GL_FALSE;
*value = whandle.handle; *value = whandle.handle;
return GL_TRUE; return GL_TRUE;
case __DRI_IMAGE_ATTRIB_NAME: case __DRI_IMAGE_ATTRIB_NAME:
whandle.type = DRM_API_HANDLE_TYPE_SHARED; whandle.type = WINSYS_HANDLE_TYPE_SHARED;
if (!image->texture->screen->resource_get_handle(image->texture->screen, if (!image->texture->screen->resource_get_handle(image->texture->screen,
NULL, image->texture, &whandle, usage)) NULL, image->texture, &whandle, usage))
return GL_FALSE; return GL_FALSE;
*value = whandle.handle; *value = whandle.handle;
return GL_TRUE; return GL_TRUE;
case __DRI_IMAGE_ATTRIB_FD: case __DRI_IMAGE_ATTRIB_FD:
whandle.type= DRM_API_HANDLE_TYPE_FD; whandle.type= WINSYS_HANDLE_TYPE_FD;
if (!image->texture->screen->resource_get_handle(image->texture->screen, if (!image->texture->screen->resource_get_handle(image->texture->screen,
NULL, image->texture, &whandle, usage)) NULL, image->texture, &whandle, usage))
return GL_FALSE; return GL_FALSE;
...@@ -1323,7 +1323,7 @@ dri2_query_image(__DRIimage *image, int attrib, int *value) ...@@ -1323,7 +1323,7 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
*value = 1; *value = 1;
return GL_TRUE; return GL_TRUE;
case __DRI_IMAGE_ATTRIB_MODIFIER_UPPER: case __DRI_IMAGE_ATTRIB_MODIFIER_UPPER:
whandle.type = DRM_API_HANDLE_TYPE_KMS; whandle.type = WINSYS_HANDLE_TYPE_KMS;
whandle.modifier = DRM_FORMAT_MOD_INVALID; whandle.modifier = DRM_FORMAT_MOD_INVALID;
if (!image->texture->screen->