mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
panfrost: Move pan_blitter.{c,h} to the gallium driver
Move pan_blitter.{c,h} to the gallium driver and rename it
pan_fb_preload to reflect the fact it's not a generic blitter framework.
While at it, get rid of the remaining generic blitting bits and pick
better names for objects related to the preload stuff in
panfrost_{device,screen}.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31441>
This commit is contained in:
parent
0bc3502ca3
commit
fe6e96d685
10 changed files with 269 additions and 391 deletions
|
|
@ -45,7 +45,11 @@ panfrost_versions = ['4', '5', '6', '7', '9', '10']
|
|||
libpanfrost_versions = []
|
||||
|
||||
foreach ver : panfrost_versions
|
||||
files_panfrost_vx = ['pan_cmdstream.c', pan_packers]
|
||||
files_panfrost_vx = [
|
||||
'pan_cmdstream.c',
|
||||
'pan_fb_preload.c',
|
||||
pan_packers,
|
||||
]
|
||||
if ver in ['4', '5', '6', '7', '9']
|
||||
files_panfrost_vx += ['pan_jm.c']
|
||||
elif ver in ['10']
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@
|
|||
|
||||
#include "pan_afbc_cso.h"
|
||||
#include "pan_blend.h"
|
||||
#include "pan_blitter.h"
|
||||
#include "pan_bo.h"
|
||||
#include "pan_cmdstream.h"
|
||||
#include "pan_context.h"
|
||||
#include "pan_csf.h"
|
||||
#include "pan_fb_preload.h"
|
||||
#include "pan_format.h"
|
||||
#include "pan_indirect_dispatch.h"
|
||||
#include "pan_jm.h"
|
||||
|
|
@ -3818,7 +3818,7 @@ static void
|
|||
screen_destroy(struct pipe_screen *pscreen)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(pscreen);
|
||||
GENX(pan_blitter_cache_cleanup)(&dev->blitter);
|
||||
GENX(pan_fb_preload_cache_cleanup)(&dev->fb_preload_cache);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3972,13 +3972,13 @@ GENX(panfrost_cmdstream_screen_init)(struct panfrost_screen *screen)
|
|||
screen->vtbl.afbc_pack = panfrost_afbc_pack;
|
||||
screen->vtbl.emit_write_timestamp = emit_write_timestamp;
|
||||
|
||||
GENX(pan_blitter_cache_init)
|
||||
(&dev->blitter, panfrost_device_gpu_id(dev), &dev->blend_shaders,
|
||||
&screen->blitter.bin_pool.base, &screen->blitter.desc_pool.base);
|
||||
GENX(pan_fb_preload_cache_init)
|
||||
(&dev->fb_preload_cache, panfrost_device_gpu_id(dev), &dev->blend_shaders,
|
||||
&screen->mempools.bin.base, &screen->mempools.desc.base);
|
||||
|
||||
#if PAN_GPU_SUPPORTS_DISPATCH_INDIRECT
|
||||
pan_indirect_dispatch_meta_init(
|
||||
&dev->indirect_dispatch, panfrost_device_gpu_id(dev),
|
||||
&screen->blitter.bin_pool.base, &screen->blitter.desc_pool.base);
|
||||
&screen->mempools.bin.base, &screen->mempools.desc.base);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@
|
|||
#include "genxml/cs_builder.h"
|
||||
#include "panfrost/lib/genxml/cs_builder.h"
|
||||
|
||||
#include "pan_blitter.h"
|
||||
#include "pan_cmdstream.h"
|
||||
#include "pan_context.h"
|
||||
#include "pan_csf.h"
|
||||
#include "pan_fb_preload.h"
|
||||
#include "pan_job.h"
|
||||
|
||||
#if PAN_ARCH < 10
|
||||
|
|
@ -462,7 +462,7 @@ GENX(csf_preload_fb)(struct panfrost_batch *batch, struct pan_fb_info *fb)
|
|||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
|
||||
GENX(pan_preload_fb)
|
||||
(&dev->blitter, &batch->pool.base, fb, 0, batch->tls.gpu, NULL);
|
||||
(&dev->fb_preload_cache, &batch->pool.base, fb, batch->tls.gpu, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include "panfrost/util/pan_ir.h"
|
||||
#include "pan_blend.h"
|
||||
#include "pan_blitter.h"
|
||||
#include "pan_fb_preload.h"
|
||||
#include "pan_indirect_dispatch.h"
|
||||
#include "pan_pool.h"
|
||||
#include "pan_props.h"
|
||||
|
|
@ -152,7 +152,7 @@ struct panfrost_device {
|
|||
struct list_head buckets[NR_BO_CACHE_BUCKETS];
|
||||
} bo_cache;
|
||||
|
||||
struct pan_blitter_cache blitter;
|
||||
struct pan_fb_preload_cache fb_preload_cache;
|
||||
struct pan_blend_shader_cache blend_shaders;
|
||||
struct pan_indirect_dispatch_meta indirect_dispatch;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -22,8 +22,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef __PAN_BLITTER_H
|
||||
#define __PAN_BLITTER_H
|
||||
#ifndef __PAN_FB_PRELOAD_H
|
||||
#define __PAN_FB_PRELOAD_H
|
||||
|
||||
#include "util/format/u_format.h"
|
||||
#include "pan_desc.h"
|
||||
|
|
@ -36,11 +36,11 @@ struct pan_fb_info;
|
|||
struct pan_jc;
|
||||
struct pan_pool;
|
||||
|
||||
struct pan_blitter_cache {
|
||||
struct pan_fb_preload_cache {
|
||||
unsigned gpu_id;
|
||||
struct {
|
||||
struct pan_pool *pool;
|
||||
struct hash_table *blit;
|
||||
struct hash_table *preload;
|
||||
struct hash_table *blend;
|
||||
pthread_mutex_t lock;
|
||||
} shaders;
|
||||
|
|
@ -52,61 +52,18 @@ struct pan_blitter_cache {
|
|||
struct pan_blend_shader_cache *blend_shader_cache;
|
||||
};
|
||||
|
||||
struct pan_blit_info {
|
||||
struct {
|
||||
struct {
|
||||
const struct pan_image *image;
|
||||
enum pipe_format format;
|
||||
} planes[MAX_IMAGE_PLANES];
|
||||
unsigned level;
|
||||
struct {
|
||||
int32_t x, y, z;
|
||||
unsigned layer;
|
||||
} start, end;
|
||||
} src, dst;
|
||||
struct {
|
||||
bool enable;
|
||||
uint16_t minx, miny, maxx, maxy;
|
||||
} scissor;
|
||||
bool nearest;
|
||||
};
|
||||
|
||||
struct pan_blit_context {
|
||||
mali_ptr rsd, vpd;
|
||||
mali_ptr textures;
|
||||
mali_ptr samplers;
|
||||
mali_ptr position;
|
||||
struct {
|
||||
enum mali_texture_dimension dim;
|
||||
struct {
|
||||
float x, y;
|
||||
} start, end;
|
||||
union {
|
||||
unsigned layer_offset;
|
||||
float z_offset;
|
||||
};
|
||||
} src;
|
||||
struct {
|
||||
int32_t layer_offset;
|
||||
int32_t cur_layer;
|
||||
int32_t last_layer;
|
||||
} dst;
|
||||
float z_scale;
|
||||
};
|
||||
|
||||
#ifdef PAN_ARCH
|
||||
void GENX(pan_blitter_cache_init)(struct pan_blitter_cache *cache,
|
||||
unsigned gpu_id,
|
||||
struct pan_blend_shader_cache *blend_shader_cache,
|
||||
struct pan_pool *bin_pool,
|
||||
struct pan_pool *desc_pool);
|
||||
void GENX(pan_fb_preload_cache_init)(
|
||||
struct pan_fb_preload_cache *cache, unsigned gpu_id,
|
||||
struct pan_blend_shader_cache *blend_shader_cache, struct pan_pool *bin_pool,
|
||||
struct pan_pool *desc_pool);
|
||||
|
||||
void GENX(pan_blitter_cache_cleanup)(struct pan_blitter_cache *cache);
|
||||
void GENX(pan_fb_preload_cache_cleanup)(struct pan_fb_preload_cache *cache);
|
||||
|
||||
unsigned GENX(pan_preload_fb)(struct pan_blitter_cache *cache,
|
||||
unsigned GENX(pan_preload_fb)(struct pan_fb_preload_cache *cache,
|
||||
struct pan_pool *desc_pool,
|
||||
struct pan_fb_info *fb, unsigned layer_idx,
|
||||
mali_ptr tsd, struct panfrost_ptr *jobs);
|
||||
struct pan_fb_info *fb, mali_ptr tsd,
|
||||
struct panfrost_ptr *jobs);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -27,9 +27,9 @@
|
|||
|
||||
#include "drm-uapi/panfrost_drm.h"
|
||||
|
||||
#include "pan_blitter.h"
|
||||
#include "pan_cmdstream.h"
|
||||
#include "pan_context.h"
|
||||
#include "pan_fb_preload.h"
|
||||
#include "pan_indirect_dispatch.h"
|
||||
#include "pan_jm.h"
|
||||
#include "pan_job.h"
|
||||
|
|
@ -241,8 +241,9 @@ GENX(jm_preload_fb)(struct panfrost_batch *batch, struct pan_fb_info *fb)
|
|||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
struct panfrost_ptr preload_jobs[2];
|
||||
|
||||
unsigned preload_job_count = GENX(pan_preload_fb)(
|
||||
&dev->blitter, &batch->pool.base, fb, 0, batch->tls.gpu, preload_jobs);
|
||||
unsigned preload_job_count =
|
||||
GENX(pan_preload_fb)(&dev->fb_preload_cache, &batch->pool.base, fb,
|
||||
batch->tls.gpu, preload_jobs);
|
||||
|
||||
assert(PAN_ARCH < 6 || !preload_job_count);
|
||||
|
||||
|
|
|
|||
|
|
@ -873,8 +873,8 @@ panfrost_destroy_screen(struct pipe_screen *pscreen)
|
|||
struct panfrost_screen *screen = pan_screen(pscreen);
|
||||
|
||||
panfrost_resource_screen_destroy(pscreen);
|
||||
panfrost_pool_cleanup(&screen->blitter.bin_pool);
|
||||
panfrost_pool_cleanup(&screen->blitter.desc_pool);
|
||||
panfrost_pool_cleanup(&screen->mempools.bin);
|
||||
panfrost_pool_cleanup(&screen->mempools.desc);
|
||||
pan_blend_shader_cache_cleanup(&dev->blend_shaders);
|
||||
|
||||
if (screen->vtbl.screen_destroy)
|
||||
|
|
@ -1024,10 +1024,10 @@ panfrost_create_screen(int fd, const struct pipe_screen_config *config,
|
|||
|
||||
panfrost_disk_cache_init(screen);
|
||||
|
||||
panfrost_pool_init(&screen->blitter.bin_pool, NULL, dev, PAN_BO_EXECUTE,
|
||||
4096, "Blitter shaders", false, true);
|
||||
panfrost_pool_init(&screen->blitter.desc_pool, NULL, dev, 0, 65536,
|
||||
"Blitter RSDs", false, true);
|
||||
panfrost_pool_init(&screen->mempools.bin, NULL, dev, PAN_BO_EXECUTE, 4096,
|
||||
"Preload shaders", false, true);
|
||||
panfrost_pool_init(&screen->mempools.desc, NULL, dev, 0, 65536,
|
||||
"Preload RSDs", false, true);
|
||||
if (dev->arch == 4)
|
||||
panfrost_cmdstream_screen_init_v4(screen);
|
||||
else if (dev->arch == 5)
|
||||
|
|
|
|||
|
|
@ -113,9 +113,9 @@ struct panfrost_screen {
|
|||
struct pipe_screen base;
|
||||
struct panfrost_device dev;
|
||||
struct {
|
||||
struct panfrost_pool bin_pool;
|
||||
struct panfrost_pool desc_pool;
|
||||
} blitter;
|
||||
struct panfrost_pool bin;
|
||||
struct panfrost_pool desc;
|
||||
} mempools;
|
||||
|
||||
struct panfrost_vtable vtbl;
|
||||
struct disk_cache *disk_cache;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ foreach ver : ['4', '5', '6', '7', '9', '10']
|
|||
'pan-arch-v' + ver,
|
||||
[
|
||||
'pan_blend.c',
|
||||
'pan_blitter.c',
|
||||
'pan_desc.c',
|
||||
'pan_shader.c',
|
||||
'pan_texture.c',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue