diff options
author | Marek Olšák <[email protected]> | 2018-10-25 15:33:00 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-10-30 16:03:02 -0400 |
commit | 8ad12c8bec4bd20ea4241e412b477a155a42186b (patch) | |
tree | 4155600e79320d788e4f1df43e2b9230b5f67684 /src/gallium/state_trackers/dri | |
parent | 00fc56a68d21d7aa91b95f0eaacba59a96c466f5 (diff) |
gallium: rework PIPE_HANDLE_USAGE_* flags
Only radeonsi uses them, so adjust them to match its needs.
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r-- | src/gallium/state_trackers/dri/dri2.c | 18 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/drisw.c | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index 2fb3e592844..a09787bb215 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -651,7 +651,7 @@ dri2_allocate_buffer(__DRIscreen *sPriv, screen->base.screen->resource_get_handle(screen->base.screen, NULL, buffer->resource, &whandle, - PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ); + PIPE_HANDLE_USAGE_EXPLICIT_FLUSH); buffer->base.attachment = attachment; buffer->base.name = whandle.handle; @@ -839,7 +839,7 @@ dri2_allocate_textures(struct dri_context *ctx, drawable->textures[statt] = screen->base.screen->resource_from_handle(screen->base.screen, &templ, &whandle, - PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ); + PIPE_HANDLE_USAGE_EXPLICIT_FLUSH); assert(drawable->textures[statt]); } } @@ -1067,7 +1067,7 @@ dri2_create_image_from_winsys(__DRIscreen *_screen, } tex = pscreen->resource_from_handle(pscreen, - &templ, &whandle[i], PIPE_HANDLE_USAGE_READ_WRITE); + &templ, &whandle[i], PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE); if (!tex) { pipe_resource_reference(&img->texture, NULL); FREE(img); @@ -1287,9 +1287,9 @@ dri2_query_image(__DRIimage *image, int attrib, int *value) unsigned usage; if (image->use & __DRI_IMAGE_USE_BACKBUFFER) - usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ; + usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH; else - usage = PIPE_HANDLE_USAGE_READ_WRITE; + usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE; memset(&whandle, 0, sizeof(whandle)); @@ -1966,14 +1966,12 @@ dri2_interop_export_object(__DRIcontext *_ctx, /* Get the handle. */ switch (in->access) { - case MESA_GLINTEROP_ACCESS_READ_WRITE: - usage = PIPE_HANDLE_USAGE_READ_WRITE; - break; case MESA_GLINTEROP_ACCESS_READ_ONLY: - usage = PIPE_HANDLE_USAGE_READ; + usage = 0; break; + case MESA_GLINTEROP_ACCESS_READ_WRITE: case MESA_GLINTEROP_ACCESS_WRITE_ONLY: - usage = PIPE_HANDLE_USAGE_WRITE; + usage = PIPE_HANDLE_USAGE_SHADER_WRITE; break; default: usage = 0; diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c index 1fba71bdd97..886f94dc02c 100644 --- a/src/gallium/state_trackers/dri/drisw.c +++ b/src/gallium/state_trackers/dri/drisw.c @@ -129,7 +129,7 @@ get_image_shm(__DRIdrawable *dPriv, int x, int y, int width, int height, if (loader->base.version < 4 || !loader->getImageShm) return FALSE; - if (!res->screen->resource_get_handle(res->screen, NULL, res, &whandle, PIPE_HANDLE_USAGE_WRITE)) + if (!res->screen->resource_get_handle(res->screen, NULL, res, &whandle, PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE)) return FALSE; loader->getImageShm(dPriv, x, y, width, height, whandle.handle, dPriv->loaderPrivate); |