panvk: Move the panvk_priv_bo logic to panvk_priv_bo.{c,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 12:41:35 +01:00 committed by Marge Bot
parent 23c3edf3de
commit 2a032600c6
14 changed files with 52 additions and 80 deletions

View file

@ -38,7 +38,6 @@ libpanvk_files = files(
'panvk_buffer.c',
'panvk_cmd_buffer.c',
'panvk_cmd_pool.c',
'panvk_device.c',
'panvk_device_memory.c',
'panvk_descriptor_set.c',
'panvk_event.c',
@ -48,6 +47,7 @@ libpanvk_files = files(
'panvk_physical_device.c',
'panvk_pipeline.c',
'panvk_private.h',
'panvk_priv_bo.c',
'panvk_query.c',
'panvk_shader.c',
'panvk_wsi.c',

View file

@ -27,6 +27,7 @@
#include "panvk_descriptor_set.h"
#include "panvk_device.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include <assert.h>

View file

@ -24,6 +24,7 @@
*/
#include "panvk_mempool.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
void

View file

@ -28,6 +28,7 @@
#include "panvk_pipeline.h"
#include "panvk_device.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include "nir/nir.h"

View file

@ -1,71 +1,18 @@
/*
* Copyright © 2021 Collabora Ltd.
*
* Derived from tu_device.c which is:
* Copyright © 2016 Red Hat.
* Copyright © 2016 Bas Nieuwenhuizen
* Copyright © 2015 Intel Corporation
*
* 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.
* SPDX-License-Identifier: MIT
*/
#include <assert.h>
#include "vk_alloc.h"
#include "panvk_device.h"
#include "panvk_device_memory.h"
#include "panvk_image.h"
#include "panvk_instance.h"
#include "panvk_physical_device.h"
#include "panvk_private.h"
#include "panvk_queue.h"
#include "panvk_priv_bo.h"
#include "decode.h"
#include "kmod/pan_kmod.h"
#include "pan_encoder.h"
#include "pan_props.h"
#include "pan_samples.h"
#include "pan_util.h"
#include "vk_cmd_enqueue_entrypoints.h"
#include "vk_common_entrypoints.h"
#include <fcntl.h>
#include <libsync.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
#include <xf86drm.h>
#include <sys/mman.h>
#include <sys/sysinfo.h>
#include "drm-uapi/panfrost_drm.h"
#include "util/disk_cache.h"
#include "util/strtod.h"
#include "util/u_debug.h"
#include "vk_drm_syncobj.h"
#include "vk_format.h"
#include "vk_util.h"
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#include "wayland-drm-client-protocol.h"
#include <wayland-client.h>
#endif
#include "genxml/decode.h"
struct panvk_priv_bo *
panvk_priv_bo_create(struct panvk_device *dev, size_t size, uint32_t flags,

View file

@ -0,0 +1,33 @@
/*
* Copyright © 2021 Collabora Ltd.
* SPDX-License-Identifier: MIT
*/
#ifndef PANVK_PRIV_BO_H
#define PANVK_PRIV_BO_H
#include <vulkan/vulkan_core.h>
#include "panfrost-job.h"
struct panvk_kmod_bo;
/* Used for internal object allocation. */
struct panvk_priv_bo {
struct panvk_device *dev;
struct pan_kmod_bo *bo;
struct {
mali_ptr dev;
void *host;
} addr;
};
struct panvk_priv_bo *panvk_priv_bo_create(struct panvk_device *dev,
size_t size, uint32_t flags,
const VkAllocationCallbacks *alloc,
VkSystemAllocationScope scope);
void panvk_priv_bo_destroy(struct panvk_priv_bo *bo,
const VkAllocationCallbacks *alloc);
#endif

View file

@ -109,24 +109,6 @@ struct panvk_device;
struct panvk_pipeline_layout;
struct panvk_queue;
/* Used for internal object allocation. */
struct panvk_priv_bo {
struct panvk_device *dev;
struct pan_kmod_bo *bo;
struct {
mali_ptr dev;
void *host;
} addr;
};
struct panvk_priv_bo *panvk_priv_bo_create(struct panvk_device *dev,
size_t size, uint32_t flags,
const VkAllocationCallbacks *alloc,
VkSystemAllocationScope scope);
void panvk_priv_bo_destroy(struct panvk_priv_bo *bo,
const VkAllocationCallbacks *alloc);
VkResult panvk_wsi_init(struct panvk_physical_device *physical_device);
void panvk_wsi_finish(struct panvk_physical_device *physical_device);

View file

@ -14,6 +14,7 @@
#include "panvk_buffer.h"
#include "panvk_buffer_view.h"
#include "panvk_device.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include "vk_format.h"

View file

@ -39,6 +39,7 @@
#include "panvk_physical_device.h"
#include "panvk_pipeline.h"
#include "panvk_pipeline_layout.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include "pan_blitter.h"

View file

@ -31,6 +31,7 @@
#include "panvk_device.h"
#include "panvk_image.h"
#include "panvk_image_view.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include <assert.h>

View file

@ -17,6 +17,7 @@
#include "panvk_instance.h"
#include "panvk_macros.h"
#include "panvk_physical_device.h"
#include "panvk_priv_bo.h"
#include "panvk_queue.h"
#include "genxml/decode.h"

View file

@ -14,6 +14,7 @@
#include "panvk_device.h"
#include "panvk_image.h"
#include "panvk_image_view.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include "genxml/gen_macros.h"

View file

@ -30,6 +30,7 @@
#include "panvk_device.h"
#include "panvk_pipeline.h"
#include "panvk_pipeline_layout.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include "panvk_shader.h"

View file

@ -20,6 +20,7 @@
#include "panvk_image_view.h"
#include "panvk_instance.h"
#include "panvk_physical_device.h"
#include "panvk_priv_bo.h"
#include "panvk_private.h"
#include "panvk_queue.h"