summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-10-25 15:33:00 -0400
committerMarek Olšák <[email protected]>2018-10-30 16:03:02 -0400
commit8ad12c8bec4bd20ea4241e412b477a155a42186b (patch)
tree4155600e79320d788e4f1df43e2b9230b5f67684 /src/gallium/drivers
parent00fc56a68d21d7aa91b95f0eaacba59a96c466f5 (diff)
gallium: rework PIPE_HANDLE_USAGE_* flags
Only radeonsi uses them, so adjust them to match its needs.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_resource.c2
-rw-r--r--src/gallium/drivers/r600/r600_texture.c2
-rw-r--r--src/gallium/drivers/radeonsi/si_texture.c7
-rw-r--r--src/gallium/drivers/tegra/tegra_screen.c3
4 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index 7fd374ae23d..3808c293e6e 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -254,7 +254,7 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,
handle.modifier = modifier;
rsc = etna_resource(pscreen->resource_from_handle(pscreen, templat,
&handle,
- PIPE_HANDLE_USAGE_WRITE));
+ PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE));
close(handle.handle);
if (!rsc)
return NULL;
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index d08c6e5637c..def4cbf86b2 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -1942,7 +1942,7 @@ r600_texture_from_memobj(struct pipe_screen *screen,
pb_reference(&buf, memobj->buf);
rtex->resource.b.is_shared = true;
- rtex->resource.external_usage = PIPE_HANDLE_USAGE_READ_WRITE;
+ rtex->resource.external_usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
if (rscreen->apply_opaque_metadata)
rscreen->apply_opaque_metadata(rscreen, rtex, &metadata);
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index bcff226a586..2fb79253a72 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -445,7 +445,7 @@ static bool si_can_disable_dcc(struct si_texture *tex)
/* We can't disable DCC if it can be written by another process. */
return tex->dcc_offset &&
(!tex->buffer.b.is_shared ||
- !(tex->buffer.external_usage & PIPE_HANDLE_USAGE_WRITE));
+ !(tex->buffer.external_usage & PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE));
}
static bool si_texture_discard_dcc(struct si_screen *sscreen,
@@ -763,7 +763,7 @@ static boolean si_texture_get_handle(struct pipe_screen* screen,
* disable it for external clients that want write
* access.
*/
- if (usage & PIPE_HANDLE_USAGE_WRITE && tex->dcc_offset) {
+ if (usage & PIPE_HANDLE_USAGE_SHADER_WRITE && tex->dcc_offset) {
if (si_texture_disable_dcc(sctx, tex)) {
update_metadata = true;
/* si_texture_disable_dcc flushes the context */
@@ -2373,7 +2373,8 @@ si_texture_from_memobj(struct pipe_screen *screen,
struct pipe_resource *tex =
si_texture_from_winsys_buffer(sscreen, templ, memobj->buf,
memobj->stride, offset,
- PIPE_HANDLE_USAGE_READ_WRITE,
+ PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE |
+ PIPE_HANDLE_USAGE_SHADER_WRITE,
memobj->b.dedicated);
if (!tex)
return NULL;
diff --git a/src/gallium/drivers/tegra/tegra_screen.c b/src/gallium/drivers/tegra/tegra_screen.c
index 243bdde8d2c..1051c167189 100644
--- a/src/gallium/drivers/tegra/tegra_screen.c
+++ b/src/gallium/drivers/tegra/tegra_screen.c
@@ -167,7 +167,6 @@ tegra_screen_can_create_resource(struct pipe_screen *pscreen,
static int tegra_screen_import_resource(struct tegra_screen *screen,
struct tegra_resource *resource)
{
- unsigned usage = PIPE_HANDLE_USAGE_READ;
struct winsys_handle handle;
boolean status;
int fd, err;
@@ -177,7 +176,7 @@ static int tegra_screen_import_resource(struct tegra_screen *screen,
handle.type = WINSYS_HANDLE_TYPE_FD;
status = screen->gpu->resource_get_handle(screen->gpu, NULL, resource->gpu,
- &handle, usage);
+ &handle, 0);
if (!status)
return -EINVAL;