/* fill in winsys 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;
err = drmPrimeHandleToFD(ro->kms_fd, create_dumb.handle, O_CLOEXEC,
boolean status;
int fd, err;
struct winsys_handle handle = {
- .type = DRM_API_HANDLE_TYPE_FD
+ .type = WINSYS_HANDLE_TYPE_FD
};
scanout = CALLOC_STRUCT(renderonly_scanout);
if (!scanout)
return FALSE;
- assert(handle->type == DRM_API_HANDLE_TYPE_KMS);
+ assert(handle->type == WINSYS_HANDLE_TYPE_KMS);
handle->handle = scanout->handle;
handle->stride = scanout->stride;
}
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;
pixmap_buffer_texture = buffer->texture;
}
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;
scrn->base.pscreen->resource_get_handle(scrn->base.pscreen, NULL,
pixmap_buffer_texture, &whandle,
goto free_reply;
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
whandle.handle = (unsigned)fds[0];
whandle.stride = bp_reply->stride;
memset(&templ, 0, sizeof(templ));
if (!scanout)
return NULL;
- assert(handle.type == DRM_API_HANDLE_TYPE_FD);
+ assert(handle.type == WINSYS_HANDLE_TYPE_FD);
handle.modifier = modifier;
rsc = etna_resource(pscreen->resource_from_handle(pscreen, templat,
&handle,
handle->stride = rsc->levels[0].stride;
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;
- } else if (handle->type == DRM_API_HANDLE_TYPE_KMS) {
+ } else if (handle->type == WINSYS_HANDLE_TYPE_KMS) {
if (renderonly_get_handle(scanout, handle)) {
return TRUE;
} else {
handle->handle = etna_bo_handle(rsc->bo);
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);
return TRUE;
} else {
struct etna_screen *screen = etna_screen(pscreen);
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);
- } 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);
} else {
DBG("Attempt to import unsupported handle type %d", whandle->type);
{
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 {
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);
return NULL;
}
- 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);
{
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;
rtex->surface.tile_swizzle ||
(rtex->buffer.flags & RADEON_FLAG_NO_INTERPROCESS_SHARING &&
sscreen->info.has_local_buffers &&
- whandle->type != DRM_API_HANDLE_TYPE_KMS)) {
+ whandle->type != WINSYS_HANDLE_TYPE_KMS)) {
assert(!res->b.is_shared);
si_reallocate_texture_inplace(sctx, rtex,
PIPE_BIND_SHARED, false);
memset(&handle, 0, sizeof(handle));
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,
&handle, usage);
* 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.
*/
- if (handle->type == DRM_API_HANDLE_TYPE_KMS &&
+ if (handle->type == WINSYS_HANDLE_TYPE_KMS &&
presource->bind & PIPE_BIND_SCANOUT) {
handle->modifier = resource->modifier;
handle->handle = resource->handle;
bo->private = false;
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
return v3d_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 = v3d_bo_get_dmabuf(bo);
return whandle->handle != -1;
}
}
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
rsc->bo = v3d_bo_open_name(screen,
whandle->handle, whandle->stride);
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
rsc->bo = v3d_bo_open_dmabuf(screen,
whandle->handle, whandle->stride);
break;
whandle->modifier = DRM_FORMAT_MOD_LINEAR;
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
if (screen->ro) {
/* This could probably be supported, assuming that a
* control node was used for pl111.
}
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))
return TRUE;
whandle->handle = rsc->bo->handle;
return TRUE;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
/* FDs are cross-device, so we can export directly from vc4.
*/
whandle->handle = vc4_bo_get_dmabuf(rsc->bo);
return NULL;
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
rsc->bo = vc4_bo_open_name(screen,
whandle->handle, whandle->stride);
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
rsc->bo = vc4_bo_open_dmabuf(screen,
whandle->handle, whandle->stride);
break;
* another process by first creating a pipe texture and then calling
* 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
* EGL_EXT_image_dma_buf_import)
*
* the resource into a format compatible for sharing. The use case is
* 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
* EGL_MESA_image_dma_buf_export)
*
* Then the underlying memory object is then exported through interfaces
* 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.
*
* \param handle A handle representing the memory object to import
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}.
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, NULL,
buffer->resource, &whandle,
whandle.offset = 0;
whandle.modifier = DRM_FORMAT_MOD_INVALID;
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,
enum pipe_format pf;
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+ whandle.type = WINSYS_HANDLE_TYPE_SHARED;
whandle.handle = name;
whandle.modifier = DRM_FORMAT_MOD_INVALID;
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].stride = (unsigned)strides[i];
whandles[i].offset = (unsigned)offsets[i];
switch (attrib) {
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,
NULL, image->texture, &whandle, usage))
return GL_FALSE;
*value = whandle.stride;
return GL_TRUE;
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,
NULL, image->texture, &whandle, usage))
return GL_FALSE;
*value = whandle.offset;
return GL_TRUE;
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,
NULL, image->texture, &whandle, usage))
return GL_FALSE;
*value = whandle.handle;
return GL_TRUE;
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,
NULL, image->texture, &whandle, usage))
return GL_FALSE;
*value = whandle.handle;
return GL_TRUE;
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,
NULL, image->texture, &whandle, usage))
return GL_FALSE;
*value = 1;
return GL_TRUE;
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;
if (!image->texture->screen->resource_get_handle(image->texture->screen,
NULL, image->texture, &whandle, usage))
*value = (whandle.modifier >> 32) & 0xffffffff;
return GL_TRUE;
case __DRI_IMAGE_ATTRIB_MODIFIER_LOWER:
- whandle.type = DRM_API_HANDLE_TYPE_KMS;
+ whandle.type = WINSYS_HANDLE_TYPE_KMS;
whandle.modifier = DRM_FORMAT_MOD_INVALID;
if (!image->texture->screen->resource_get_handle(image->texture->screen,
NULL, image->texture, &whandle, usage))
return NULL;
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+ whandle.type = WINSYS_HANDLE_TYPE_SHARED;
whandle.handle = names[0];
whandle.stride = strides[0];
whandle.offset = offsets[0];
}
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
success = screen->resource_get_handle(screen, st->pipe, res, &whandle,
usage);
HRESULT hr;
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, pipe, resource,
&whandle,
for_frontbuffer_reading ?
drv->pipe->flush(drv->pipe, NULL, 0);
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
if (!screen->resource_get_handle(screen, drv->pipe,
buf->derived_surface.resource,
res_templ.usage = PIPE_USAGE_DEFAULT;
memset(&whandle, 0, sizeof(struct winsys_handle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
whandle.handle = memory_attribute->buffers[index];
// Create a resource for each plane.
}
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
if (!screen->resource_get_handle(screen, drv->pipe, resource,
&whandle, usage)) {
vlsurface->device->context->flush(vlsurface->device->context, NULL, 0);
memset(&whandle, 0, sizeof(struct winsys_handle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
pscreen = vlsurface->surface->texture->screen;
if (!pscreen->resource_get_handle(pscreen, vlsurface->device->context,
}
memset(&whandle, 0, sizeof(struct winsys_handle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
whandle.layer = surf->u.tex.first_layer;
pscreen = surf->texture->screen;
{
switch (type) {
case xa_handle_type_kms:
- return DRM_API_HANDLE_TYPE_KMS;
+ return WINSYS_HANDLE_TYPE_KMS;
case xa_handle_type_fd:
- return DRM_API_HANDLE_TYPE_FD;
+ return WINSYS_HANDLE_TYPE_FD;
case xa_handle_type_shared:
default:
- return DRM_API_HANDLE_TYPE_SHARED;
+ return WINSYS_HANDLE_TYPE_SHARED;
}
}
uint32_t handle, uint32_t stride)
{
return xa_surface_from_handle2(xa, width, height, depth, stype, xa_format,
- DRM_API_HANDLE_TYPE_SHARED, flags, handle,
+ WINSYS_HANDLE_TYPE_SHARED, flags, handle,
stride);
}
}
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
type = amdgpu_bo_handle_type_gem_flink_name;
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
type = amdgpu_bo_handle_type_dma_buf_fd;
break;
default:
bo->u.real.use_reusable_pool = false;
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
type = amdgpu_bo_handle_type_gem_flink_name;
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
type = amdgpu_bo_handle_type_dma_buf_fd;
break;
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_KMS:
type = amdgpu_bo_handle_type_kms;
break;
default:
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;
if (whandle->offset != 0)
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);
}
{
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;
}
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 if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
int fd;
if (drm_intel_bo_gem_export_to_prime(buf->bo, &fd))
* The list of pairs is guarded by a mutex, of course. */
mtx_lock(&ws->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(ws->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)
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. */
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
bo->u.real.use_reusable_pool = false;
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
if (!bo->flink_name) {
flink.handle = bo->handle;
mtx_unlock(&ws->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(ws->fd, bo->handle, DRM_CLOEXEC, (int*)&whandle->handle))
return false;
}
}
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) {
/*
* 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) {
whandle->offset = 0;
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) {
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;
struct kms_sw_plane *kms_sw_pl;
- 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_pl = kms_sw_displaytarget_add_from_prime(kms_sw, whandle->handle,
templ->format,
templ->width0,
if (kms_sw_pl)
*stride = kms_sw_pl->stride;
return sw_displaytarget(kms_sw_pl);
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_KMS:
kms_sw_dt = kms_sw_displaytarget_find_and_ref(kms_sw, whandle->handle);
if (kms_sw_dt) {
struct kms_sw_plane *plane;
struct kms_sw_displaytarget *kms_sw_dt = plane->dt;
switch(whandle->type) {
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_KMS:
whandle->handle = kms_sw_dt->handle;
whandle->stride = plane->stride;
whandle->offset = plane->offset;
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 = plane->stride;
mtx_lock(&qdws->bo_handles_mutex);
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
res = util_hash_table_get(qdws->bo_names, (void*)(uintptr_t)handle);
if (res) {
struct virgl_hw_res *r = NULL;
}
}
- if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
int r;
r = drmPrimeFDToHandle(qdws->fd, whandle->handle, &handle);
if (r) {
if (!res)
goto done;
- if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
res->bo_handle = handle;
} else {
fprintf(stderr, "gem open handle %d\n", handle);
if (!res)
return FALSE;
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
if (!res->flinked) {
memset(&flink, 0, sizeof(flink));
flink.handle = res->bo_handle;
mtx_unlock(&qdws->bo_handles_mutex);
}
whandle->handle = res->flink;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
whandle->handle = res->bo_handle;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
if (drmPrimeHandleToFD(qdws->fd, res->bo_handle, DRM_CLOEXEC, (int*)&whandle->handle))
return FALSE;
mtx_lock(&qdws->bo_handles_mutex);
struct pipe_screen *screen = pipe->screen;
struct winsys_handle whandle;
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
whandle.handle = fd;
whandle.offset = 0;
whandle.layer = 0;
templ.usage = PIPE_USAGE_DEFAULT;
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
whandle.handle = desc->handle;
whandle.offset = desc->offset;
whandle.stride = desc->stride;