コード例 #1
0
static boolean
nouveau_drm_name_from_pt(struct drm_api *api, struct pipe_screen *pscreen,
			 struct pipe_texture *pt, unsigned *stride,
			 unsigned *handle)
{
	struct nouveau_miptree *mt = nouveau_miptree(pt);

	if (!mt || !mt->bo)
		return false;

	return nouveau_bo_handle_get(mt->bo, handle) == 0;
}
コード例 #2
0
boolean
nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
			     struct nouveau_bo *bo,
			     unsigned stride,
			     struct winsys_handle *whandle)
{
	whandle->stride = stride;

	if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { 
		return nouveau_bo_handle_get(bo, &whandle->handle) == 0;
	} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
		whandle->handle = bo->handle;
		return TRUE;
	} else {
		return FALSE;
	}
}