if (rsc->external)
rsc = etna_resource(rsc->external);
- if (handle->type == DRM_API_HANDLE_TYPE_KMS &&
- renderonly_get_handle(scanout, handle))
+ handle->stride = rsc->levels[0].stride;
+
+ if (handle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ return etna_bo_get_name(rsc->bo, &handle->handle) == 0;
+ } else if (handle->type == DRM_API_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) {
+ handle->handle = etna_bo_dmabuf(rsc->bo);
return TRUE;
-
- return etna_screen_bo_get_handle(pscreen, rsc->bo, rsc->levels[0].stride,
- handle);
+ } else {
+ return FALSE;
+ }
}
void
return false;
}
-boolean
-etna_screen_bo_get_handle(struct pipe_screen *pscreen, struct etna_bo *bo,
- unsigned stride, struct winsys_handle *whandle)
-{
- whandle->stride = stride;
-
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
- return etna_bo_get_name(bo, &whandle->handle) == 0;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
- whandle->handle = etna_bo_handle(bo);
- return TRUE;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
- whandle->handle = etna_bo_dmabuf(bo);
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
struct etna_bo *
etna_screen_bo_from_handle(struct pipe_screen *pscreen,
struct winsys_handle *whandle, unsigned *out_stride)
return (struct etna_screen *)pscreen;
}
-boolean
-etna_screen_bo_get_handle(struct pipe_screen *pscreen, struct etna_bo *bo,
- unsigned stride, struct winsys_handle *whandle);
-
struct etna_bo *
etna_screen_bo_from_handle(struct pipe_screen *pscreen,
struct winsys_handle *whandle, unsigned *out_stride);