Blame freedreno/kgsl/kgsl_drm.h

Packit Service 103f6b
#ifndef _KGSL_DRM_H_
Packit Service 103f6b
#define _KGSL_DRM_H_
Packit Service 103f6b
Packit Service 103f6b
#include "drm.h"
Packit Service 103f6b
Packit Service 103f6b
#define DRM_KGSL_GEM_CREATE 0x00
Packit Service 103f6b
#define DRM_KGSL_GEM_PREP   0x01
Packit Service 103f6b
#define DRM_KGSL_GEM_SETMEMTYPE 0x02
Packit Service 103f6b
#define DRM_KGSL_GEM_GETMEMTYPE 0x03
Packit Service 103f6b
#define DRM_KGSL_GEM_MMAP 0x04
Packit Service 103f6b
#define DRM_KGSL_GEM_ALLOC 0x05
Packit Service 103f6b
#define DRM_KGSL_GEM_BIND_GPU 0x06
Packit Service 103f6b
#define DRM_KGSL_GEM_UNBIND_GPU 0x07
Packit Service 103f6b
Packit Service 103f6b
#define DRM_KGSL_GEM_GET_BUFINFO 0x08
Packit Service 103f6b
#define DRM_KGSL_GEM_SET_BUFCOUNT 0x09
Packit Service 103f6b
#define DRM_KGSL_GEM_SET_ACTIVE 0x0A
Packit Service 103f6b
#define DRM_KGSL_GEM_LOCK_HANDLE 0x0B
Packit Service 103f6b
#define DRM_KGSL_GEM_UNLOCK_HANDLE 0x0C
Packit Service 103f6b
#define DRM_KGSL_GEM_UNLOCK_ON_TS 0x0D
Packit Service 103f6b
#define DRM_KGSL_GEM_CREATE_FD 0x0E
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_CREATE \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_CREATE, struct drm_kgsl_gem_create)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_PREP \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_PREP, struct drm_kgsl_gem_prep)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_SETMEMTYPE \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_SETMEMTYPE, \
Packit Service 103f6b
struct drm_kgsl_gem_memtype)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_GETMEMTYPE \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_GETMEMTYPE, \
Packit Service 103f6b
struct drm_kgsl_gem_memtype)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_MMAP \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_MMAP, struct drm_kgsl_gem_mmap)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_ALLOC \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_ALLOC, struct drm_kgsl_gem_alloc)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_BIND_GPU \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_BIND_GPU, struct drm_kgsl_gem_bind_gpu)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_UNBIND_GPU \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_UNBIND_GPU, \
Packit Service 103f6b
struct drm_kgsl_gem_bind_gpu)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_GET_BUFINFO \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_GET_BUFINFO, \
Packit Service 103f6b
	 struct drm_kgsl_gem_bufinfo)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_SET_BUFCOUNT \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_SET_BUFCOUNT, \
Packit Service 103f6b
	 struct drm_kgsl_gem_bufcount)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_SET_ACTIVE \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_SET_ACTIVE, \
Packit Service 103f6b
	 struct drm_kgsl_gem_active)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_LOCK_HANDLE \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_LOCK_HANDLE, \
Packit Service 103f6b
struct drm_kgsl_gem_lock_handles)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_UNLOCK_HANDLE \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_UNLOCK_HANDLE, \
Packit Service 103f6b
struct drm_kgsl_gem_unlock_handles)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_UNLOCK_ON_TS \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_UNLOCK_ON_TS, \
Packit Service 103f6b
struct drm_kgsl_gem_unlock_on_ts)
Packit Service 103f6b
Packit Service 103f6b
#define DRM_IOCTL_KGSL_GEM_CREATE_FD \
Packit Service 103f6b
DRM_IOWR(DRM_COMMAND_BASE + DRM_KGSL_GEM_CREATE_FD, \
Packit Service 103f6b
struct drm_kgsl_gem_create_fd)
Packit Service 103f6b
Packit Service 103f6b
/* Maximum number of sub buffers per GEM object */
Packit Service 103f6b
#define DRM_KGSL_GEM_MAX_BUFFERS 2
Packit Service 103f6b
Packit Service 103f6b
/* Memory types - these define the source and caching policies
Packit Service 103f6b
   of the GEM memory chunk */
Packit Service 103f6b
Packit Service 103f6b
/* Legacy definitions left for compatibility */
Packit Service 103f6b
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_EBI          0
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_SMI          1
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_KMEM         2
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_KMEM_NOCACHE 3
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_MEM_MASK     0xF
Packit Service 103f6b
Packit Service 103f6b
/* Contiguous memory (PMEM) */
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_PMEM       0x000100
Packit Service 103f6b
Packit Service 103f6b
/* PMEM memory types */
Packit Service 103f6b
#define DRM_KGSL_GEM_PMEM_EBI        0x001000
Packit Service 103f6b
#define DRM_KGSL_GEM_PMEM_SMI        0x002000
Packit Service 103f6b
Packit Service 103f6b
/* Standard paged memory */
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_MEM        0x010000
Packit Service 103f6b
Packit Service 103f6b
/* Caching controls */
Packit Service 103f6b
#define DRM_KGSL_GEM_CACHE_NONE      0x000000
Packit Service 103f6b
#define DRM_KGSL_GEM_CACHE_WCOMBINE  0x100000
Packit Service 103f6b
#define DRM_KGSL_GEM_CACHE_WTHROUGH  0x200000
Packit Service 103f6b
#define DRM_KGSL_GEM_CACHE_WBACK     0x400000
Packit Service 103f6b
#define DRM_KGSL_GEM_CACHE_WBACKWA   0x800000
Packit Service 103f6b
#define DRM_KGSL_GEM_CACHE_MASK      0xF00000
Packit Service 103f6b
Packit Service 103f6b
/* FD based objects */
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_FD_FBMEM   0x1000000
Packit Service 103f6b
#define DRM_KGSL_GEM_TYPE_FD_MASK    0xF000000
Packit Service 103f6b
Packit Service 103f6b
/* Timestamp types */
Packit Service 103f6b
#define DRM_KGSL_GEM_TS_3D         0x00000430
Packit Service 103f6b
#define DRM_KGSL_GEM_TS_2D         0x00000180
Packit Service 103f6b
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_create {
Packit Service 103f6b
	uint32_t size;
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_prep {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t phys;
Packit Service 103f6b
	uint64_t offset;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_memtype {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t type;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_mmap {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t size;
Packit Service 103f6b
	uint32_t hostptr;
Packit Service 103f6b
	uint64_t offset;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_alloc {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint64_t offset;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_bind_gpu {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t gpuptr;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_bufinfo {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t count;
Packit Service 103f6b
	uint32_t active;
Packit Service 103f6b
	uint32_t offset[DRM_KGSL_GEM_MAX_BUFFERS];
Packit Service 103f6b
	uint32_t gpuaddr[DRM_KGSL_GEM_MAX_BUFFERS];
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_bufcount {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t bufcount;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_active {
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
	uint32_t active;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_lock_handles {
Packit Service 103f6b
	uint32_t num_handles;
Packit Service 103f6b
	uint32_t *handle_list;
Packit Service 103f6b
	uint32_t pid;
Packit Service 103f6b
	uint32_t lock_id;	  /* Returned lock id used for unlocking */
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_unlock_handles {
Packit Service 103f6b
	uint32_t lock_id;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_unlock_on_ts {
Packit Service 103f6b
	uint32_t lock_id;
Packit Service 103f6b
	uint32_t timestamp;	 /* This field is a hw generated ts */
Packit Service 103f6b
	uint32_t type;		 /* Which pipe to check for ts generation */
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
struct drm_kgsl_gem_create_fd {
Packit Service 103f6b
	uint32_t fd;
Packit Service 103f6b
	uint32_t handle;
Packit Service 103f6b
};
Packit Service 103f6b
Packit Service 103f6b
#endif