#ifndef __PAN_CS_H
#define __PAN_CS_H
#include "pan_texture.h"
struct pan_compute_dim {
uint32_t x, y, z;
};
struct pan_fb_color_attachment {
const struct pan_image_view *view;
bool *crc_valid;
bool clear;
bool preload;
bool discard;
uint32_t clear_value[4];
};
struct pan_fb_zs_attachment {
struct {
const struct pan_image_view *zs, *s;
} view;
struct {
bool z, s;
} clear;
struct {
bool z, s;
} discard;
struct {
bool z, s;
} preload;
struct {
float depth;
uint8_t stencil;
} clear_value;
};
struct pan_tiler_context {
union {
mali_ptr bifrost;
struct {
bool disable;
struct panfrost_bo *polygon_list;
} midgard;
};
};
struct pan_tls_info {
struct {
mali_ptr ptr;
unsigned size;
} tls;
struct {
struct pan_compute_dim dim;
mali_ptr ptr;
unsigned size;
} wls;
};
struct pan_fb_bifrost_info {
struct {
struct panfrost_ptr dcds;
enum mali_pre_post_frame_shader_mode modes[3];
} pre_post;
};
struct pan_fb_info {
unsigned width, height;
struct {
unsigned minx, miny, maxx, maxy;
} extent;
unsigned nr_samples;
unsigned rt_count;
struct pan_fb_color_attachment rts[8];
struct pan_fb_zs_attachment zs;
struct {
unsigned stride;
mali_ptr base;
} tile_map;
union {
struct pan_fb_bifrost_info bifrost;
};
};
unsigned
pan_wls_mem_size(const struct panfrost_device *dev,
const struct pan_compute_dim *dim,
unsigned wls_size);
void
pan_emit_tls(const struct panfrost_device *dev,
const struct pan_tls_info *info,
void *out);
bool
pan_fbd_has_zs_crc_ext(const struct panfrost_device *dev,
const struct pan_fb_info *fb);
int
pan_select_crc_rt(const struct panfrost_device *dev,
const struct pan_fb_info *fb);
unsigned
pan_emit_fbd(const struct panfrost_device *dev,
const struct pan_fb_info *fb,
const struct pan_tls_info *tls,
const struct pan_tiler_context *tiler_ctx,
void *out);
void
pan_emit_bifrost_tiler_heap(const struct panfrost_device *dev,
void *out);
void
pan_emit_bifrost_tiler(const struct panfrost_device *dev,
unsigned fb_width, unsigned fb_height,
unsigned nr_samples,
mali_ptr heap,
void *out);
void
pan_emit_fragment_job(const struct panfrost_device *dev,
const struct pan_fb_info *fb,
mali_ptr fbd,
void *out);
#endif