panfrost: Make pan_desc.{c,h} panfrost_bo agnostic
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
This commit is contained in:

committed by
Marge Bot

parent
f94889d079
commit
493cf2f008
@@ -3686,23 +3686,24 @@ batch_get_polygon_list(struct panfrost_batch *batch)
|
|||||||
* no WRITE_VALUE job in the chain
|
* no WRITE_VALUE job in the chain
|
||||||
*/
|
*/
|
||||||
bool init_polygon_list = !has_draws;
|
bool init_polygon_list = !has_draws;
|
||||||
batch->tiler_ctx.midgard.polygon_list = panfrost_batch_create_bo(
|
batch->polygon_list_bo = panfrost_batch_create_bo(
|
||||||
batch, size, init_polygon_list ? 0 : PAN_BO_INVISIBLE,
|
batch, size, init_polygon_list ? 0 : PAN_BO_INVISIBLE,
|
||||||
PIPE_SHADER_VERTEX, "Polygon list");
|
PIPE_SHADER_VERTEX, "Polygon list");
|
||||||
panfrost_batch_add_bo(batch, batch->tiler_ctx.midgard.polygon_list,
|
batch->tiler_ctx.midgard.polygon_list = batch->polygon_list_bo->ptr.gpu;
|
||||||
|
panfrost_batch_add_bo(batch, batch->polygon_list_bo,
|
||||||
PIPE_SHADER_FRAGMENT);
|
PIPE_SHADER_FRAGMENT);
|
||||||
|
|
||||||
if (init_polygon_list && dev->model->quirks.no_hierarchical_tiling) {
|
if (init_polygon_list && dev->model->quirks.no_hierarchical_tiling) {
|
||||||
assert(batch->tiler_ctx.midgard.polygon_list->ptr.cpu);
|
assert(batch->polygon_list_bo->ptr.cpu);
|
||||||
uint32_t *polygon_list_body =
|
uint32_t *polygon_list_body =
|
||||||
batch->tiler_ctx.midgard.polygon_list->ptr.cpu +
|
batch->polygon_list_bo->ptr.cpu +
|
||||||
MALI_MIDGARD_TILER_MINIMUM_HEADER_SIZE;
|
MALI_MIDGARD_TILER_MINIMUM_HEADER_SIZE;
|
||||||
|
|
||||||
/* Magic for Mali T720 */
|
/* Magic for Mali T720 */
|
||||||
polygon_list_body[0] = 0xa0000000;
|
polygon_list_body[0] = 0xa0000000;
|
||||||
} else if (init_polygon_list) {
|
} else if (init_polygon_list) {
|
||||||
assert(batch->tiler_ctx.midgard.polygon_list->ptr.cpu);
|
assert(batch->polygon_list_bo->ptr.cpu);
|
||||||
uint32_t *header = batch->tiler_ctx.midgard.polygon_list->ptr.cpu;
|
uint32_t *header = batch->polygon_list_bo->ptr.cpu;
|
||||||
memset(header, 0, size);
|
memset(header, 0, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3713,7 +3714,7 @@ batch_get_polygon_list(struct panfrost_batch *batch)
|
|||||||
batch->tiler_ctx.midgard.heap.size = panfrost_bo_size(dev->tiler_heap);
|
batch->tiler_ctx.midgard.heap.size = panfrost_bo_size(dev->tiler_heap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return batch->tiler_ctx.midgard.polygon_list->ptr.gpu;
|
return batch->tiler_ctx.midgard.polygon_list;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -154,6 +154,9 @@ struct panfrost_batch {
|
|||||||
/* Tiler context */
|
/* Tiler context */
|
||||||
struct pan_tiler_context tiler_ctx;
|
struct pan_tiler_context tiler_ctx;
|
||||||
|
|
||||||
|
/* Only used on midgard. */
|
||||||
|
struct panfrost_bo *polygon_list_bo;
|
||||||
|
|
||||||
/* Keep the num_work_groups sysval around for indirect dispatch */
|
/* Keep the num_work_groups sysval around for indirect dispatch */
|
||||||
mali_ptr num_wg_sysval[3];
|
mali_ptr num_wg_sysval[3];
|
||||||
|
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include "genxml/gen_macros.h"
|
#include "genxml/gen_macros.h"
|
||||||
|
|
||||||
#include "pan_bo.h"
|
|
||||||
#include "pan_desc.h"
|
#include "pan_desc.h"
|
||||||
#include "pan_encoder.h"
|
#include "pan_encoder.h"
|
||||||
#include "pan_texture.h"
|
#include "pan_texture.h"
|
||||||
@@ -570,7 +569,7 @@ pan_emit_midgard_tiler(const struct pan_fb_info *fb,
|
|||||||
{
|
{
|
||||||
bool hierarchy = !tiler_ctx->midgard.no_hierarchical_tiling;
|
bool hierarchy = !tiler_ctx->midgard.no_hierarchical_tiling;
|
||||||
|
|
||||||
assert(tiler_ctx->midgard.polygon_list->ptr.gpu);
|
assert(tiler_ctx->midgard.polygon_list);
|
||||||
|
|
||||||
pan_pack(out, TILER_CONTEXT, cfg) {
|
pan_pack(out, TILER_CONTEXT, cfg) {
|
||||||
unsigned header_size;
|
unsigned header_size;
|
||||||
@@ -580,8 +579,8 @@ pan_emit_midgard_tiler(const struct pan_fb_info *fb,
|
|||||||
hierarchy ? MALI_MIDGARD_TILER_DISABLED : MALI_MIDGARD_TILER_USER;
|
hierarchy ? MALI_MIDGARD_TILER_DISABLED : MALI_MIDGARD_TILER_USER;
|
||||||
header_size = MALI_MIDGARD_TILER_MINIMUM_HEADER_SIZE;
|
header_size = MALI_MIDGARD_TILER_MINIMUM_HEADER_SIZE;
|
||||||
cfg.polygon_list_size = header_size + (hierarchy ? 0 : 4);
|
cfg.polygon_list_size = header_size + (hierarchy ? 0 : 4);
|
||||||
cfg.heap_start = tiler_ctx->midgard.polygon_list->ptr.gpu;
|
cfg.heap_start = tiler_ctx->midgard.polygon_list;
|
||||||
cfg.heap_end = tiler_ctx->midgard.polygon_list->ptr.gpu;
|
cfg.heap_end = tiler_ctx->midgard.polygon_list;
|
||||||
} else {
|
} else {
|
||||||
cfg.hierarchy_mask = panfrost_choose_hierarchy_mask(
|
cfg.hierarchy_mask = panfrost_choose_hierarchy_mask(
|
||||||
fb->width, fb->height, tiler_ctx->vertex_count, hierarchy);
|
fb->width, fb->height, tiler_ctx->vertex_count, hierarchy);
|
||||||
@@ -593,7 +592,7 @@ pan_emit_midgard_tiler(const struct pan_fb_info *fb,
|
|||||||
cfg.heap_end = cfg.heap_start + tiler_ctx->midgard.heap.size;
|
cfg.heap_end = cfg.heap_start + tiler_ctx->midgard.heap.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.polygon_list = tiler_ctx->midgard.polygon_list->ptr.gpu;
|
cfg.polygon_list = tiler_ctx->midgard.polygon_list;
|
||||||
cfg.polygon_list_body = cfg.polygon_list + header_size;
|
cfg.polygon_list_body = cfg.polygon_list + header_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ struct pan_tiler_context {
|
|||||||
struct {
|
struct {
|
||||||
bool disable;
|
bool disable;
|
||||||
bool no_hierarchical_tiling;
|
bool no_hierarchical_tiling;
|
||||||
struct panfrost_bo *polygon_list;
|
mali_ptr polygon_list;
|
||||||
struct {
|
struct {
|
||||||
mali_ptr start;
|
mali_ptr start;
|
||||||
unsigned size;
|
unsigned size;
|
||||||
|
Reference in New Issue
Block a user