aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_resource.c2
-rw-r--r--src/gallium/drivers/freedreno/freedreno_resource.h3
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.h2
-rw-r--r--src/gallium/drivers/freedreno/freedreno_texture.c7
4 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 4b23b645857..759ae7d28ae 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -108,6 +108,7 @@ realloc_bo(struct fd_resource *rsc, uint32_t size)
fd_bo_del(rsc->bo);
rsc->bo = fd_bo_new(screen->dev, size, flags);
+ rsc->seqno = p_atomic_inc_return(&screen->rsc_seqno);
util_range_set_empty(&rsc->valid_buffer_range);
fd_bc_invalidate_resource(rsc, true);
}
@@ -193,6 +194,7 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
/* TODO valid_buffer_range?? */
swap(rsc->bo, shadow->bo);
swap(rsc->write_batch, shadow->write_batch);
+ rsc->seqno = p_atomic_inc_return(&ctx->screen->rsc_seqno);
/* at this point, the newly created shadow buffer is not referenced
* by any batches, but the existing rsc (probably) is. We need to
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.h b/src/gallium/drivers/freedreno/freedreno_resource.h
index c833beb835c..09abb512d7e 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.h
+++ b/src/gallium/drivers/freedreno/freedreno_resource.h
@@ -95,6 +95,9 @@ struct fd_resource {
*/
uint32_t bc_batch_mask;
+ /* Sequence # incremented each time bo changes: */
+ uint16_t seqno;
+
unsigned tile_mode : 2;
unsigned preferred_tile_mode : 2;
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h
index 19ba81523e1..b0b0e4f0d74 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.h
+++ b/src/gallium/drivers/freedreno/freedreno_screen.h
@@ -95,6 +95,8 @@ struct fd_screen {
struct fd_batch_cache batch_cache;
bool reorder;
+
+ uint16_t rsc_seqno;
};
static inline struct fd_screen *
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c
index 7c2057885b2..d92298d2ea5 100644
--- a/src/gallium/drivers/freedreno/freedreno_texture.c
+++ b/src/gallium/drivers/freedreno/freedreno_texture.c
@@ -117,9 +117,10 @@ fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
void
fd_texture_init(struct pipe_context *pctx)
{
- pctx->delete_sampler_state = fd_sampler_state_delete;
-
- pctx->sampler_view_destroy = fd_sampler_view_destroy;
+ if (!pctx->delete_sampler_state)
+ pctx->delete_sampler_state = fd_sampler_state_delete;
+ if (!pctx->sampler_view_destroy)
+ pctx->sampler_view_destroy = fd_sampler_view_destroy;
}
/* helper for setting up border-color buffer for a3xx/a4xx: */