mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 23:20:08 +01:00
pan/kmod: Add a backend for panthor
Panthor is a new kernel driver handling CSF-based GPUs. It's designed around the new VM model where: - VM management is all explicit (you get to choose where objects are mapped in the GPU VA space) - synchronization is explicit too (there's not BO_WAIT, and we don't pass BOs around to serve as implicit deps) We add a few panthor specific helpers (those exposed in panthor_kmod.h) too: - panthor_kmod_xxx_sync_point() are needed to make pan_kmod_bo_wait() work with the new synchronization/VM model - panthor_kmod_get_flush_id() is exposing the LATEST_FLUSH_ID register - panthor_kmod_vm_handle() is providing a way to query the VM handle attached to the pan_kmod_vm object (needed for a few panthor ioctls) Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
This commit is contained in:
parent
fe76c22aeb
commit
97f6a62f7e
5 changed files with 1144 additions and 0 deletions
|
|
@ -21,6 +21,7 @@
|
|||
libpankmod_lib_files = files(
|
||||
'pan_kmod.c',
|
||||
'panfrost_kmod.c',
|
||||
'panthor_kmod.c',
|
||||
)
|
||||
|
||||
libpankmod_lib = static_library(
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "pan_kmod.h"
|
||||
|
||||
extern const struct pan_kmod_ops panfrost_kmod_ops;
|
||||
extern const struct pan_kmod_ops panthor_kmod_ops;
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
|
|
@ -20,6 +21,10 @@ static const struct {
|
|||
"panfrost",
|
||||
&panfrost_kmod_ops,
|
||||
},
|
||||
{
|
||||
"panthor",
|
||||
&panthor_kmod_ops,
|
||||
},
|
||||
};
|
||||
|
||||
static void *
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#include "util/sparse_array.h"
|
||||
#include "util/u_atomic.h"
|
||||
|
||||
#include "kmod/panthor_kmod.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
|||
1098
src/panfrost/lib/kmod/panthor_kmod.c
Normal file
1098
src/panfrost/lib/kmod/panthor_kmod.c
Normal file
File diff suppressed because it is too large
Load diff
38
src/panfrost/lib/kmod/panthor_kmod.h
Normal file
38
src/panfrost/lib/kmod/panthor_kmod.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright © 2023 Collabora, Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct drm_panthor_csif_info;
|
||||
|
||||
struct pan_kmod_bo;
|
||||
struct pan_kmod_dev;
|
||||
struct pan_kmod_vm;
|
||||
|
||||
int panthor_kmod_bo_attach_sync_point(struct pan_kmod_bo *bo,
|
||||
uint32_t sync_handle,
|
||||
uint64_t sync_point, bool written);
|
||||
int panthor_kmod_bo_get_sync_point(struct pan_kmod_bo *bo,
|
||||
uint32_t *sync_handle, uint64_t *sync_point,
|
||||
bool read_only);
|
||||
uint32_t panthor_kmod_vm_sync_handle(struct pan_kmod_vm *vm);
|
||||
uint64_t panthor_kmod_vm_sync_lock(struct pan_kmod_vm *vm);
|
||||
void panthor_kmod_vm_sync_unlock(struct pan_kmod_vm *vm,
|
||||
uint64_t new_sync_point);
|
||||
uint32_t panthor_kmod_get_flush_id(const struct pan_kmod_dev *dev);
|
||||
|
||||
const struct drm_panthor_csif_info *
|
||||
panthor_kmod_get_csif_props(const struct pan_kmod_dev *dev);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue