#include "etnaviv_internal.h"
#include "etnaviv_tiling.h"
#include "pipe/p_state.h"
+#include "util/format/u_format.h"
#include "util/list.h"
#include "util/set.h"
#include "util/u_helpers.h"
+#include "util/u_range.h"
struct etna_context;
struct pipe_screen;
uint32_t ts_offset;
uint32_t ts_layer_stride;
uint32_t ts_size;
- uint32_t clear_value; /* clear value of resource level (mainly for TS) */
+ uint64_t clear_value; /* clear value of resource level (mainly for TS) */
bool ts_valid;
uint8_t ts_mode;
int8_t ts_compress_fmt; /* COLOR_COMPRESSION_FORMAT_* (-1 = disable) */
struct etna_resource_level levels[ETNA_NUM_LOD];
+ /* buffer range that has been initialized */
+ struct util_range valid_buffer_range;
+
/* for when TE doesn't support the base layout */
struct pipe_resource *texture;
/* for when PE doesn't support the base layout */
enum etna_resource_status status;
+ mtx_t lock; /* Lock to protect pending_ctx */
struct set *pending_ctx;
};
PIPE_BIND_SAMPLER_VIEW;
}
+static inline bool
+etna_resource_hw_tileable(bool use_blt, const struct pipe_resource *pres)
+{
+ if (use_blt)
+ return true;
+
+ /* RS can only tile 16bpp or 32bpp formats */
+ return util_format_get_blocksize(pres->format) == 2 ||
+ util_format_get_blocksize(pres->format) == 4;
+}
+
static inline struct etna_resource *
etna_resource(struct pipe_resource *p)
{
return (struct etna_resource *)p;
}
-enum etna_resource_status
-etna_resource_get_status(struct etna_context *ctx, struct etna_resource *rsc);
-
void
etna_resource_used(struct etna_context *ctx, struct pipe_resource *prsc,
enum etna_resource_status status);