panfrost: Get rid of IS_BIFROST
Extract this information from dev->arch, and provide a helper to hide this check. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Italo Nicola <italonicola@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8808>
This commit is contained in:
@@ -137,7 +137,7 @@ pan_upload_shader_descriptor(struct panfrost_context *ctx,
|
||||
cfg.shader = state->shader;
|
||||
cfg.properties = state->properties;
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
cfg.preload = state->preload;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
|
||||
|
||||
panfrost_program *program;
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
program = bifrost_compile_shader_nir(NULL, s, &inputs);
|
||||
else
|
||||
program = midgard_compile_shader_nir(NULL, s, &inputs);
|
||||
@@ -292,7 +292,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
|
||||
|
||||
/* Midgard needs the first tag on the bottom nibble */
|
||||
|
||||
if (!(dev->quirks & IS_BIFROST)) {
|
||||
if (!pan_is_bifrost(dev)) {
|
||||
/* If size = 0, we tag as "end-of-shader" */
|
||||
|
||||
if (size)
|
||||
@@ -379,7 +379,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
|
||||
state->uniform_count = MIN2(s->num_uniforms + program->sysval_count, program->uniform_cutoff);
|
||||
state->work_reg_count = program->work_register_count;
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(state->blend_types); i++)
|
||||
state->blend_types[i] = bifrost_blend_type_from_nir(program->blend_types[i]);
|
||||
|
||||
@@ -409,7 +409,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
|
||||
* "no uniform, no UBO" case though, otherwise sysval passed through
|
||||
* uniforms won't work correctly.
|
||||
*/
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
state->ubo_count = MAX2(s->info.num_ubos, 1);
|
||||
else
|
||||
state->ubo_count = s->info.num_ubos + 1;
|
||||
@@ -421,7 +421,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
|
||||
state->shader.texture_count = s->info.num_textures;
|
||||
state->shader.sampler_count = s->info.num_textures;
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
pan_prepare_bifrost_props(state, program, stage);
|
||||
else
|
||||
pan_prepare_midgard_props(state, stage);
|
||||
|
||||
@@ -206,7 +206,7 @@ panfrost_create_blend_shader(struct panfrost_context *ctx,
|
||||
|
||||
nir_lower_blend_options options = nir_make_options(&state->base, key->rt);
|
||||
options.format = key->format;
|
||||
options.is_bifrost = !!(dev->quirks & IS_BIFROST);
|
||||
options.is_bifrost = pan_is_bifrost(dev);
|
||||
options.src1 = s_src[1];
|
||||
|
||||
if (T == nir_type_float16)
|
||||
@@ -298,7 +298,7 @@ panfrost_compile_blend_shader(struct panfrost_blend_shader *shader,
|
||||
|
||||
panfrost_program *program;
|
||||
|
||||
if (dev->quirks & IS_BIFROST) {
|
||||
if (pan_is_bifrost(dev)) {
|
||||
inputs.blend.bifrost_blend_desc =
|
||||
bifrost_get_blend_desc(dev, shader->key.format, shader->key.rt);
|
||||
program = bifrost_compile_shader_nir(NULL, shader->nir, &inputs);
|
||||
|
||||
@@ -379,7 +379,7 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts,
|
||||
{
|
||||
const struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
panfrost_emit_bifrost_blend(batch, blend, rts);
|
||||
else
|
||||
panfrost_emit_midgard_blend(batch, blend, rts);
|
||||
@@ -518,7 +518,7 @@ panfrost_prepare_fs_state(struct panfrost_context *ctx,
|
||||
const struct panfrost_zsa_state *zsa = ctx->depth_stencil;
|
||||
bool alpha_to_coverage = ctx->blend->base.alpha_to_coverage;
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
panfrost_prepare_bifrost_fs_state(ctx, blend, state);
|
||||
else
|
||||
panfrost_prepare_midgard_fs_state(ctx, blend, state);
|
||||
@@ -1153,7 +1153,7 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch,
|
||||
if (!ctx->sampler_view_count[stage])
|
||||
return 0;
|
||||
|
||||
if (device->quirks & IS_BIFROST) {
|
||||
if (pan_is_bifrost(device)) {
|
||||
struct panfrost_ptr T = panfrost_pool_alloc_aligned(&batch->pool,
|
||||
MALI_BIFROST_TEXTURE_LENGTH *
|
||||
ctx->sampler_view_count[stage],
|
||||
@@ -1309,7 +1309,7 @@ emit_image_attribs(struct panfrost_batch *batch, enum pipe_shader_type shader,
|
||||
* every image attribute buffer needs an ATTRIBUTE_BUFFER_CONTINUATION_3D */
|
||||
pan_pack(attribs + k, ATTRIBUTE, cfg) {
|
||||
cfg.buffer_index = first_image_buf_index + (k * 2);
|
||||
cfg.offset_enable = !(dev->quirks & IS_BIFROST);
|
||||
cfg.offset_enable = !pan_is_bifrost(dev);
|
||||
cfg.format =
|
||||
dev->formats[image->format].hw;
|
||||
}
|
||||
@@ -1349,7 +1349,6 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
|
||||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_device *dev = pan_device(ctx->base.screen);
|
||||
bool is_bifrost = !!(dev->quirks & IS_BIFROST);
|
||||
struct panfrost_vertex_state *so = ctx->vertex;
|
||||
struct panfrost_shader_state *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
|
||||
uint32_t image_mask = ctx->image_mask[PIPE_SHADER_VERTEX];
|
||||
@@ -1501,7 +1500,7 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
|
||||
k += util_bitcount(ctx->image_mask[PIPE_SHADER_VERTEX]);
|
||||
|
||||
/* We need an empty attrib buf to stop the prefetching on Bifrost */
|
||||
if (is_bifrost)
|
||||
if (pan_is_bifrost(dev))
|
||||
pan_pack(&bufs[k], ATTRIBUTE_BUFFER, cfg);
|
||||
|
||||
/* Attribute addresses require 64-byte alignment, so let:
|
||||
@@ -1685,11 +1684,10 @@ pan_xfb_base(unsigned present)
|
||||
/* Computes the present mask for varyings so we can start emitting varying records */
|
||||
|
||||
static inline unsigned
|
||||
pan_varying_present(
|
||||
struct panfrost_shader_state *vs,
|
||||
struct panfrost_shader_state *fs,
|
||||
unsigned quirks,
|
||||
uint16_t point_coord_mask)
|
||||
pan_varying_present(const struct panfrost_device *dev,
|
||||
struct panfrost_shader_state *vs,
|
||||
struct panfrost_shader_state *fs,
|
||||
uint16_t point_coord_mask)
|
||||
{
|
||||
/* At the moment we always emit general and position buffers. Not
|
||||
* strictly necessary but usually harmless */
|
||||
@@ -1707,7 +1705,7 @@ pan_varying_present(
|
||||
if (fs->reads_face)
|
||||
present |= (1 << PAN_VARY_FACE);
|
||||
|
||||
if (fs->reads_frag_coord && !(quirks & IS_BIFROST))
|
||||
if (fs->reads_frag_coord && !pan_is_bifrost(dev))
|
||||
present |= (1 << PAN_VARY_FRAGCOORD);
|
||||
|
||||
/* Also, if we have a point sprite, we need a point coord buffer */
|
||||
@@ -1725,19 +1723,19 @@ pan_varying_present(
|
||||
/* Emitters for varying records */
|
||||
|
||||
static void
|
||||
pan_emit_vary(struct mali_attribute_packed *out,
|
||||
unsigned present, enum pan_special_varying buf,
|
||||
unsigned quirks, enum mali_format format,
|
||||
unsigned offset)
|
||||
pan_emit_vary(const struct panfrost_device *dev,
|
||||
struct mali_attribute_packed *out,
|
||||
unsigned present, enum pan_special_varying buf,
|
||||
enum mali_format format, unsigned offset)
|
||||
{
|
||||
unsigned nr_channels = MALI_EXTRACT_CHANNELS(format);
|
||||
unsigned swizzle = quirks & HAS_SWIZZLES ?
|
||||
panfrost_get_default_swizzle(nr_channels) :
|
||||
panfrost_bifrost_swizzle(nr_channels);
|
||||
unsigned swizzle = dev->quirks & HAS_SWIZZLES ?
|
||||
panfrost_get_default_swizzle(nr_channels) :
|
||||
panfrost_bifrost_swizzle(nr_channels);
|
||||
|
||||
pan_pack(out, ATTRIBUTE, cfg) {
|
||||
cfg.buffer_index = pan_varying_index(present, buf);
|
||||
cfg.offset_enable = quirks & IS_BIFROST ? false : true;
|
||||
cfg.offset_enable = !pan_is_bifrost(dev);
|
||||
cfg.format = (format << 12) | swizzle;
|
||||
cfg.offset = offset;
|
||||
}
|
||||
@@ -1746,10 +1744,11 @@ pan_emit_vary(struct mali_attribute_packed *out,
|
||||
/* General varying that is unused */
|
||||
|
||||
static void
|
||||
pan_emit_vary_only(struct mali_attribute_packed *out,
|
||||
unsigned present, unsigned quirks)
|
||||
pan_emit_vary_only(const struct panfrost_device *dev,
|
||||
struct mali_attribute_packed *out,
|
||||
unsigned present)
|
||||
{
|
||||
pan_emit_vary(out, present, 0, quirks, MALI_CONSTANT, 0);
|
||||
pan_emit_vary(dev, out, present, 0, MALI_CONSTANT, 0);
|
||||
}
|
||||
|
||||
/* Special records */
|
||||
@@ -1763,12 +1762,12 @@ static const enum mali_format pan_varying_formats[PAN_VARY_MAX] = {
|
||||
};
|
||||
|
||||
static void
|
||||
pan_emit_vary_special(struct mali_attribute_packed *out,
|
||||
unsigned present, enum pan_special_varying buf,
|
||||
unsigned quirks)
|
||||
pan_emit_vary_special(const struct panfrost_device *dev,
|
||||
struct mali_attribute_packed *out,
|
||||
unsigned present, enum pan_special_varying buf)
|
||||
{
|
||||
assert(buf < PAN_VARY_MAX);
|
||||
pan_emit_vary(out, present, buf, quirks, pan_varying_formats[buf], 0);
|
||||
pan_emit_vary(dev, out, present, buf, pan_varying_formats[buf], 0);
|
||||
}
|
||||
|
||||
static enum mali_format
|
||||
@@ -1785,22 +1784,22 @@ pan_xfb_format(enum mali_format format, unsigned nr)
|
||||
* value. */
|
||||
|
||||
static void
|
||||
pan_emit_vary_xfb(struct mali_attribute_packed *out,
|
||||
unsigned present,
|
||||
unsigned max_xfb,
|
||||
unsigned *streamout_offsets,
|
||||
unsigned quirks,
|
||||
enum mali_format format,
|
||||
struct pipe_stream_output o)
|
||||
pan_emit_vary_xfb(const struct panfrost_device *dev,
|
||||
struct mali_attribute_packed *out,
|
||||
unsigned present,
|
||||
unsigned max_xfb,
|
||||
unsigned *streamout_offsets,
|
||||
enum mali_format format,
|
||||
struct pipe_stream_output o)
|
||||
{
|
||||
unsigned swizzle = quirks & HAS_SWIZZLES ?
|
||||
panfrost_get_default_swizzle(o.num_components) :
|
||||
panfrost_bifrost_swizzle(o.num_components);
|
||||
unsigned swizzle = dev->quirks & HAS_SWIZZLES ?
|
||||
panfrost_get_default_swizzle(o.num_components) :
|
||||
panfrost_bifrost_swizzle(o.num_components);
|
||||
|
||||
pan_pack(out, ATTRIBUTE, cfg) {
|
||||
/* XFB buffers come after everything else */
|
||||
cfg.buffer_index = pan_xfb_base(present) + o.output_buffer;
|
||||
cfg.offset_enable = quirks & IS_BIFROST ? false : true;
|
||||
cfg.offset_enable = !pan_is_bifrost(dev);
|
||||
|
||||
/* Override number of channels and precision to highp */
|
||||
cfg.format = (pan_xfb_format(format, o.num_components) << 12) | swizzle;
|
||||
@@ -1827,18 +1826,18 @@ panfrost_xfb_captured(struct panfrost_shader_state *xfb,
|
||||
}
|
||||
|
||||
static void
|
||||
pan_emit_general_varying(struct mali_attribute_packed *out,
|
||||
struct panfrost_shader_state *other,
|
||||
struct panfrost_shader_state *xfb,
|
||||
gl_varying_slot loc,
|
||||
enum mali_format format,
|
||||
unsigned present,
|
||||
unsigned quirks,
|
||||
unsigned *gen_offsets,
|
||||
enum mali_format *gen_formats,
|
||||
unsigned *gen_stride,
|
||||
unsigned idx,
|
||||
bool should_alloc)
|
||||
pan_emit_general_varying(const struct panfrost_device *dev,
|
||||
struct mali_attribute_packed *out,
|
||||
struct panfrost_shader_state *other,
|
||||
struct panfrost_shader_state *xfb,
|
||||
gl_varying_slot loc,
|
||||
enum mali_format format,
|
||||
unsigned present,
|
||||
unsigned *gen_offsets,
|
||||
enum mali_format *gen_formats,
|
||||
unsigned *gen_stride,
|
||||
unsigned idx,
|
||||
bool should_alloc)
|
||||
{
|
||||
/* Check if we're linked */
|
||||
signed other_idx = -1;
|
||||
@@ -1851,7 +1850,7 @@ pan_emit_general_varying(struct mali_attribute_packed *out,
|
||||
}
|
||||
|
||||
if (other_idx < 0) {
|
||||
pan_emit_vary_only(out, present, quirks);
|
||||
pan_emit_vary_only(dev, out, present);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1885,29 +1884,28 @@ pan_emit_general_varying(struct mali_attribute_packed *out,
|
||||
*gen_stride += size;
|
||||
}
|
||||
|
||||
pan_emit_vary(out, present, PAN_VARY_GENERAL, quirks, format, offset);
|
||||
pan_emit_vary(dev, out, present, PAN_VARY_GENERAL, format, offset);
|
||||
}
|
||||
|
||||
/* Higher-level wrapper around all of the above, classifying a varying into one
|
||||
* of the above types */
|
||||
|
||||
static void
|
||||
panfrost_emit_varying(
|
||||
struct mali_attribute_packed *out,
|
||||
struct panfrost_shader_state *stage,
|
||||
struct panfrost_shader_state *other,
|
||||
struct panfrost_shader_state *xfb,
|
||||
unsigned present,
|
||||
uint16_t point_sprite_mask,
|
||||
unsigned max_xfb,
|
||||
unsigned *streamout_offsets,
|
||||
unsigned quirks,
|
||||
unsigned *gen_offsets,
|
||||
enum mali_format *gen_formats,
|
||||
unsigned *gen_stride,
|
||||
unsigned idx,
|
||||
bool should_alloc,
|
||||
bool is_fragment)
|
||||
panfrost_emit_varying(const struct panfrost_device *dev,
|
||||
struct mali_attribute_packed *out,
|
||||
struct panfrost_shader_state *stage,
|
||||
struct panfrost_shader_state *other,
|
||||
struct panfrost_shader_state *xfb,
|
||||
unsigned present,
|
||||
uint16_t point_sprite_mask,
|
||||
unsigned max_xfb,
|
||||
unsigned *streamout_offsets,
|
||||
unsigned *gen_offsets,
|
||||
enum mali_format *gen_formats,
|
||||
unsigned *gen_stride,
|
||||
unsigned idx,
|
||||
bool should_alloc,
|
||||
bool is_fragment)
|
||||
{
|
||||
gl_varying_slot loc = stage->varyings_loc[idx];
|
||||
enum mali_format format = stage->varyings[idx];
|
||||
@@ -1917,25 +1915,25 @@ panfrost_emit_varying(
|
||||
format = gen_formats[idx];
|
||||
|
||||
if (util_varying_is_point_coord(loc, point_sprite_mask)) {
|
||||
pan_emit_vary_special(out, present, PAN_VARY_PNTCOORD, quirks);
|
||||
pan_emit_vary_special(dev, out, present, PAN_VARY_PNTCOORD);
|
||||
} else if (panfrost_xfb_captured(xfb, loc, max_xfb)) {
|
||||
struct pipe_stream_output *o = pan_get_so(&xfb->stream_output, loc);
|
||||
pan_emit_vary_xfb(out, present, max_xfb, streamout_offsets, quirks, format, *o);
|
||||
pan_emit_vary_xfb(dev, out, present, max_xfb, streamout_offsets, format, *o);
|
||||
} else if (loc == VARYING_SLOT_POS) {
|
||||
if (is_fragment)
|
||||
pan_emit_vary_special(out, present, PAN_VARY_FRAGCOORD, quirks);
|
||||
pan_emit_vary_special(dev, out, present, PAN_VARY_FRAGCOORD);
|
||||
else
|
||||
pan_emit_vary_special(out, present, PAN_VARY_POSITION, quirks);
|
||||
pan_emit_vary_special(dev, out, present, PAN_VARY_POSITION);
|
||||
} else if (loc == VARYING_SLOT_PSIZ) {
|
||||
pan_emit_vary_special(out, present, PAN_VARY_PSIZ, quirks);
|
||||
pan_emit_vary_special(dev, out, present, PAN_VARY_PSIZ);
|
||||
} else if (loc == VARYING_SLOT_PNTC) {
|
||||
pan_emit_vary_special(out, present, PAN_VARY_PNTCOORD, quirks);
|
||||
pan_emit_vary_special(dev, out, present, PAN_VARY_PNTCOORD);
|
||||
} else if (loc == VARYING_SLOT_FACE) {
|
||||
pan_emit_vary_special(out, present, PAN_VARY_FACE, quirks);
|
||||
pan_emit_vary_special(dev, out, present, PAN_VARY_FACE);
|
||||
} else {
|
||||
pan_emit_general_varying(out, other, xfb, loc, format, present,
|
||||
quirks, gen_offsets, gen_formats, gen_stride,
|
||||
idx, should_alloc);
|
||||
pan_emit_general_varying(dev, out, other, xfb, loc, format, present,
|
||||
gen_offsets, gen_formats, gen_stride,
|
||||
idx, should_alloc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1984,10 +1982,10 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
|
||||
uint16_t point_coord_mask = ctx->rasterizer->base.sprite_coord_enable;
|
||||
|
||||
/* TODO: point sprites need lowering on Bifrost */
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
point_coord_mask = 0;
|
||||
|
||||
unsigned present = pan_varying_present(vs, fs, dev->quirks, point_coord_mask);
|
||||
unsigned present = pan_varying_present(dev, vs, fs, point_coord_mask);
|
||||
|
||||
/* Check if this varying is linked by us. This is the case for
|
||||
* general-purpose, non-captured varyings. If it is, link it. If it's
|
||||
@@ -2015,17 +2013,17 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
|
||||
struct mali_attribute_packed *ofs = ovs + vs->varying_count;
|
||||
|
||||
for (unsigned i = 0; i < vs->varying_count; i++) {
|
||||
panfrost_emit_varying(ovs + i, vs, fs, vs, present, 0,
|
||||
ctx->streamout.num_targets, streamout_offsets,
|
||||
dev->quirks,
|
||||
gen_offsets, gen_formats, &gen_stride, i, true, false);
|
||||
panfrost_emit_varying(dev, ovs + i, vs, fs, vs, present, 0,
|
||||
ctx->streamout.num_targets, streamout_offsets,
|
||||
gen_offsets, gen_formats, &gen_stride, i,
|
||||
true, false);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < fs->varying_count; i++) {
|
||||
panfrost_emit_varying(ofs + i, fs, vs, vs, present, point_coord_mask,
|
||||
ctx->streamout.num_targets, streamout_offsets,
|
||||
dev->quirks,
|
||||
gen_offsets, gen_formats, &gen_stride, i, false, true);
|
||||
panfrost_emit_varying(dev, ofs + i, fs, vs, vs, present, point_coord_mask,
|
||||
ctx->streamout.num_targets, streamout_offsets,
|
||||
gen_offsets, gen_formats, &gen_stride, i,
|
||||
false, true);
|
||||
}
|
||||
|
||||
unsigned xfb_base = pan_xfb_base(present);
|
||||
|
||||
@@ -65,8 +65,8 @@ panfrost_create_compute_state(
|
||||
blob_reader_init(&reader, hdr->blob, hdr->num_bytes);
|
||||
|
||||
const struct nir_shader_compiler_options *options =
|
||||
(dev->quirks & IS_BIFROST) ? &bifrost_nir_options
|
||||
: &midgard_nir_options;
|
||||
pan_is_bifrost(dev) ?
|
||||
&bifrost_nir_options : &midgard_nir_options;
|
||||
|
||||
so->cbase.prog = nir_deserialize(NULL, options, &reader);
|
||||
so->cbase.ir_type = PIPE_SHADER_IR_NIR;
|
||||
@@ -150,7 +150,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
|
||||
|
||||
pan_section_pack(t.cpu, COMPUTE_JOB, DRAW, cfg) {
|
||||
cfg.draw_descriptor_is_64b = true;
|
||||
if (!(dev->quirks & IS_BIFROST))
|
||||
if (!pan_is_bifrost(dev))
|
||||
cfg.texture_descriptor_is_64b = true;
|
||||
cfg.state = panfrost_emit_compute_shader_meta(batch, PIPE_SHADER_COMPUTE);
|
||||
cfg.attributes = panfrost_emit_image_attribs(batch, &cfg.attribute_buffers, PIPE_SHADER_COMPUTE);
|
||||
|
||||
@@ -307,7 +307,7 @@ panfrost_draw_emit_vertex(struct panfrost_batch *batch,
|
||||
|
||||
pan_section_pack(job, COMPUTE_JOB, DRAW, cfg) {
|
||||
cfg.draw_descriptor_is_64b = true;
|
||||
if (!(device->quirks & IS_BIFROST))
|
||||
if (!pan_is_bifrost(device))
|
||||
cfg.texture_descriptor_is_64b = true;
|
||||
cfg.state = panfrost_emit_compute_shader_meta(batch, PIPE_SHADER_VERTEX);
|
||||
cfg.attributes = panfrost_emit_vertex_data(batch, &cfg.attribute_buffers);
|
||||
@@ -359,14 +359,13 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct pipe_rasterizer_state *rast = &ctx->rasterizer->base;
|
||||
struct panfrost_device *device = pan_device(ctx->base.screen);
|
||||
bool is_bifrost = device->quirks & IS_BIFROST;
|
||||
|
||||
void *section = is_bifrost ?
|
||||
void *section = pan_is_bifrost(device) ?
|
||||
pan_section_ptr(job, BIFROST_TILER_JOB, INVOCATION) :
|
||||
pan_section_ptr(job, MIDGARD_TILER_JOB, INVOCATION);
|
||||
memcpy(section, invocation_template, MALI_INVOCATION_LENGTH);
|
||||
|
||||
section = is_bifrost ?
|
||||
section = pan_is_bifrost(device) ?
|
||||
pan_section_ptr(job, BIFROST_TILER_JOB, PRIMITIVE) :
|
||||
pan_section_ptr(job, MIDGARD_TILER_JOB, PRIMITIVE);
|
||||
pan_pack(section, PRIMITIVE, cfg) {
|
||||
@@ -407,11 +406,11 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
|
||||
}
|
||||
|
||||
bool points = info->mode == PIPE_PRIM_POINTS;
|
||||
void *prim_size = is_bifrost ?
|
||||
void *prim_size = pan_is_bifrost(device) ?
|
||||
pan_section_ptr(job, BIFROST_TILER_JOB, PRIMITIVE_SIZE) :
|
||||
pan_section_ptr(job, MIDGARD_TILER_JOB, PRIMITIVE_SIZE);
|
||||
|
||||
if (is_bifrost) {
|
||||
if (pan_is_bifrost(device)) {
|
||||
panfrost_emit_primitive_size(ctx, points, psiz, prim_size);
|
||||
pan_section_pack(job, BIFROST_TILER_JOB, TILER, cfg) {
|
||||
cfg.address = panfrost_batch_get_bifrost_tiler(batch, ~0);
|
||||
@@ -419,13 +418,13 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
|
||||
pan_section_pack(job, BIFROST_TILER_JOB, PADDING, padding) {}
|
||||
}
|
||||
|
||||
section = is_bifrost ?
|
||||
section = pan_is_bifrost(device) ?
|
||||
pan_section_ptr(job, BIFROST_TILER_JOB, DRAW) :
|
||||
pan_section_ptr(job, MIDGARD_TILER_JOB, DRAW);
|
||||
pan_pack(section, DRAW, cfg) {
|
||||
cfg.four_components_per_vertex = true;
|
||||
cfg.draw_descriptor_is_64b = true;
|
||||
if (!(device->quirks & IS_BIFROST))
|
||||
if (!pan_is_bifrost(device))
|
||||
cfg.texture_descriptor_is_64b = true;
|
||||
cfg.front_face_ccw = rast->front_ccw;
|
||||
cfg.cull_front_face = rast->cull_face & PIPE_FACE_FRONT;
|
||||
@@ -447,7 +446,8 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
|
||||
info->mode == PIPE_PRIM_LINE_STRIP) {
|
||||
/* The logic is inverted on bifrost. */
|
||||
cfg.flat_shading_vertex =
|
||||
is_bifrost ? rast->flatshade_first : !rast->flatshade_first;
|
||||
pan_is_bifrost(device) ?
|
||||
rast->flatshade_first : !rast->flatshade_first;
|
||||
}
|
||||
|
||||
pan_emit_draw_descs(batch, &cfg, PIPE_SHADER_FRAGMENT);
|
||||
@@ -465,7 +465,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_bifrost)
|
||||
if (!pan_is_bifrost(device))
|
||||
panfrost_emit_primitive_size(ctx, points, psiz, prim_size);
|
||||
else
|
||||
pan_section_pack(job, BIFROST_TILER_JOB, DRAW_PADDING, cfg);
|
||||
@@ -538,10 +538,9 @@ panfrost_draw_vbo(
|
||||
ctx->instance_count = info->instance_count;
|
||||
ctx->active_prim = info->mode;
|
||||
|
||||
bool is_bifrost = device->quirks & IS_BIFROST;
|
||||
struct panfrost_ptr tiler =
|
||||
panfrost_pool_alloc_aligned(&batch->pool,
|
||||
is_bifrost ?
|
||||
pan_is_bifrost(device) ?
|
||||
MALI_BIFROST_TILER_JOB_LENGTH :
|
||||
MALI_MIDGARD_TILER_JOB_LENGTH,
|
||||
64);
|
||||
@@ -787,7 +786,7 @@ panfrost_create_sampler_state(
|
||||
|
||||
so->base = *cso;
|
||||
|
||||
if (device->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(device))
|
||||
panfrost_sampler_desc_init_bifrost(cso, (struct mali_bifrost_sampler_packed *) &so->hw);
|
||||
else
|
||||
panfrost_sampler_desc_init(cso, &so->hw);
|
||||
@@ -1063,7 +1062,6 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
||||
struct pipe_resource *texture)
|
||||
{
|
||||
struct panfrost_device *device = pan_device(pctx->screen);
|
||||
bool is_bifrost = device->quirks & IS_BIFROST;
|
||||
struct panfrost_resource *prsrc = (struct panfrost_resource *)texture;
|
||||
enum pipe_format format = so->base.format;
|
||||
assert(prsrc->bo);
|
||||
@@ -1127,7 +1125,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
||||
unsigned last_layer = is_buffer ? 0 : so->base.u.tex.last_layer;
|
||||
|
||||
unsigned size =
|
||||
(is_bifrost ? 0 : MALI_MIDGARD_TEXTURE_LENGTH) +
|
||||
(pan_is_bifrost(device) ? 0 : MALI_MIDGARD_TEXTURE_LENGTH) +
|
||||
panfrost_estimate_texture_payload_size(device,
|
||||
first_level, last_level,
|
||||
first_layer, last_layer,
|
||||
@@ -1143,9 +1141,10 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
||||
unsigned offset = is_buffer ? so->base.u.buf.offset : 0;
|
||||
|
||||
struct panfrost_ptr payload = so->bo->ptr;
|
||||
void *tex = is_bifrost ? &so->bifrost_descriptor : so->bo->ptr.cpu;
|
||||
void *tex = pan_is_bifrost(device) ?
|
||||
&so->bifrost_descriptor : so->bo->ptr.cpu;
|
||||
|
||||
if (!is_bifrost) {
|
||||
if (!pan_is_bifrost(device)) {
|
||||
payload.cpu += MALI_MIDGARD_TEXTURE_LENGTH;
|
||||
payload.gpu += MALI_MIDGARD_TEXTURE_LENGTH;
|
||||
}
|
||||
@@ -1538,7 +1537,7 @@ panfrost_get_query_result(struct pipe_context *pipe,
|
||||
for (int i = 0; i < dev->core_count; ++i)
|
||||
passed += result[i];
|
||||
|
||||
if (!(dev->quirks & IS_BIFROST) && !query->msaa)
|
||||
if (!pan_is_bifrost(dev) && !query->msaa)
|
||||
passed /= 4;
|
||||
|
||||
vresult->u64 = passed;
|
||||
@@ -1716,7 +1715,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
|
||||
|
||||
ctx->draw_modes = (1 << (PIPE_PRIM_QUADS + 1)) - 1;
|
||||
|
||||
if (!(dev->quirks & IS_BIFROST)) {
|
||||
if (!pan_is_bifrost(dev)) {
|
||||
ctx->draw_modes |= (1 << PIPE_PRIM_QUAD_STRIP);
|
||||
ctx->draw_modes |= (1 << PIPE_PRIM_POLYGON);
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ panfrost_batch_reserve_framebuffer(struct panfrost_batch *batch)
|
||||
* full framebuffer descriptor on Midgard) */
|
||||
|
||||
if (!batch->framebuffer.gpu) {
|
||||
unsigned size = (dev->quirks & IS_BIFROST) ?
|
||||
unsigned size = pan_is_bifrost(dev) ?
|
||||
MALI_LOCAL_STORAGE_LENGTH :
|
||||
(dev->quirks & MIDGARD_SFBD) ?
|
||||
MALI_SINGLE_TARGET_FRAMEBUFFER_LENGTH :
|
||||
@@ -743,7 +743,7 @@ panfrost_batch_reserve_framebuffer(struct panfrost_batch *batch)
|
||||
batch->framebuffer = panfrost_pool_alloc_aligned(&batch->pool, size, 64);
|
||||
|
||||
/* Tag the pointer */
|
||||
if (!(dev->quirks & (MIDGARD_SFBD | IS_BIFROST)))
|
||||
if (!pan_is_bifrost(dev) && !(dev->quirks & MIDGARD_SFBD))
|
||||
batch->framebuffer.gpu |= MALI_FBD_TAG_IS_MFBD;
|
||||
}
|
||||
|
||||
@@ -862,7 +862,7 @@ panfrost_load_surface(struct panfrost_batch *batch, struct pipe_surface *surf, u
|
||||
}
|
||||
|
||||
unsigned vertex_count = rsrc->damage.inverted_len * 6;
|
||||
if (batch->pool.dev->quirks & IS_BIFROST) {
|
||||
if (pan_is_bifrost(batch->pool.dev)) {
|
||||
mali_ptr tiler =
|
||||
panfrost_batch_get_bifrost_tiler(batch, vertex_count);
|
||||
panfrost_load_bifrost(&batch->pool, &batch->scoreboard,
|
||||
@@ -1004,7 +1004,7 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
|
||||
|
||||
/* Trace gets priority over sync */
|
||||
bool minimal = !(dev->debug & PAN_DBG_TRACE);
|
||||
pandecode_jc(submit.jc, dev->quirks & IS_BIFROST, dev->gpu_id, minimal);
|
||||
pandecode_jc(submit.jc, pan_is_bifrost(dev), dev->gpu_id, minimal);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -136,7 +136,6 @@ panfrost_mfbd_rt_set_buf(struct pipe_surface *surf,
|
||||
struct MALI_RENDER_TARGET *rt)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(surf->context->screen);
|
||||
bool is_bifrost = dev->quirks & IS_BIFROST;
|
||||
unsigned version = dev->gpu_id >> 12;
|
||||
struct panfrost_resource *rsrc = pan_resource(surf->texture);
|
||||
unsigned level = surf->u.tex.level;
|
||||
@@ -188,7 +187,7 @@ panfrost_mfbd_rt_set_buf(struct pipe_surface *surf,
|
||||
else
|
||||
rt->midgard.writeback_block_format = MALI_BLOCK_FORMAT_AFBC;
|
||||
|
||||
if (is_bifrost) {
|
||||
if (pan_is_bifrost(dev)) {
|
||||
rt->afbc.row_stride = slice->afbc.row_stride /
|
||||
AFBC_HEADER_BYTES_PER_TILE;
|
||||
rt->bifrost_afbc.afbc_wide_block_enable =
|
||||
@@ -261,7 +260,6 @@ panfrost_mfbd_zs_crc_ext_set_bufs(struct panfrost_batch *batch,
|
||||
struct panfrost_slice **checksum_slice)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
bool is_bifrost = dev->quirks & IS_BIFROST;
|
||||
unsigned version = dev->gpu_id >> 12;
|
||||
|
||||
/* Checksumming only works with a single render target */
|
||||
@@ -320,7 +318,7 @@ panfrost_mfbd_zs_crc_ext_set_bufs(struct panfrost_batch *batch,
|
||||
else
|
||||
ext->zs_block_format = MALI_BLOCK_FORMAT_AFBC;
|
||||
|
||||
if (is_bifrost) {
|
||||
if (pan_is_bifrost(dev)) {
|
||||
ext->zs_afbc_row_stride = slice->afbc.row_stride /
|
||||
AFBC_HEADER_BYTES_PER_TILE;
|
||||
} else {
|
||||
@@ -520,7 +518,7 @@ panfrost_attach_mfbd(struct panfrost_batch *batch, unsigned vertex_count)
|
||||
|
||||
panfrost_mfbd_emit_local_storage(batch, fb);
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
return;
|
||||
|
||||
pan_section_pack(fb, MULTI_TARGET_FRAMEBUFFER, PARAMETERS, params) {
|
||||
@@ -611,7 +609,7 @@ panfrost_mfbd_fragment(struct panfrost_batch *batch, bool has_draws)
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
panfrost_mfbd_emit_bifrost_parameters(batch, fb);
|
||||
else
|
||||
panfrost_mfbd_emit_local_storage(batch, fb);
|
||||
@@ -665,7 +663,7 @@ panfrost_mfbd_fragment(struct panfrost_batch *batch, bool has_draws)
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
panfrost_mfbd_emit_bifrost_tiler(batch, fb, vertex_count);
|
||||
else
|
||||
panfrost_mfbd_emit_midgard_tiler(batch, fb, vertex_count);
|
||||
|
||||
@@ -103,8 +103,6 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
bool has_mrt = !(dev->quirks & MIDGARD_SFBD);
|
||||
|
||||
/* Bifrost is WIP */
|
||||
bool is_bifrost = (dev->quirks & IS_BIFROST);
|
||||
|
||||
switch (param) {
|
||||
case PIPE_CAP_NPOT_TEXTURES:
|
||||
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
|
||||
@@ -225,7 +223,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
|
||||
case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
|
||||
case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
|
||||
return is_bifrost;
|
||||
return pan_is_bifrost(dev);
|
||||
|
||||
case PIPE_CAP_SEAMLESS_CUBE_MAP:
|
||||
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
|
||||
@@ -302,7 +300,6 @@ panfrost_get_shader_param(struct pipe_screen *screen,
|
||||
bool is_deqp = dev->debug & PAN_DBG_DEQP;
|
||||
bool is_fp16 = dev->debug & PAN_DBG_FP16;
|
||||
bool is_nofp16 = dev->debug & PAN_DBG_NOFP16;
|
||||
bool is_bifrost = dev->quirks & IS_BIFROST;
|
||||
|
||||
if (shader != PIPE_SHADER_VERTEX &&
|
||||
shader != PIPE_SHADER_FRAGMENT &&
|
||||
@@ -360,7 +357,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
|
||||
|
||||
case PIPE_SHADER_CAP_FP16:
|
||||
case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
|
||||
return (!is_nofp16 && !is_bifrost) || is_fp16;
|
||||
return (!is_nofp16 && !pan_is_bifrost(dev)) || is_fp16;
|
||||
|
||||
case PIPE_SHADER_CAP_FP16_DERIVATIVES:
|
||||
case PIPE_SHADER_CAP_INT16:
|
||||
@@ -389,7 +386,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
|
||||
return is_deqp ? 8 : 0;
|
||||
|
||||
case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
|
||||
return is_bifrost ? 0 : PIPE_MAX_SHADER_IMAGES;
|
||||
return pan_is_bifrost(dev) ? 0 : PIPE_MAX_SHADER_IMAGES;
|
||||
|
||||
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
|
||||
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
|
||||
@@ -767,7 +764,7 @@ panfrost_screen_get_compiler_options(struct pipe_screen *pscreen,
|
||||
enum pipe_shader_ir ir,
|
||||
enum pipe_shader_type shader)
|
||||
{
|
||||
if (pan_device(pscreen)->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(pan_device(pscreen)))
|
||||
return &bifrost_nir_options;
|
||||
else
|
||||
return &midgard_nir_options;
|
||||
|
||||
@@ -44,9 +44,6 @@
|
||||
|
||||
#define MIDGARD_BROKEN_FP16 (1 << 2)
|
||||
|
||||
/* What it says on the tin */
|
||||
#define IS_BIFROST (1 << 3)
|
||||
|
||||
/* What it says on the tin */
|
||||
#define HAS_SWIZZLES (1 << 4)
|
||||
|
||||
@@ -77,8 +74,7 @@
|
||||
| MIDGARD_NO_TYPED_BLEND_STORES \
|
||||
| MIDGARD_MISSING_LOADS)
|
||||
|
||||
/* TODO: AFBC on Bifrost */
|
||||
#define BIFROST_QUIRKS (IS_BIFROST | NO_BLEND_PACKS)
|
||||
#define BIFROST_QUIRKS NO_BLEND_PACKS
|
||||
|
||||
static inline unsigned
|
||||
panfrost_get_quirks(unsigned gpu_id, unsigned gpu_revision)
|
||||
|
||||
@@ -109,7 +109,7 @@ panfrost_build_blit_shader(struct panfrost_device *dev,
|
||||
|
||||
panfrost_program *program;
|
||||
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
program = bifrost_compile_shader_nir(NULL, shader, &inputs);
|
||||
else
|
||||
program = midgard_compile_shader_nir(NULL, shader, &inputs);
|
||||
@@ -124,7 +124,6 @@ panfrost_build_blit_shader(struct panfrost_device *dev,
|
||||
void
|
||||
panfrost_init_blit_shaders(struct panfrost_device *dev)
|
||||
{
|
||||
bool is_bifrost = !!(dev->quirks & IS_BIFROST);
|
||||
static const struct {
|
||||
gl_frag_result loc;
|
||||
unsigned types;
|
||||
@@ -156,7 +155,7 @@ panfrost_init_blit_shaders(struct panfrost_device *dev)
|
||||
unsigned offset = 0;
|
||||
unsigned total_size = (FRAG_RESULT_DATA7 * PAN_BLIT_NUM_TYPES) * (8 * 16) * 2;
|
||||
|
||||
if (is_bifrost)
|
||||
if (pan_is_bifrost(dev))
|
||||
total_size *= 4;
|
||||
|
||||
dev->blit_shaders.bo = panfrost_bo_create(dev, total_size, PAN_BO_EXECUTE);
|
||||
@@ -189,7 +188,8 @@ panfrost_init_blit_shaders(struct panfrost_device *dev)
|
||||
if (rt >= 0 && rt < 8 && program->blend_ret_offsets[rt])
|
||||
shader->blend_ret_addr = program->blend_ret_offsets[rt] + shader->shader;
|
||||
|
||||
offset += ALIGN_POT(program->compiled.size, is_bifrost ? 128 : 64);
|
||||
offset += ALIGN_POT(program->compiled.size,
|
||||
pan_is_bifrost(dev) ? 128 : 64);
|
||||
ralloc_free(program);
|
||||
}
|
||||
}
|
||||
@@ -258,11 +258,10 @@ panfrost_load_prepare_rsd(struct pan_pool *pool, struct MALI_RENDERER_STATE *sta
|
||||
|
||||
static void
|
||||
panfrost_load_emit_varying(struct pan_pool *pool, struct MALI_DRAW *draw,
|
||||
mali_ptr coordinates, unsigned vertex_count,
|
||||
bool is_bifrost)
|
||||
mali_ptr coordinates, unsigned vertex_count)
|
||||
{
|
||||
/* Bifrost needs an empty desc to mark end of prefetching */
|
||||
bool padding_buffer = is_bifrost;
|
||||
bool padding_buffer = pan_is_bifrost(pool->dev);
|
||||
|
||||
struct panfrost_ptr varying =
|
||||
panfrost_pool_alloc(pool, MALI_ATTRIBUTE_LENGTH);
|
||||
@@ -283,7 +282,7 @@ panfrost_load_emit_varying(struct pan_pool *pool, struct MALI_DRAW *draw,
|
||||
|
||||
pan_pack(varying.cpu, ATTRIBUTE, cfg) {
|
||||
cfg.buffer_index = 0;
|
||||
cfg.offset_enable = !is_bifrost;
|
||||
cfg.offset_enable = !pan_is_bifrost(pool->dev);
|
||||
cfg.format = pool->dev->formats[PIPE_FORMAT_R32G32_FLOAT].hw;
|
||||
}
|
||||
|
||||
@@ -453,7 +452,7 @@ panfrost_load_midg(struct pan_pool *pool,
|
||||
cfg.draw_descriptor_is_64b = true;
|
||||
cfg.four_components_per_vertex = true;
|
||||
|
||||
panfrost_load_emit_varying(pool, &cfg, coordinates, vertex_count, false);
|
||||
panfrost_load_emit_varying(pool, &cfg, coordinates, vertex_count);
|
||||
midgard_load_emit_texture(pool, &cfg, image);
|
||||
panfrost_load_emit_viewport(pool, &cfg, image);
|
||||
cfg.fbd = fbd;
|
||||
@@ -644,7 +643,7 @@ panfrost_load_bifrost(struct pan_pool *pool,
|
||||
cfg.four_components_per_vertex = true;
|
||||
cfg.draw_descriptor_is_64b = true;
|
||||
|
||||
panfrost_load_emit_varying(pool, &cfg, coordinates, vertex_count, true);
|
||||
panfrost_load_emit_varying(pool, &cfg, coordinates, vertex_count);
|
||||
bifrost_load_emit_texture(pool, &cfg, image);
|
||||
panfrost_load_emit_viewport(pool, &cfg, image);
|
||||
cfg.thread_storage = thread_storage;
|
||||
|
||||
@@ -168,4 +168,10 @@ pan_lookup_bo(struct panfrost_device *dev, uint32_t gem_handle)
|
||||
return util_sparse_array_get(&dev->bo_map, gem_handle);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
pan_is_bifrost(const struct panfrost_device *dev)
|
||||
{
|
||||
return dev->arch >= 6 && dev->arch <= 7;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,7 +115,6 @@ panfrost_add_job(
|
||||
const struct panfrost_ptr *job,
|
||||
bool inject)
|
||||
{
|
||||
bool is_bifrost = !!(pool->dev->quirks & IS_BIFROST);
|
||||
unsigned global_dep = 0;
|
||||
|
||||
if (type == MALI_JOB_TYPE_TILER) {
|
||||
@@ -123,12 +122,12 @@ panfrost_add_job(
|
||||
* job must depend on the write value job, whose index we
|
||||
* reserve now */
|
||||
|
||||
if (!is_bifrost && !scoreboard->write_value_index)
|
||||
if (!pan_is_bifrost(pool->dev) && !scoreboard->write_value_index)
|
||||
scoreboard->write_value_index = ++scoreboard->job_index;
|
||||
|
||||
if (scoreboard->tiler_dep && !inject)
|
||||
global_dep = scoreboard->tiler_dep;
|
||||
else if (!is_bifrost)
|
||||
else if (!pan_is_bifrost(pool->dev))
|
||||
global_dep = scoreboard->write_value_index;
|
||||
}
|
||||
|
||||
@@ -197,7 +196,7 @@ panfrost_scoreboard_initialize_tiler(struct pan_pool *pool,
|
||||
mali_ptr polygon_list)
|
||||
{
|
||||
/* Check if we even need tiling */
|
||||
if (pool->dev->quirks & IS_BIFROST || !scoreboard->tiler_dep)
|
||||
if (pan_is_bifrost(pool->dev) || !scoreboard->tiler_dep)
|
||||
return;
|
||||
|
||||
/* Okay, we do. Let's generate it. We'll need the job's polygon list
|
||||
|
||||
@@ -86,7 +86,7 @@ panfrost_needs_explicit_stride(const struct panfrost_device *dev,
|
||||
unsigned last_level)
|
||||
{
|
||||
/* Stride is explicit on Bifrost */
|
||||
if (dev->quirks & IS_BIFROST)
|
||||
if (pan_is_bifrost(dev))
|
||||
return true;
|
||||
|
||||
if (layout->modifier != DRM_FORMAT_MOD_LINEAR)
|
||||
@@ -135,13 +135,11 @@ panfrost_compression_tag(const struct panfrost_device *dev,
|
||||
enum mali_texture_dimension dim,
|
||||
uint64_t modifier)
|
||||
{
|
||||
bool is_bifrost = dev->quirks & IS_BIFROST;
|
||||
|
||||
if (drm_is_afbc(modifier)) {
|
||||
unsigned flags = (modifier & AFBC_FORMAT_MOD_YTR) ?
|
||||
MALI_AFBC_SURFACE_FLAG_YTR : 0;
|
||||
|
||||
if (!is_bifrost)
|
||||
if (!pan_is_bifrost(dev))
|
||||
return flags;
|
||||
|
||||
/* Prefetch enable */
|
||||
@@ -229,9 +227,8 @@ panfrost_estimate_texture_payload_size(const struct panfrost_device *dev,
|
||||
enum mali_texture_dimension dim,
|
||||
uint64_t modifier)
|
||||
{
|
||||
bool is_bifrost = dev->quirks & IS_BIFROST;
|
||||
/* Assume worst case */
|
||||
unsigned manual_stride = is_bifrost ||
|
||||
unsigned manual_stride = pan_is_bifrost(dev) ||
|
||||
(modifier == DRM_FORMAT_MOD_LINEAR);
|
||||
|
||||
unsigned elements = panfrost_texture_num_elements(
|
||||
@@ -429,7 +426,6 @@ panfrost_new_texture(const struct panfrost_device *dev,
|
||||
const struct util_format_description *desc =
|
||||
util_format_description(format);
|
||||
|
||||
bool is_bifrost = dev->quirks & IS_BIFROST;
|
||||
bool manual_stride =
|
||||
panfrost_needs_explicit_stride(dev, layout, format, width,
|
||||
first_level, last_level);
|
||||
@@ -443,7 +439,7 @@ panfrost_new_texture(const struct panfrost_device *dev,
|
||||
manual_stride,
|
||||
base);
|
||||
|
||||
if (is_bifrost) {
|
||||
if (pan_is_bifrost(dev)) {
|
||||
pan_pack(out, BIFROST_TEXTURE, cfg) {
|
||||
cfg.dimension = dim;
|
||||
cfg.format = dev->formats[format].hw;
|
||||
|
||||
Reference in New Issue
Block a user