Commit 675da0dd authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: cleanup UAPI comments

No functional change.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 692a59e6
...@@ -141,12 +141,17 @@ union drm_amdgpu_bo_list { ...@@ -141,12 +141,17 @@ union drm_amdgpu_bo_list {
/* GPU reset status */ /* GPU reset status */
#define AMDGPU_CTX_NO_RESET 0 #define AMDGPU_CTX_NO_RESET 0
#define AMDGPU_CTX_GUILTY_RESET 1 /* this the context caused it */ /* this the context caused it */
#define AMDGPU_CTX_INNOCENT_RESET 2 /* some other context caused it */ #define AMDGPU_CTX_GUILTY_RESET 1
#define AMDGPU_CTX_UNKNOWN_RESET 3 /* unknown cause */ /* some other context caused it */
#define AMDGPU_CTX_INNOCENT_RESET 2
/* unknown cause */
#define AMDGPU_CTX_UNKNOWN_RESET 3
struct drm_amdgpu_ctx_in { struct drm_amdgpu_ctx_in {
/** AMDGPU_CTX_OP_* */
uint32_t op; uint32_t op;
/** For future use, no flags defined so far */
uint32_t flags; uint32_t flags;
uint32_t ctx_id; uint32_t ctx_id;
uint32_t _pad; uint32_t _pad;
...@@ -159,6 +164,7 @@ union drm_amdgpu_ctx_out { ...@@ -159,6 +164,7 @@ union drm_amdgpu_ctx_out {
} alloc; } alloc;
struct { struct {
/** For future use, no flags defined so far */
uint64_t flags; uint64_t flags;
/** Number of resets caused by this context so far. */ /** Number of resets caused by this context so far. */
uint32_t hangs; uint32_t hangs;
...@@ -185,7 +191,9 @@ union drm_amdgpu_ctx { ...@@ -185,7 +191,9 @@ union drm_amdgpu_ctx {
struct drm_amdgpu_gem_userptr { struct drm_amdgpu_gem_userptr {
uint64_t addr; uint64_t addr;
uint64_t size; uint64_t size;
/* AMDGPU_GEM_USERPTR_* */
uint32_t flags; uint32_t flags;
/* Resulting GEM handle */
uint32_t handle; uint32_t handle;
}; };
...@@ -217,23 +225,29 @@ struct drm_amdgpu_gem_userptr { ...@@ -217,23 +225,29 @@ struct drm_amdgpu_gem_userptr {
/** The same structure is shared for input/output */ /** The same structure is shared for input/output */
struct drm_amdgpu_gem_metadata { struct drm_amdgpu_gem_metadata {
uint32_t handle; /* GEM Object handle */ /** GEM Object handle */
uint32_t op; /** Do we want get or set metadata */ uint32_t handle;
/** Do we want get or set metadata */
uint32_t op;
struct { struct {
/** For future use, no flags defined so far */
uint64_t flags; uint64_t flags;
uint64_t tiling_info; /* family specific tiling info */ /** family specific tiling info */
uint64_t tiling_info;
uint32_t data_size_bytes; uint32_t data_size_bytes;
uint32_t data[64]; uint32_t data[64];
} data; } data;
}; };
struct drm_amdgpu_gem_mmap_in { struct drm_amdgpu_gem_mmap_in {
uint32_t handle; /** the GEM object handle */ /** the GEM object handle */
uint32_t handle;
uint32_t _pad; uint32_t _pad;
}; };
struct drm_amdgpu_gem_mmap_out { struct drm_amdgpu_gem_mmap_out {
uint64_t addr_ptr; /** mmap offset from the vma offset manager */ /** mmap offset from the vma offset manager */
uint64_t addr_ptr;
}; };
union drm_amdgpu_gem_mmap { union drm_amdgpu_gem_mmap {
...@@ -242,14 +256,19 @@ union drm_amdgpu_gem_mmap { ...@@ -242,14 +256,19 @@ union drm_amdgpu_gem_mmap {
}; };
struct drm_amdgpu_gem_wait_idle_in { struct drm_amdgpu_gem_wait_idle_in {
uint32_t handle; /* GEM object handle */ /** GEM object handle */
uint32_t handle;
/** For future use, no flags defined so far */
uint32_t flags; uint32_t flags;
uint64_t timeout; /* Timeout to wait. If 0 then returned immediately with the status */ /** Absolute timeout to wait */
uint64_t timeout;
}; };
struct drm_amdgpu_gem_wait_idle_out { struct drm_amdgpu_gem_wait_idle_out {
uint32_t status; /* BO status: 0 - BO is idle, 1 - BO is busy */ /** BO status: 0 - BO is idle, 1 - BO is busy */
uint32_t domain; /* Returned current memory domain */ uint32_t status;
/** Returned current memory domain */
uint32_t domain;
}; };
union drm_amdgpu_gem_wait_idle { union drm_amdgpu_gem_wait_idle {
...@@ -258,7 +277,9 @@ union drm_amdgpu_gem_wait_idle { ...@@ -258,7 +277,9 @@ union drm_amdgpu_gem_wait_idle {
}; };
struct drm_amdgpu_wait_cs_in { struct drm_amdgpu_wait_cs_in {
/** Command submission handle */
uint64_t handle; uint64_t handle;
/** Absolute timeout to wait */
uint64_t timeout; uint64_t timeout;
uint32_t ip_type; uint32_t ip_type;
uint32_t ip_instance; uint32_t ip_instance;
...@@ -267,6 +288,7 @@ struct drm_amdgpu_wait_cs_in { ...@@ -267,6 +288,7 @@ struct drm_amdgpu_wait_cs_in {
}; };
struct drm_amdgpu_wait_cs_out { struct drm_amdgpu_wait_cs_out {
/** CS status: 0 - CS completed, 1 - CS still busy */
uint64_t status; uint64_t status;
}; };
...@@ -275,16 +297,19 @@ union drm_amdgpu_wait_cs { ...@@ -275,16 +297,19 @@ union drm_amdgpu_wait_cs {
struct drm_amdgpu_wait_cs_out out; struct drm_amdgpu_wait_cs_out out;
}; };
#define AMDGPU_GEM_OP_GET_GEM_CREATE_INFO 0
#define AMDGPU_GEM_OP_SET_PLACEMENT 1
/* Sets or returns a value associated with a buffer. */ /* Sets or returns a value associated with a buffer. */
struct drm_amdgpu_gem_op { struct drm_amdgpu_gem_op {
uint32_t handle; /* buffer */ /** GEM object handle */
uint32_t op; /* AMDGPU_GEM_OP_* */ uint32_t handle;
uint64_t value; /* input or return value */ /** AMDGPU_GEM_OP_* */
uint32_t op;
/** Input or return value */
uint64_t value;
}; };
#define AMDGPU_GEM_OP_GET_GEM_CREATE_INFO 0
#define AMDGPU_GEM_OP_SET_PLACEMENT 1
#define AMDGPU_VA_OP_MAP 1 #define AMDGPU_VA_OP_MAP 1
#define AMDGPU_VA_OP_UNMAP 2 #define AMDGPU_VA_OP_UNMAP 2
...@@ -297,19 +322,18 @@ struct drm_amdgpu_gem_op { ...@@ -297,19 +322,18 @@ struct drm_amdgpu_gem_op {
#define AMDGPU_VM_PAGE_EXECUTABLE (1 << 3) #define AMDGPU_VM_PAGE_EXECUTABLE (1 << 3)
struct drm_amdgpu_gem_va { struct drm_amdgpu_gem_va {
/* GEM object handle */ /** GEM object handle */
uint32_t handle; uint32_t handle;
uint32_t _pad; uint32_t _pad;
/* map or unmap*/ /** AMDGPU_VA_OP_* */
uint32_t operation; uint32_t operation;
/* specify mapping flags */ /** AMDGPU_VM_PAGE_* */
uint32_t flags; uint32_t flags;
/* va address to assign . Must be correctly aligned.*/ /** va address to assign . Must be correctly aligned.*/
uint64_t va_address; uint64_t va_address;
/* Specify offset inside of BO to assign. Must be correctly aligned.*/ /** Specify offset inside of BO to assign. Must be correctly aligned.*/
uint64_t offset_in_bo; uint64_t offset_in_bo;
/* Specify mapping size. If 0 and offset is 0 then map the whole BO.*/ /** Specify mapping size. Must be correctly aligned. */
/* Must be correctly aligned. */
uint64_t map_size; uint64_t map_size;
}; };
...@@ -324,6 +348,7 @@ struct drm_amdgpu_gem_va { ...@@ -324,6 +348,7 @@ struct drm_amdgpu_gem_va {
#define AMDGPU_CHUNK_ID_IB 0x01 #define AMDGPU_CHUNK_ID_IB 0x01
#define AMDGPU_CHUNK_ID_FENCE 0x02 #define AMDGPU_CHUNK_ID_FENCE 0x02
struct drm_amdgpu_cs_chunk { struct drm_amdgpu_cs_chunk {
uint32_t chunk_id; uint32_t chunk_id;
uint32_t length_dw; uint32_t length_dw;
...@@ -337,7 +362,7 @@ struct drm_amdgpu_cs_in { ...@@ -337,7 +362,7 @@ struct drm_amdgpu_cs_in {
uint32_t bo_list_handle; uint32_t bo_list_handle;
uint32_t num_chunks; uint32_t num_chunks;
uint32_t _pad; uint32_t _pad;
/* this points to uint64_t * which point to cs chunks */ /** this points to uint64_t * which point to cs chunks */
uint64_t chunks; uint64_t chunks;
}; };
...@@ -346,8 +371,8 @@ struct drm_amdgpu_cs_out { ...@@ -346,8 +371,8 @@ struct drm_amdgpu_cs_out {
}; };
union drm_amdgpu_cs { union drm_amdgpu_cs {
struct drm_amdgpu_cs_in in; struct drm_amdgpu_cs_in in;
struct drm_amdgpu_cs_out out; struct drm_amdgpu_cs_out out;
}; };
/* Specify flags to be used for IB */ /* Specify flags to be used for IB */
...@@ -360,12 +385,18 @@ union drm_amdgpu_cs { ...@@ -360,12 +385,18 @@ union drm_amdgpu_cs {
struct drm_amdgpu_cs_chunk_ib { struct drm_amdgpu_cs_chunk_ib {
uint32_t _pad; uint32_t _pad;
uint32_t flags; /* IB Flags */ /** AMDGPU_IB_FLAG_* */
uint64_t va_start; /* Virtual address to begin IB execution */ uint32_t flags;
uint32_t ib_bytes; /* Size of submission */ /** Virtual address to begin IB execution */
uint32_t ip_type; /* HW IP to submit to */ uint64_t va_start;
uint32_t ip_instance; /* HW IP index of the same type to submit to */ /** Size of submission */
uint32_t ring; /* Ring index to submit to */ uint32_t ib_bytes;
/** HW IP to submit to */
uint32_t ip_type;
/** HW IP index of the same type to submit to */
uint32_t ip_instance;
/** Ring index to submit to */
uint32_t ring;
}; };
struct drm_amdgpu_cs_chunk_fence { struct drm_amdgpu_cs_chunk_fence {
...@@ -460,23 +491,28 @@ struct drm_amdgpu_info { ...@@ -460,23 +491,28 @@ struct drm_amdgpu_info {
/** AMDGPU_HW_IP_* */ /** AMDGPU_HW_IP_* */
uint32_t type; uint32_t type;
/** /**
* Index of the IP if there are more IPs of the same type. * Index of the IP if there are more IPs of the same
* Ignored by AMDGPU_INFO_HW_IP_COUNT. * type. Ignored by AMDGPU_INFO_HW_IP_COUNT.
*/ */
uint32_t ip_instance; uint32_t ip_instance;
} query_hw_ip; } query_hw_ip;
struct { struct {
uint32_t dword_offset; uint32_t dword_offset;
uint32_t count; /* number of registers to read */ /** number of registers to read */
uint32_t count;
uint32_t instance; uint32_t instance;
/** For future use, no flags defined so far */
uint32_t flags; uint32_t flags;
} read_mmr_reg; } read_mmr_reg;
struct { struct {
/** AMDGPU_INFO_FW_* */ /** AMDGPU_INFO_FW_* */
uint32_t fw_type; uint32_t fw_type;
/** Index of the IP if there are more IPs of the same type. */ /**
* Index of the IP if there are more IPs of
* the same type.
*/
uint32_t ip_instance; uint32_t ip_instance;
/** /**
* Index of the engine. Whether this is used depends * Index of the engine. Whether this is used depends
...@@ -537,9 +573,10 @@ struct drm_amdgpu_info_device { ...@@ -537,9 +573,10 @@ struct drm_amdgpu_info_device {
uint32_t family; uint32_t family;
uint32_t num_shader_engines; uint32_t num_shader_engines;
uint32_t num_shader_arrays_per_engine; uint32_t num_shader_arrays_per_engine;
uint32_t gpu_counter_freq; /* in KHz */ /* in KHz */
uint64_t max_engine_clock; /* in KHz */ uint32_t gpu_counter_freq;
uint64_t max_memory_clock; /* in KHz */ uint64_t max_engine_clock;
uint64_t max_memory_clock;
/* cu information */ /* cu information */
uint32_t cu_active_number; uint32_t cu_active_number;
uint32_t cu_ao_mask; uint32_t cu_ao_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment