Files
cubelinux-kernel/drivers/accel/ethosu/ethosu_gem.h
T
Greg Kroah-Hartman 598cf27219 Linux 6.19.3
Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Brett A C Sheffield <bacs@librecast.net>
Tested-by: Mark Brown <broonie@kernel.org>
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: Ronald Warsow <rwarsow@gmx.de>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-19 16:33:27 +01:00

47 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0 or MIT */
/* Copyright 2025 Arm, Ltd. */
#ifndef __ETHOSU_GEM_H__
#define __ETHOSU_GEM_H__
#include "ethosu_device.h"
#include <drm/drm_gem_dma_helper.h>
struct ethosu_validated_cmdstream_info {
u32 cmd_size;
u64 region_size[NPU_BASEP_REGION_MAX];
bool output_region[NPU_BASEP_REGION_MAX];
};
/**
* struct ethosu_gem_object - Driver specific GEM object.
*/
struct ethosu_gem_object {
/** @base: Inherit from drm_gem_shmem_object. */
struct drm_gem_dma_object base;
struct ethosu_validated_cmdstream_info *info;
/** @flags: Combination of drm_ethosu_bo_flags flags. */
u32 flags;
};
static inline
struct ethosu_gem_object *to_ethosu_bo(struct drm_gem_object *obj)
{
return container_of(to_drm_gem_dma_obj(obj), struct ethosu_gem_object, base);
}
struct drm_gem_object *ethosu_gem_create_object(struct drm_device *ddev,
size_t size);
int ethosu_gem_create_with_handle(struct drm_file *file,
struct drm_device *ddev,
u64 *size, u32 flags, uint32_t *handle);
int ethosu_gem_cmdstream_create(struct drm_file *file,
struct drm_device *ddev,
u32 size, u64 data, u32 flags, u32 *handle);
#endif /* __ETHOSU_GEM_H__ */