virgl: modify resource_create_from_handle(..) callback
This commit makes no functional changes, just adds the revelant plumbing. Reviewed by: Robert Tarasov <tutankhamen@chromium.org>
This commit is contained in:
@@ -507,6 +507,8 @@ static struct pipe_resource *virgl_resource_from_handle(struct pipe_screen *scre
|
|||||||
struct winsys_handle *whandle,
|
struct winsys_handle *whandle,
|
||||||
unsigned usage)
|
unsigned usage)
|
||||||
{
|
{
|
||||||
|
uint32_t winsys_stride, plane_offset, plane;
|
||||||
|
uint64_t modifier;
|
||||||
struct virgl_screen *vs = virgl_screen(screen);
|
struct virgl_screen *vs = virgl_screen(screen);
|
||||||
if (templ->target == PIPE_BUFFER)
|
if (templ->target == PIPE_BUFFER)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -517,7 +519,12 @@ static struct pipe_resource *virgl_resource_from_handle(struct pipe_screen *scre
|
|||||||
pipe_reference_init(&res->u.b.reference, 1);
|
pipe_reference_init(&res->u.b.reference, 1);
|
||||||
virgl_resource_layout(&res->u.b, &res->metadata);
|
virgl_resource_layout(&res->u.b, &res->metadata);
|
||||||
|
|
||||||
res->hw_res = vs->vws->resource_create_from_handle(vs->vws, whandle);
|
plane = winsys_stride = plane_offset = modifier = 0;
|
||||||
|
res->hw_res = vs->vws->resource_create_from_handle(vs->vws, whandle,
|
||||||
|
&plane,
|
||||||
|
&winsys_stride,
|
||||||
|
&plane_offset,
|
||||||
|
&modifier);
|
||||||
if (!res->hw_res) {
|
if (!res->hw_res) {
|
||||||
FREE(res);
|
FREE(res);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -80,7 +80,11 @@ struct virgl_winsys {
|
|||||||
struct virgl_hw_res *res);
|
struct virgl_hw_res *res);
|
||||||
|
|
||||||
struct virgl_hw_res *(*resource_create_from_handle)(struct virgl_winsys *vws,
|
struct virgl_hw_res *(*resource_create_from_handle)(struct virgl_winsys *vws,
|
||||||
struct winsys_handle *whandle);
|
struct winsys_handle *whandle,
|
||||||
|
uint32_t *plane,
|
||||||
|
uint32_t *stride,
|
||||||
|
uint32_t *plane_offset,
|
||||||
|
uint64_t *modifier);
|
||||||
boolean (*resource_get_handle)(struct virgl_winsys *vws,
|
boolean (*resource_get_handle)(struct virgl_winsys *vws,
|
||||||
struct virgl_hw_res *res,
|
struct virgl_hw_res *res,
|
||||||
uint32_t stride,
|
uint32_t stride,
|
||||||
|
@@ -301,7 +301,11 @@ alloc:
|
|||||||
|
|
||||||
static struct virgl_hw_res *
|
static struct virgl_hw_res *
|
||||||
virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
|
virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
|
||||||
struct winsys_handle *whandle)
|
struct winsys_handle *whandle,
|
||||||
|
uint32_t *plane,
|
||||||
|
uint32_t *stride,
|
||||||
|
uint32_t *plane_offset,
|
||||||
|
uint64_t *modifier)
|
||||||
{
|
{
|
||||||
struct virgl_drm_winsys *qdws = virgl_drm_winsys(qws);
|
struct virgl_drm_winsys *qdws = virgl_drm_winsys(qws);
|
||||||
struct drm_gem_open open_arg = {};
|
struct drm_gem_open open_arg = {};
|
||||||
|
Reference in New Issue
Block a user