aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_resource.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2015-07-31 12:07:24 -0400
committerRob Clark <[email protected]>2015-08-04 16:03:45 -0400
commit5ca032a9a8ece0a8a43151f988215484da3c1811 (patch)
treec1e3875d44447d71555d960c05898264da87a0e2 /src/gallium/drivers/freedreno/freedreno_resource.h
parentc7deea51d2b611564c91e146fbd1ed0b547f65c0 (diff)
freedreno: simplify/cleanup resource status tracking
Collapse dirty/reading bools into status bitmask (and drop writing which should really be the same as dirty). And use 'used_resources' list for all tracking, including zsbuf/cbufs, rather than special casing the color and depth/stencil buffers. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_resource.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_resource.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.h b/src/gallium/drivers/freedreno/freedreno_resource.h
index e7f127edca4..7549becaa1f 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.h
+++ b/src/gallium/drivers/freedreno/freedreno_resource.h
@@ -60,6 +60,15 @@ struct fd_resource_slice {
uint32_t size0; /* size of first layer in slice */
};
+/* status of queued up but not flushed reads and write operations.
+ * In _transfer_map() we need to know if queued up rendering needs
+ * to be flushed to preserve the order of cpu and gpu access.
+ */
+enum fd_resource_status {
+ FD_PENDING_WRITE = 0x01,
+ FD_PENDING_READ = 0x02,
+};
+
struct fd_resource {
struct u_resource base;
struct fd_bo *bo;
@@ -68,14 +77,20 @@ struct fd_resource {
uint32_t layer_size;
struct fd_resource_slice slices[MAX_MIP_LEVELS];
uint32_t timestamp;
- bool dirty, reading, writing;
/* buffer range that has been initialized */
struct util_range valid_buffer_range;
/* reference to the resource holding stencil data for a z32_s8 texture */
+ /* TODO rename to secondary or auxiliary? */
struct fd_resource *stencil;
+ /* pending read/write state: */
+ enum fd_resource_status status;
+ /* resources accessed by queued but not flushed draws are tracked
+ * in the used_resources list.
+ */
struct list_head list;
+ struct fd_context *pending_ctx;
};
static inline struct fd_resource *