linux/include/uapi/drm/ivpu_accel.h

/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
/*
 * Copyright (C) 2020-2024 Intel Corporation
 */

#ifndef __UAPI_IVPU_DRM_H__
#define __UAPI_IVPU_DRM_H__

#include "drm.h"

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

#define DRM_IVPU_DRIVER_MAJOR
#define DRM_IVPU_DRIVER_MINOR

#define DRM_IVPU_GET_PARAM
#define DRM_IVPU_SET_PARAM
#define DRM_IVPU_BO_CREATE
#define DRM_IVPU_BO_INFO
#define DRM_IVPU_SUBMIT
#define DRM_IVPU_BO_WAIT
#define DRM_IVPU_METRIC_STREAMER_START
#define DRM_IVPU_METRIC_STREAMER_STOP
#define DRM_IVPU_METRIC_STREAMER_GET_DATA
#define DRM_IVPU_METRIC_STREAMER_GET_INFO

#define DRM_IOCTL_IVPU_GET_PARAM

#define DRM_IOCTL_IVPU_SET_PARAM

#define DRM_IOCTL_IVPU_BO_CREATE

#define DRM_IOCTL_IVPU_BO_INFO

#define DRM_IOCTL_IVPU_SUBMIT

#define DRM_IOCTL_IVPU_BO_WAIT

#define DRM_IOCTL_IVPU_METRIC_STREAMER_START

#define DRM_IOCTL_IVPU_METRIC_STREAMER_STOP

#define DRM_IOCTL_IVPU_METRIC_STREAMER_GET_DATA

#define DRM_IOCTL_IVPU_METRIC_STREAMER_GET_INFO

/**
 * DOC: contexts
 *
 * VPU contexts have private virtual address space, job queues and priority.
 * Each context is identified by an unique ID. Context is created on open().
 */

#define DRM_IVPU_PARAM_DEVICE_ID
#define DRM_IVPU_PARAM_DEVICE_REVISION
#define DRM_IVPU_PARAM_PLATFORM_TYPE
#define DRM_IVPU_PARAM_CORE_CLOCK_RATE
#define DRM_IVPU_PARAM_NUM_CONTEXTS
#define DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS
#define DRM_IVPU_PARAM_CONTEXT_PRIORITY
#define DRM_IVPU_PARAM_CONTEXT_ID
#define DRM_IVPU_PARAM_FW_API_VERSION
#define DRM_IVPU_PARAM_ENGINE_HEARTBEAT
#define DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID
#define DRM_IVPU_PARAM_TILE_CONFIG
#define DRM_IVPU_PARAM_SKU
#define DRM_IVPU_PARAM_CAPABILITIES

#define DRM_IVPU_PLATFORM_TYPE_SILICON

/* Deprecated, use DRM_IVPU_JOB_PRIORITY */
#define DRM_IVPU_CONTEXT_PRIORITY_IDLE
#define DRM_IVPU_CONTEXT_PRIORITY_NORMAL
#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS
#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME

#define DRM_IVPU_JOB_PRIORITY_DEFAULT
#define DRM_IVPU_JOB_PRIORITY_IDLE
#define DRM_IVPU_JOB_PRIORITY_NORMAL
#define DRM_IVPU_JOB_PRIORITY_FOCUS
#define DRM_IVPU_JOB_PRIORITY_REALTIME

/**
 * DRM_IVPU_CAP_METRIC_STREAMER
 *
 * Metric streamer support. Provides sampling of various hardware performance
 * metrics like DMA bandwidth and cache miss/hits. Can be used for profiling.
 */
#define DRM_IVPU_CAP_METRIC_STREAMER
/**
 * DRM_IVPU_CAP_DMA_MEMORY_RANGE
 *
 * Driver has capability to allocate separate memory range
 * accessible by hardware DMA.
 */
#define DRM_IVPU_CAP_DMA_MEMORY_RANGE

/**
 * struct drm_ivpu_param - Get/Set VPU parameters
 */
struct drm_ivpu_param {};

#define DRM_IVPU_BO_SHAVE_MEM
#define DRM_IVPU_BO_HIGH_MEM
#define DRM_IVPU_BO_MAPPABLE
#define DRM_IVPU_BO_DMA_MEM

#define DRM_IVPU_BO_CACHED
#define DRM_IVPU_BO_UNCACHED
#define DRM_IVPU_BO_WC
#define DRM_IVPU_BO_CACHE_MASK

#define DRM_IVPU_BO_FLAGS

/**
 * struct drm_ivpu_bo_create - Create BO backed by SHMEM
 *
 * Create GEM buffer object allocated in SHMEM memory.
 */
struct drm_ivpu_bo_create {};

/**
 * struct drm_ivpu_bo_info - Query buffer object info
 */
struct drm_ivpu_bo_info {};

/* drm_ivpu_submit engines */
#define DRM_IVPU_ENGINE_COMPUTE
#define DRM_IVPU_ENGINE_COPY

/**
 * struct drm_ivpu_submit - Submit commands to the VPU
 *
 * Execute a single command buffer on a given VPU engine.
 * Handles to all referenced buffer objects have to be provided in @buffers_ptr.
 *
 * User space may wait on job completion using %DRM_IVPU_BO_WAIT ioctl.
 */
struct drm_ivpu_submit {};

/* drm_ivpu_bo_wait job status codes */
#define DRM_IVPU_JOB_STATUS_SUCCESS
#define DRM_IVPU_JOB_STATUS_ABORTED

/**
 * struct drm_ivpu_bo_wait - Wait for BO to become inactive
 *
 * Blocks until a given buffer object becomes inactive.
 * With @timeout_ms set to 0 returns immediately.
 */
struct drm_ivpu_bo_wait {};

/**
 * struct drm_ivpu_metric_streamer_start - Start collecting metric data
 */
struct drm_ivpu_metric_streamer_start {};

/**
 * struct drm_ivpu_metric_streamer_get_data - Copy collected metric data
 */
struct drm_ivpu_metric_streamer_get_data {};

/**
 * struct drm_ivpu_metric_streamer_stop - Stop collecting metric data
 */
struct drm_ivpu_metric_streamer_stop {};

#if defined(__cplusplus)
}
#endif

#endif /* __UAPI_IVPU_DRM_H__ */