aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/arm/t6xx/kbase/malisw/mali_stdtypes.h
blob: 6459a58043074867c9a395fbe3e0fd20c5942330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
/*
 *
 * (C) COPYRIGHT 2010-2012 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation, and any use by you of this program is subject to the terms
 * of such GNU licence.
 *
 * A copy of the licence is included with the program, and can also be obtained
 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 *
 */



#ifndef _MALISW_STDTYPES_H_
#define _MALISW_STDTYPES_H_

/**
 * @file mali_stdtypes.h
 * This file defines the standard types used by the Mali codebase.
 */

/**
 * @addtogroup malisw
 * @{
 */

/**
 * @defgroup malisw_stdtypes Mali software standard types
 *
 * Basic driver-wide types.
 */

/**
 * @addtogroup malisw_stdtypes
 * @{
 */

#include "arm_cstd/arm_cstd.h"

/**
 * @name Scalar types.
 * These are the scalar types used within the mali driver.
 * @{
 */
/* Note: if compiling the Linux kernel then avoid redefining these. */
#if 0 == CSTD_OS_LINUX_KERNEL
	typedef uint64_t u64;
	typedef uint32_t u32;
	typedef uint16_t u16;
	typedef uint8_t  u8;
	
	typedef int64_t  s64;
	typedef int32_t  s32;
	typedef int16_t  s16;
	typedef int8_t   s8;
#endif

typedef double   f64;
typedef float    f32;
typedef u16      f16;

typedef u32      mali_fixed16_16;
/* @} */

/**
 * @name Boolean types.
 * The intended use is for bool8 to be used when storing boolean values in
 * structures, casting to mali_bool to be used in code sections.
 * @{
 */
typedef bool_t     mali_bool;
typedef u8         mali_bool8;

#define MALI_FALSE FALSE
#define MALI_TRUE  TRUE
/* @} */

/**
 * @name Integer bounding values
 * Maximum and minimum values for integer types
 * @{
 */
#define U64_MAX	 UINT64_MAX
#define U32_MAX	 UINT32_MAX
#define U16_MAX	 UINT16_MAX
#define U8_MAX	 UINT8_MAX

#define S64_MAX  INT64_MAX
#define S64_MIN  INT64_MIN
#define S32_MAX  INT32_MAX
#define S32_MIN  INT32_MIN
#define S16_MAX  INT16_MAX
#define S16_MIN  INT16_MIN
#define S8_MAX   INT8_MAX
#define S8_MIN   INT8_MIN
/* @} */

/**
 * @name GPU address types
 * Types for integers which hold a GPU pointer or GPU pointer offsets.
 * @{
 */
typedef u64      mali_addr64;
typedef u32      mali_addr32;
typedef u64      mali_size64;
typedef s64      mali_offset64;
/* 32 bit offsets and sizes are always for native types and so use ptrdiff_t and size_t respectively */
/* @} */

/**
 * @name Mali error types
 * @brief The common error type for the mali drivers
 * The mali_error type, all driver error handling should be of this type unless
 * it must deal with a specific APIs error type.
 * @{
 */
typedef enum
{
	/**
	 * @brief Common Mali errors for the entire driver
	 * MALI_ERROR_NONE is guaranteed to be 0.
	 * @{
	 */
	MALI_ERROR_NONE = 0,
	MALI_ERROR_OUT_OF_GPU_MEMORY,
	MALI_ERROR_OUT_OF_MEMORY,
	MALI_ERROR_FUNCTION_FAILED,
	/* @} */
	/**
	 * @brief Mali errors for Client APIs to pass to EGL when creating EGLImages
	 * These errors must only be returned to EGL from one of the Client APIs as part of the
	 * (clientapi)_egl_image_interface.h
	 * @{
	 */
	MALI_ERROR_EGLP_BAD_ACCESS,
	MALI_ERROR_EGLP_BAD_PARAMETER,
	/* @} */
	/**
	 * @brief Mali errors for the MCL module.
	 * These errors must only be used within the private components of the OpenCL implementation that report
	 * directly to API functions for cases where errors cannot be detected in the entrypoints file. They must
	 * not be passed between driver components.
	 * These are errors in the mali error space specifically for the MCL module, hence the MCLP prefix.
	 * @{
	 */
	MALI_ERROR_MCLP_DEVICE_NOT_FOUND,
	MALI_ERROR_MCLP_DEVICE_NOT_AVAILABLE,
	MALI_ERROR_MCLP_COMPILER_NOT_AVAILABLE,
	MALI_ERROR_MCLP_MEM_OBJECT_ALLOCATION_FAILURE,
	MALI_ERROR_MCLP_PROFILING_INFO_NOT_AVAILABLE,
	MALI_ERROR_MCLP_MEM_COPY_OVERLAP,
	MALI_ERROR_MCLP_IMAGE_FORMAT_MISMATCH,
	MALI_ERROR_MCLP_IMAGE_FORMAT_NOT_SUPPORTED,
	MALI_ERROR_MCLP_BUILD_PROGRAM_FAILURE,
	MALI_ERROR_MCLP_MAP_FAILURE,
	MALI_ERROR_MCLP_MISALIGNED_SUB_BUFFER_OFFSET,
	MALI_ERROR_MCLP_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST,
	MALI_ERROR_MCLP_INVALID_VALUE,
	MALI_ERROR_MCLP_INVALID_DEVICE_TYPE,
	MALI_ERROR_MCLP_INVALID_PLATFORM,
	MALI_ERROR_MCLP_INVALID_DEVICE,
	MALI_ERROR_MCLP_INVALID_CONTEXT,
	MALI_ERROR_MCLP_INVALID_QUEUE_PROPERTIES,
	MALI_ERROR_MCLP_INVALID_COMMAND_QUEUE,
	MALI_ERROR_MCLP_INVALID_HOST_PTR,
	MALI_ERROR_MCLP_INVALID_MEM_OBJECT,
	MALI_ERROR_MCLP_INVALID_IMAGE_FORMAT_DESCRIPTOR,
	MALI_ERROR_MCLP_INVALID_IMAGE_SIZE,
	MALI_ERROR_MCLP_INVALID_SAMPLER,
	MALI_ERROR_MCLP_INVALID_BINARY,
	MALI_ERROR_MCLP_INVALID_BUILD_OPTIONS,
	MALI_ERROR_MCLP_INVALID_PROGRAM,
	MALI_ERROR_MCLP_INVALID_PROGRAM_EXECUTABLE,
	MALI_ERROR_MCLP_INVALID_KERNEL_NAME,
	MALI_ERROR_MCLP_INVALID_KERNEL_DEFINITION,
	MALI_ERROR_MCLP_INVALID_KERNEL,
	MALI_ERROR_MCLP_INVALID_ARG_INDEX,
	MALI_ERROR_MCLP_INVALID_ARG_VALUE,
	MALI_ERROR_MCLP_INVALID_ARG_SIZE,
	MALI_ERROR_MCLP_INVALID_KERNEL_ARGS,
	MALI_ERROR_MCLP_INVALID_WORK_DIMENSION,
	MALI_ERROR_MCLP_INVALID_WORK_GROUP_SIZE,
	MALI_ERROR_MCLP_INVALID_WORK_ITEM_SIZE,
	MALI_ERROR_MCLP_INVALID_GLOBAL_OFFSET,
	MALI_ERROR_MCLP_INVALID_EVENT_WAIT_LIST,
	MALI_ERROR_MCLP_INVALID_EVENT,
	MALI_ERROR_MCLP_INVALID_OPERATION,
	MALI_ERROR_MCLP_INVALID_GL_OBJECT,
	MALI_ERROR_MCLP_INVALID_BUFFER_SIZE,
	MALI_ERROR_MCLP_INVALID_MIP_LEVEL,
	MALI_ERROR_MCLP_INVALID_GLOBAL_WORK_SIZE,
	/* @} */
	/**
	 * @brief Mali errors for the BASE module
	 * These errors must only be used within the private components of the Base implementation. They will not
	 * passed to other modules by the base driver.
	 * These are errors in the mali error space specifically for the BASE module, hence the BASEP prefix.
	 * @{
	 */
	MALI_ERROR_BASEP_INVALID_FUNCTION
	/* @} */
} mali_error;
/* @} */

/* @} */

/* @} */

#endif /* _MALISW_STDTYPES_H_ */