#include "pan_bo.h"
#include "pan_context.h"
#include "pan_util.h"
-#include "pan_format.h"
#include "util/format/u_format.h"
case PIPE_FORMAT_A4B4G4R4_UNORM:
case PIPE_FORMAT_B4G4R4A4_UNORM:
+ case PIPE_FORMAT_R4G4B4A4_UNORM:
fmt.unk1 = 0x4;
fmt.nr_channels = MALI_POSITIVE(1);
fmt.unk2 = 0x5;
assert(surf->u.tex.last_layer == first_layer);
signed stride = rsrc->slices[level].stride;
- mali_ptr base = panfrost_get_texture_address(rsrc, level, first_layer);
+ mali_ptr base = panfrost_get_texture_address(rsrc, level, first_layer, 0);
fb->format = panfrost_sfbd_format(surf);
fb->framebuffer = base;
fb->stride = stride;
- if (rsrc->layout == MALI_TEXTURE_LINEAR)
- fb->format.block = MALI_BLOCK_LINEAR;
- else if (rsrc->layout == MALI_TEXTURE_TILED) {
- fb->format.block = MALI_BLOCK_TILED;
+ if (rsrc->modifier == DRM_FORMAT_MOD_LINEAR)
+ fb->format.block = MALI_BLOCK_FORMAT_LINEAR;
+ else if (rsrc->modifier == DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED) {
+ fb->format.block = MALI_BLOCK_FORMAT_TILED;
fb->stride *= 16;
} else {
- fprintf(stderr, "Invalid render layout\n");
+ fprintf(stderr, "Invalid render modifier\n");
assert(0);
}
}
unsigned level = surf->u.tex.level;
assert(surf->u.tex.first_layer == 0);
- if (rsrc->layout != MALI_TEXTURE_TILED)
- unreachable("Invalid render layout.");
+ if (rsrc->modifier != DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED)
+ unreachable("Invalid render modifier.");
fb->depth_buffer = rsrc->bo->gpu + rsrc->slices[level].offset;
fb->depth_stride = rsrc->slices[level].stride;
/* No stencil? Job done. */
- if (!ctx->depth_stencil || !ctx->depth_stencil->stencil[0].enabled)
+ if (!ctx->depth_stencil || !ctx->depth_stencil->base.stencil[0].enabled)
return;
if (panfrost_is_z24s8_variant(surf->format)) {
-
/* Stencil data is interleaved with depth */
fb->stencil_buffer = fb->depth_buffer;
fb->stencil_stride = fb->depth_stride;
- } else if (surf->format == PIPE_FORMAT_Z32_UNORM ||
- surf->format == PIPE_FORMAT_Z32_FLOAT) {
-
+ } else if (surf->format == PIPE_FORMAT_Z32_FLOAT) {
/* No stencil, nothing to do */
} else if (surf->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) {
-
/* Stencil data in separate buffer */
struct panfrost_resource *stencil = rsrc->separate_stencil;
struct panfrost_slice stencil_slice = stencil->slices[level];
{
struct panfrost_context *ctx = batch->ctx;
struct pipe_context *gallium = (struct pipe_context *) ctx;
- struct panfrost_screen *screen = pan_screen(gallium->screen);
+ struct panfrost_device *dev = pan_device(gallium->screen);
unsigned width = batch->key.width;
unsigned height = batch->key.height;
/* TODO: Why do we need to make the stack bigger than other platforms? */
unsigned shift = panfrost_get_stack_shift(MAX2(batch->stack_size, 512));
- /* TODO: where do we specify the shift? */
-
struct mali_single_framebuffer framebuffer = {
.width = MALI_POSITIVE(width),
.height = MALI_POSITIVE(height),
.shared_memory = {
+ .stack_shift = shift,
.shared_workgroup_count = ~0,
- .scratchpad = panfrost_batch_get_scratchpad(batch, shift, screen->thread_tls_alloc, screen->core_count)->gpu,
+ .scratchpad = panfrost_batch_get_scratchpad(batch, shift, dev->thread_tls_alloc, dev->core_count)->gpu,
},
.format = {
.unk3 = 0x3,
fb.format.unk2 |= MALI_SFBD_FORMAT_MSAA_B;
}
- return panfrost_upload_transient(batch, &fb, sizeof(fb));
+ return panfrost_pool_upload(&batch->pool, &fb, sizeof(fb));
}