aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorTomeu Vizoso <[email protected]>2020-01-02 11:24:19 +0100
committerAlyssa Rosenzweig <[email protected]>2020-01-02 12:41:02 -0500
commited3eede296e09a1c779d0d8f89ed50765c26b2dc (patch)
tree286764d75046ed1e90421f9e0226aeafe755f108 /src/panfrost
parentc1a1a86658303083d33e70c6b0c1b3317bdd8d20 (diff)
panfrost: Dynamically allocate array of texture pointers
With 3D textures we can have lots of layers, so better allocate it dynamically at runtime. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/include/panfrost-job.h2
-rw-r--r--src/panfrost/pandecode/decode.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 85dd2b40e1d..49c55f1f93e 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -1231,8 +1231,6 @@ struct mali_texture_descriptor {
uint32_t unknown5;
uint32_t unknown6;
uint32_t unknown7;
-
- mali_ptr payload[MAX_MIP_LEVELS * MAX_CUBE_FACES * MAX_ELEMENTS];
} __attribute__((packed));
/* filter_mode */
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 9f9de0f0fb6..80b9a66978b 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -2018,6 +2018,8 @@ pandecode_texture(mali_ptr u,
/* Miptree for each face */
if (f.type == MALI_TEX_CUBE)
bitmap_count *= 6;
+ else if (f.type == MALI_TEX_3D)
+ bitmap_count *= t->depth;
/* Array of textures */
bitmap_count *= (t->array_size + 1);
@@ -2026,22 +2028,20 @@ pandecode_texture(mali_ptr u,
if (f.manual_stride)
bitmap_count *= 2;
- /* Sanity check the size */
- int max_count = sizeof(t->payload) / sizeof(t->payload[0]);
- assert (bitmap_count <= max_count);
-
+ mali_ptr *pointers_and_strides = pandecode_fetch_gpu_mem(tmem,
+ u + sizeof(*t), sizeof(mali_ptr) * bitmap_count);
for (int i = 0; i < bitmap_count; ++i) {
/* How we dump depends if this is a stride or a pointer */
if (f.manual_stride && (i & 1)) {
/* signed 32-bit snuck in as a 64-bit pointer */
- uint64_t stride_set = t->payload[i];
+ uint64_t stride_set = pointers_and_strides[i];
uint32_t clamped_stride = stride_set;
int32_t stride = clamped_stride;
assert(stride_set == clamped_stride);
pandecode_log("(mali_ptr) %d /* stride */, \n", stride);
} else {
- char *a = pointer_as_memory_reference(t->payload[i]);
+ char *a = pointer_as_memory_reference(pointers_and_strides[i]);
pandecode_log("%s, \n", a);
free(a);
}