virgl: modify resource_create_from_handle(..) callback
authorGurchetan Singh <gurchetansingh@chromium.org>
Wed, 25 Sep 2019 17:06:23 +0000 (10:06 -0700)
committerGurchetan Singh <gurchetansingh@chromium.org>
Thu, 3 Oct 2019 00:57:47 +0000 (17:57 -0700)
This commit makes no functional changes, just adds the revelant
plumbing.

Reviewed by: Robert Tarasov <tutankhamen@chromium.org>

src/gallium/drivers/virgl/virgl_resource.c
src/gallium/drivers/virgl/virgl_winsys.h
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c

index ca4db39dab1f4ecc67a63dbbd58814d61c4ac2ea..530f8e57fe79211619695438918f41b6307e7708 100644 (file)
@@ -507,6 +507,8 @@ static struct pipe_resource *virgl_resource_from_handle(struct pipe_screen *scre
                                                         struct winsys_handle *whandle,
                                                         unsigned usage)
 {
+   uint32_t winsys_stride, plane_offset, plane;
+   uint64_t modifier;
    struct virgl_screen *vs = virgl_screen(screen);
    if (templ->target == PIPE_BUFFER)
       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);
    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) {
       FREE(res);
       return NULL;
index 9abfec6898bc97451a00a62169c37671bb88344d..97885c999550af4fb011305a26f33cd8c4fc9a13 100644 (file)
@@ -80,7 +80,11 @@ struct virgl_winsys {
                                struct virgl_hw_res *res);
 
    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,
                                   struct virgl_hw_res *res,
                                   uint32_t stride,
index 741064a958cd2017da9694538ac86ad2385f3897..01e1f51d757487bb22511e5181c0ff9ea061cc0f 100644 (file)
@@ -301,7 +301,11 @@ alloc:
 
 static struct virgl_hw_res *
 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 drm_gem_open open_arg = {};