panvk: Move panvk_meta definitions to panvk_meta.h

While at it, merge panvk_vX_meta.h into panvk_meta.h and stop including
panvk_meta_vX.h from panvk_private.h.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28170>
This commit is contained in:
Boris Brezillon 2023-12-21 11:14:26 +01:00 committed by Marge Bot
parent ac34183ec3
commit 524e17664f
4 changed files with 93 additions and 109 deletions

View file

@ -0,0 +1,91 @@
/*
* Copyright © 2021 Collabora Ltd.
* SPDX-License-Identifier: MIT
*/
#ifndef PANVK_META_H
#define PANVK_META_H
#include "panvk_macros.h"
#include "panvk_mempool.h"
#include "pan_blend.h"
#include "pan_blitter.h"
#define PANVK_META_COPY_BUF2IMG_NUM_FORMATS 12
#define PANVK_META_COPY_IMG2BUF_NUM_FORMATS 12
#define PANVK_META_COPY_IMG2IMG_NUM_FORMATS 14
#define PANVK_META_COPY_NUM_TEX_TYPES 5
#define PANVK_META_COPY_BUF2BUF_NUM_BLKSIZES 5
static inline unsigned
panvk_meta_copy_tex_type(unsigned dim, bool isarray)
{
assert(dim > 0 && dim <= 3);
assert(dim < 3 || !isarray);
return (((dim - 1) << 1) | (isarray ? 1 : 0));
}
struct panvk_meta {
struct panvk_pool bin_pool;
struct panvk_pool desc_pool;
/* Access to the blitter pools are protected by the blitter
* shader/rsd locks. They can't be merged with other binary/desc
* pools unless we patch pan_blitter.c to external pool locks.
*/
struct {
struct panvk_pool bin_pool;
struct panvk_pool desc_pool;
struct pan_blitter_cache cache;
} blitter;
struct pan_blend_shader_cache blend_shader_cache;
struct {
struct {
mali_ptr shader;
struct pan_shader_info shader_info;
} color[3]; /* 3 base types */
} clear_attachment;
struct {
struct {
mali_ptr rsd;
} buf2img[PANVK_META_COPY_BUF2IMG_NUM_FORMATS];
struct {
mali_ptr rsd;
} img2buf[PANVK_META_COPY_NUM_TEX_TYPES]
[PANVK_META_COPY_IMG2BUF_NUM_FORMATS];
struct {
mali_ptr rsd;
} img2img[2][PANVK_META_COPY_NUM_TEX_TYPES]
[PANVK_META_COPY_IMG2IMG_NUM_FORMATS];
struct {
mali_ptr rsd;
} buf2buf[PANVK_META_COPY_BUF2BUF_NUM_BLKSIZES];
struct {
mali_ptr rsd;
} fillbuf;
} copy;
};
#if PAN_ARCH
void panvk_per_arch(meta_init)(struct panvk_device *dev);
void panvk_per_arch(meta_cleanup)(struct panvk_device *dev);
mali_ptr panvk_per_arch(meta_emit_viewport)(struct pan_pool *pool,
uint16_t minx, uint16_t miny,
uint16_t maxx, uint16_t maxy);
void panvk_per_arch(meta_clear_init)(struct panvk_device *dev);
void panvk_per_arch(meta_blit_init)(struct panvk_device *dev);
void panvk_per_arch(meta_blit_cleanup)(struct panvk_device *dev);
void panvk_per_arch(meta_copy_init)(struct panvk_device *dev);
#endif
#endif

View file

@ -72,6 +72,7 @@
#include "panvk_instance.h"
#include "panvk_macros.h"
#include "panvk_mempool.h"
#include "panvk_meta.h"
#include "panvk_physical_device.h"
#include "panvk_pipeline.h"
#include "panvk_pipeline_layout.h"
@ -129,65 +130,6 @@ struct panvk_priv_bo *panvk_priv_bo_create(struct panvk_device *dev,
void panvk_priv_bo_destroy(struct panvk_priv_bo *bo,
const VkAllocationCallbacks *alloc);
#define PANVK_META_COPY_BUF2IMG_NUM_FORMATS 12
#define PANVK_META_COPY_IMG2BUF_NUM_FORMATS 12
#define PANVK_META_COPY_IMG2IMG_NUM_FORMATS 14
#define PANVK_META_COPY_NUM_TEX_TYPES 5
#define PANVK_META_COPY_BUF2BUF_NUM_BLKSIZES 5
static inline unsigned
panvk_meta_copy_tex_type(unsigned dim, bool isarray)
{
assert(dim > 0 && dim <= 3);
assert(dim < 3 || !isarray);
return (((dim - 1) << 1) | (isarray ? 1 : 0));
}
struct panvk_meta {
struct panvk_pool bin_pool;
struct panvk_pool desc_pool;
/* Access to the blitter pools are protected by the blitter
* shader/rsd locks. They can't be merged with other binary/desc
* pools unless we patch pan_blitter.c to external pool locks.
*/
struct {
struct panvk_pool bin_pool;
struct panvk_pool desc_pool;
struct pan_blitter_cache cache;
} blitter;
struct pan_blend_shader_cache blend_shader_cache;
struct {
struct {
mali_ptr shader;
struct pan_shader_info shader_info;
} color[3]; /* 3 base types */
} clear_attachment;
struct {
struct {
mali_ptr rsd;
} buf2img[PANVK_META_COPY_BUF2IMG_NUM_FORMATS];
struct {
mali_ptr rsd;
} img2buf[PANVK_META_COPY_NUM_TEX_TYPES]
[PANVK_META_COPY_IMG2BUF_NUM_FORMATS];
struct {
mali_ptr rsd;
} img2img[2][PANVK_META_COPY_NUM_TEX_TYPES]
[PANVK_META_COPY_IMG2IMG_NUM_FORMATS];
struct {
mali_ptr rsd;
} buf2buf[PANVK_META_COPY_BUF2BUF_NUM_BLKSIZES];
struct {
mali_ptr rsd;
} fillbuf;
} copy;
};
VkResult panvk_wsi_init(struct panvk_physical_device *physical_device);
void panvk_wsi_finish(struct panvk_physical_device *physical_device);
@ -408,20 +350,17 @@ VK_DEFINE_HANDLE_CASTS(panvk_device, vk.base, VkDevice, VK_OBJECT_TYPE_DEVICE)
#ifdef PAN_ARCH
#include "panvk_vX_cmd_buffer.h"
#include "panvk_vX_device.h"
#include "panvk_vX_meta.h"
#else
#define PAN_ARCH 6
#define panvk_per_arch(name) panvk_arch_name(name, v6)
#include "panvk_vX_cmd_buffer.h"
#include "panvk_vX_device.h"
#include "panvk_vX_meta.h"
#undef PAN_ARCH
#undef panvk_per_arch
#define PAN_ARCH 7
#define panvk_per_arch(name) panvk_arch_name(name, v7)
#include "panvk_vX_cmd_buffer.h"
#include "panvk_vX_device.h"
#include "panvk_vX_meta.h"
#undef PAN_ARCH
#undef panvk_per_arch
#endif

View file

@ -1,46 +0,0 @@
/*
* Copyright (C) 2021 Collabora Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef PANVK_PRIVATE_H
#error "Must be included from panvk_private.h"
#endif
#ifndef PAN_ARCH
#error "no arch"
#endif
void panvk_per_arch(meta_init)(struct panvk_device *dev);
void panvk_per_arch(meta_cleanup)(struct panvk_device *dev);
mali_ptr panvk_per_arch(meta_emit_viewport)(struct pan_pool *pool,
uint16_t minx, uint16_t miny,
uint16_t maxx, uint16_t maxy);
void panvk_per_arch(meta_clear_init)(struct panvk_device *dev);
void panvk_per_arch(meta_blit_init)(struct panvk_device *dev);
void panvk_per_arch(meta_blit_cleanup)(struct panvk_device *dev);
void panvk_per_arch(meta_copy_init)(struct panvk_device *dev);

View file

@ -28,9 +28,9 @@
#include "pan_shader.h"
#include "panvk_image.h"
#include "panvk_meta.h"
#include "panvk_physical_device.h"
#include "panvk_private.h"
#include "panvk_vX_meta.h"
#include "vk_format.h"
#include "vk_render_pass.h"