linux/include/uapi/drm/panfrost_drm.h

/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2014-2018 Broadcom
 * Copyright © 2019 Collabora ltd.
 */
#ifndef _PANFROST_DRM_H_
#define _PANFROST_DRM_H_

#include "drm.h"

#if defined(__cplusplus)
extern "C" {
#endif

#define DRM_PANFROST_SUBMIT
#define DRM_PANFROST_WAIT_BO
#define DRM_PANFROST_CREATE_BO
#define DRM_PANFROST_MMAP_BO
#define DRM_PANFROST_GET_PARAM
#define DRM_PANFROST_GET_BO_OFFSET
#define DRM_PANFROST_PERFCNT_ENABLE
#define DRM_PANFROST_PERFCNT_DUMP
#define DRM_PANFROST_MADVISE

#define DRM_IOCTL_PANFROST_SUBMIT
#define DRM_IOCTL_PANFROST_WAIT_BO
#define DRM_IOCTL_PANFROST_CREATE_BO
#define DRM_IOCTL_PANFROST_MMAP_BO
#define DRM_IOCTL_PANFROST_GET_PARAM
#define DRM_IOCTL_PANFROST_GET_BO_OFFSET
#define DRM_IOCTL_PANFROST_MADVISE

/*
 * Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module
 * param is set to true.
 * All these ioctl(s) are subject to deprecation, so please don't rely on
 * them for anything but debugging purpose.
 */
#define DRM_IOCTL_PANFROST_PERFCNT_ENABLE
#define DRM_IOCTL_PANFROST_PERFCNT_DUMP

#define PANFROST_JD_REQ_FS
/**
 * struct drm_panfrost_submit - ioctl argument for submitting commands to the 3D
 * engine.
 *
 * This asks the kernel to have the GPU execute a render command list.
 */
struct drm_panfrost_submit {};

/**
 * struct drm_panfrost_wait_bo - ioctl argument for waiting for
 * completion of the last DRM_PANFROST_SUBMIT on a BO.
 *
 * This is useful for cases where multiple processes might be
 * rendering to a BO and you want to wait for all rendering to be
 * completed.
 */
struct drm_panfrost_wait_bo {};

/* Valid flags to pass to drm_panfrost_create_bo */
#define PANFROST_BO_NOEXEC
#define PANFROST_BO_HEAP

/**
 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.
 *
 * The flags argument is a bit mask of PANFROST_BO_* flags.
 */
struct drm_panfrost_create_bo {};

/**
 * struct drm_panfrost_mmap_bo - ioctl argument for mapping Panfrost BOs.
 *
 * This doesn't actually perform an mmap.  Instead, it returns the
 * offset you need to use in an mmap on the DRM device node.  This
 * means that tools like valgrind end up knowing about the mapped
 * memory.
 *
 * There are currently no values for the flags argument, but it may be
 * used in a future extension.
 */
struct drm_panfrost_mmap_bo {};

enum drm_panfrost_param {};

struct drm_panfrost_get_param {};

/**
 * Returns the offset for the BO in the GPU address space for this DRM fd.
 * This is the same value returned by drm_panfrost_create_bo, if that was called
 * from this DRM fd.
 */
struct drm_panfrost_get_bo_offset {};

struct drm_panfrost_perfcnt_enable {};

struct drm_panfrost_perfcnt_dump {};

/* madvise provides a way to tell the kernel in case a buffers contents
 * can be discarded under memory pressure, which is useful for userspace
 * bo cache where we want to optimistically hold on to buffer allocate
 * and potential mmap, but allow the pages to be discarded under memory
 * pressure.
 *
 * Typical usage would involve madvise(DONTNEED) when buffer enters BO
 * cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.
 * In the WILLNEED case, 'retained' indicates to userspace whether the
 * backing pages still exist.
 */
#define PANFROST_MADV_WILLNEED
#define PANFROST_MADV_DONTNEED

struct drm_panfrost_madvise {};

/* Definitions for coredump decoding in user space */
#define PANFROSTDUMP_MAJOR
#define PANFROSTDUMP_MINOR

#define PANFROSTDUMP_MAGIC

#define PANFROSTDUMP_BUF_REG
#define PANFROSTDUMP_BUF_BOMAP
#define PANFROSTDUMP_BUF_BO
#define PANFROSTDUMP_BUF_TRAILER

/*
 * This structure is the native endianness of the dumping machine, tools can
 * detect the endianness by looking at the value in 'magic'.
 */
struct panfrost_dump_object_header {};

/* Registers object, an array of these */
struct panfrost_dump_registers {};

#if defined(__cplusplus)
}
#endif

#endif /* _PANFROST_DRM_H_ */