pvr: break out buffer to separate header

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37432>
This commit is contained in:
Erik Faye-Lund 2025-09-02 16:43:13 +02:00 committed by Marge Bot
parent e0d9effa7a
commit 87193fc6ce
8 changed files with 63 additions and 34 deletions

View file

@ -28,6 +28,7 @@
#include <vulkan/vulkan.h>
#include "pvr_blit.h"
#include "pvr_buffer.h"
#include "pvr_clear.h"
#include "pvr_csb.h"
#include "pvr_device.h"

View file

@ -0,0 +1,56 @@
/*
* Copyright © 2022 Imagination Technologies Ltd.
*
* based in part on anv driver which is:
* Copyright © 2015 Intel Corporation
*
* based in part on radv driver which is:
* Copyright © 2016 Red Hat.
* Copyright © 2016 Bas Nieuwenhuizen
*
* SPDX-License-Identifier: MIT
*/
#ifndef PVR_BUFFER_H
#define PVR_BUFFER_H
#include "vk_buffer.h"
#include "vk_buffer_view.h"
#include "pvr_common.h"
struct pvr_buffer {
struct vk_buffer vk;
/* Derived and other state */
uint32_t alignment;
/* vma this buffer is bound to */
struct pvr_winsys_vma *vma;
/* Device address the buffer is mapped to in device virtual address space */
pvr_dev_addr_t dev_addr;
};
#define PVR_BUFFER_VIEW_WIDTH 8192U
struct pvr_buffer_view {
struct vk_buffer_view vk;
uint32_t num_rows;
/* Prepacked Texture dword 0 and 1. It will be copied to the descriptor
* during pvr_UpdateDescriptorSets().
*/
struct pvr_image_descriptor image_state;
};
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_buffer,
vk.base,
VkBuffer,
VK_OBJECT_TYPE_BUFFER)
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_buffer_view,
vk.base,
VkBufferView,
VK_OBJECT_TYPE_BUFFER_VIEW)
#endif /* PVR_BUFFER_H */

View file

@ -33,6 +33,7 @@
#include "hwdef/rogue_hw_utils.h"
#include "pvr_blit.h"
#include "pvr_bo.h"
#include "pvr_buffer.h"
#include "pvr_clear.h"
#include "pvr_common.h"
#include "pvr_csb.h"

View file

@ -30,6 +30,7 @@
#include "hwdef/rogue_hw_utils.h"
#include "pvr_bo.h"
#include "pvr_buffer.h"
#include "pvr_debug.h"
#include "pvr_device.h"
#include "pvr_image.h"

View file

@ -49,6 +49,7 @@
#include "pco_uscgen_programs.h"
#include "pvr_bo.h"
#include "pvr_border.h"
#include "pvr_buffer.h"
#include "pvr_clear.h"
#include "pvr_csb.h"
#include "pvr_csb_enum_helpers.h"

View file

@ -28,6 +28,7 @@
#include <stdint.h>
#include <string.h>
#include "pvr_buffer.h"
#include "pvr_csb.h"
#include "pvr_device.h"
#include "pvr_device_info.h"

View file

@ -61,8 +61,6 @@
#include "util/simple_mtx.h"
#include "util/u_dynarray.h"
#include "util/u_math.h"
#include "vk_buffer.h"
#include "vk_buffer_view.h"
#include "vk_command_buffer.h"
#include "vk_enum_to_str.h"
#include "vk_graphics_state.h"
@ -79,6 +77,7 @@
#endif
struct pvr_bo;
struct pvr_buffer;
struct pvr_compute_pipeline;
struct pvr_device;
struct pvr_graphics_pipeline;
@ -90,30 +89,6 @@ struct pvr_vertex_binding {
VkDeviceSize size;
};
struct pvr_buffer {
struct vk_buffer vk;
/* Derived and other state */
uint32_t alignment;
/* vma this buffer is bound to */
struct pvr_winsys_vma *vma;
/* Device address the buffer is mapped to in device virtual address space */
pvr_dev_addr_t dev_addr;
};
#define PVR_BUFFER_VIEW_WIDTH 8192U
struct pvr_buffer_view {
struct vk_buffer_view vk;
uint32_t num_rows;
/* Prepacked Texture dword 0 and 1. It will be copied to the descriptor
* during pvr_UpdateDescriptorSets().
*/
struct pvr_image_descriptor image_state;
};
#define PVR_TRANSFER_MAX_SOURCES 10U
#define PVR_TRANSFER_MAX_CUSTOM_MAPPINGS 6U
@ -1159,14 +1134,6 @@ VK_DEFINE_HANDLE_CASTS(pvr_cmd_buffer,
VkCommandBuffer,
VK_OBJECT_TYPE_COMMAND_BUFFER)
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_buffer,
vk.base,
VkBuffer,
VK_OBJECT_TYPE_BUFFER)
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_buffer_view,
vk.base,
VkBufferView,
VK_OBJECT_TYPE_BUFFER_VIEW)
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_descriptor_set_layout,
vk.base,
VkDescriptorSetLayout,

View file

@ -32,6 +32,7 @@
#include "hwdef/rogue_hw_utils.h"
#include "pco_uscgen_programs.h"
#include "pvr_bo.h"
#include "pvr_buffer.h"
#include "pvr_device.h"
#include "pvr_formats.h"
#include "pvr_pds.h"