31#ifndef __ARM_2D_TYPES_H__
32#define __ARM_2D_TYPES_H__
41#include "arm_2d_features.h"
42#include "arm_2d_utils.h"
43#include "__arm_2d_math.h"
50# pragma clang diagnostic push
51# pragma clang diagnostic ignored "-Wunknown-warning-option"
52# pragma clang diagnostic ignored "-Wreserved-identifier"
53# pragma clang diagnostic ignored "-Wmissing-declarations"
54# pragma clang diagnostic ignored "-Wpadded"
55# pragma clang diagnostic ignored "-Wc11-extensions"
56# pragma clang diagnostic ignored "-Wembedded-directive"
57#elif __IS_COMPILER_ARM_COMPILER_5__
58# pragma diag_suppress 64
59#elif __IS_COMPILER_GCC__
60# pragma GCC diagnostic push
61# pragma GCC diagnostic ignored "-Wmissing-declarations"
62# pragma GCC diagnostic ignored "-Wpadded"
73#if defined(__IS_COMPILER_GCC__) && __IS_COMPILER_GCC__ && __ARM_2D_HAS_HELIUM__
75# if (__GNUC__ > 13) || \
76 (__GNUC__ == 13 && __GNUC_MINOR__ > 2) || \
77 (__GNUC__ == 13 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >= 1)
80# ifndef __ARM_2D_SUPPRESS_GCC_HELIUM_PERFORMANCE_WARNING__
81# pragma GCC warning "GCC only has basic support for Helium and its\
82 performance might highly like disappoint you,You can define a macro\
83 __ARM_2D_SUPPRESS_GCC_HELIUM_PERFORMANCE_WARNING__ to suppress this warning."
86# ifndef USE_MVE_INTRINSICS
87# define USE_MVE_INTRINSICS
92# ifndef __ARM_2D_SUPPRESS_GCC_HELIUM_PATCH_WARNING__
93# pragma GCC warning "As GCC has compilation issues for supporting Helium,\
94 the scalar version is used. You can define a macro\
95 __ARM_2D_SUPPRESS_GCC_HELIUM_PATCH_WARNING__ to suppress this warning."
98# undef __ARM_2D_HAS_HELIUM__
99# undef __ARM_2D_HAS_HELIUM_INTEGER__
100# undef __ARM_2D_HAS_HELIUM_FLOAT__
102# define __ARM_2D_HAS_HELIUM__ 0
103# define __ARM_2D_HAS_HELIUM_INTEGER__ 0
104# define __ARM_2D_HAS_HELIUM_FLOAT__ 0
110#if defined(__IS_COMPILER_IAR__) && __IS_COMPILER_IAR__
111# ifndef USE_MVE_INTRINSICS
112# define USE_MVE_INTRINSICS
116#if defined(__IS_COMPILER_GCC__) && __IS_COMPILER_GCC__
117# define __va_list va_list
120#if defined(__IS_COMPILER_LLVM__) && __IS_COMPILER_LLVM__
121# define __va_list va_list
124#if defined(__IS_COMPILER_IAR__) && __IS_COMPILER_IAR__
125# define __va_list va_list
221 uint8_t chChannel[4];
368 ARM_2D_COLOUR_SZ_msk = (0x07 << 1),
370 ARM_2D_COLOUR_LITTLE_ENDIAN = 0,
371 ARM_2D_COLOUR_BIG_ENDIAN = 1,
373 ARM_2D_COLOUR_LITTLE_ENDIAN_msk = ARM_2D_COLOUR_LITTLE_ENDIAN << 4,
374 ARM_2D_COLOUR_BIG_ENDIAN_msk = ARM_2D_COLOUR_BIG_ENDIAN << 4,
376 ARM_2D_COLOUR_NO_ALPHA = 0,
377 ARM_2D_COLOUR_HAS_ALPHA = 1,
379 ARM_2D_COLOUR_NO_ALPHA_msk = ARM_2D_COLOUR_NO_ALPHA << 0,
380 ARM_2D_COLOUR_HAS_ALPHA_msk = ARM_2D_COLOUR_HAS_ALPHA << 0,
382 ARM_2D_COLOUR_VARIANT_pos = 5,
383 ARM_2D_COLOUR_VARIANT_msk = 0x07 << ARM_2D_COLOUR_VARIANT_pos,
387#define ARM_2D_M_COLOUR_SZ_1BIT 0
388#define ARM_2D_M_COLOUR_SZ_2BIT 1
389#define ARM_2D_M_COLOUR_SZ_4BIT 2
390#define ARM_2D_M_COLOUR_SZ_8BIT 3
391#define ARM_2D_M_COLOUR_SZ_16BIT 4
392#define ARM_2D_M_COLOUR_SZ_32BIT 5
393#define ARM_2D_M_COLOUR_SZ_24BIT 6
395#define ARM_2D_M_COLOUR_SZ_1BIT_msk (ARM_2D_M_COLOUR_SZ_1BIT << 1)
396#define ARM_2D_M_COLOUR_SZ_2BIT_msk (ARM_2D_M_COLOUR_SZ_2BIT << 1)
397#define ARM_2D_M_COLOUR_SZ_4BIT_msk (ARM_2D_M_COLOUR_SZ_4BIT << 1)
398#define ARM_2D_M_COLOUR_SZ_8BIT_msk (ARM_2D_M_COLOUR_SZ_8BIT << 1)
399#define ARM_2D_M_COLOUR_SZ_16BIT_msk (ARM_2D_M_COLOUR_SZ_16BIT<< 1)
400#define ARM_2D_M_COLOUR_SZ_32BIT_msk (ARM_2D_M_COLOUR_SZ_32BIT<< 1)
401#define ARM_2D_M_COLOUR_SZ_24BIT_msk (ARM_2D_M_COLOUR_SZ_24BIT<< 1)
402#define ARM_2D_M_COLOUR_SZ_msk (0x07 << 1),
404#define ARM_2D_M_COLOUR_LITTLE_ENDIAN 0
405#define ARM_2D_M_COLOUR_BIG_ENDIAN 1
407#define ARM_2D_M_COLOUR_LITTLE_ENDIAN_msk (ARM_2D_M_COLOUR_LITTLE_ENDIAN << 4)
408#define ARM_2D_M_COLOUR_BIG_ENDIAN_msk (ARM_2D_M_COLOUR_BIG_ENDIAN << 4)
410#define ARM_2D_M_COLOUR_NO_ALPHA 0
411#define ARM_2D_M_COLOUR_HAS_ALPHA 1
413#define ARM_2D_M_COLOUR_NO_ALPHA_msk (ARM_2D_M_COLOUR_NO_ALPHA << 0)
414#define ARM_2D_M_COLOUR_HAS_ALPHA_msk (ARM_2D_M_COLOUR_HAS_ALPHA << 0)
416#define ARM_2D_M_COLOUR_VARIANT_pos 5
417#define ARM_2D_M_COLOUR_VARIANT_msk (0x07<<ARM_2D_M_COLOUR_VARIANT_pos)
424 ARM_2D_COLOUR_MONOCHROME = ARM_2D_COLOUR_SZ_1BIT_msk,
425 ARM_2D_COLOUR_BIN = ARM_2D_COLOUR_SZ_1BIT_msk,
426 ARM_2D_COLOUR_1BIT = ARM_2D_COLOUR_SZ_1BIT_msk,
435 ARM_2D_COLOUR_8BIT = ARM_2D_COLOUR_SZ_8BIT_msk,
436 ARM_2D_COLOUR_GRAY8 = ARM_2D_COLOUR_SZ_8BIT_msk,
437 ARM_2D_COLOUR_MASK_A8 = ARM_2D_COLOUR_SZ_8BIT_msk,
439 ARM_2D_COLOUR_16BIT = ARM_2D_COLOUR_SZ_16BIT_msk,
440 ARM_2D_COLOUR_RGB16 = ARM_2D_COLOUR_SZ_16BIT_msk,
441 ARM_2D_COLOUR_RGB565 = ARM_2D_COLOUR_RGB16,
448 ARM_2D_COLOUR_24BIT = ARM_2D_COLOUR_SZ_24BIT_msk ,
449 ARM_2D_COLOUR_RGB24 = ARM_2D_COLOUR_SZ_24BIT_msk ,
451 ARM_2D_COLOUR_32BIT = ARM_2D_COLOUR_SZ_32BIT_msk ,
452 ARM_2D_COLOUR_RGB32 = ARM_2D_COLOUR_SZ_32BIT_msk ,
454 ARM_2D_COLOUR_CCCN888 = ARM_2D_COLOUR_RGB32 ,
455 ARM_2D_COLOUR_CCCA8888 = ARM_2D_COLOUR_SZ_32BIT_msk |
456 ARM_2D_COLOUR_HAS_ALPHA_msk ,
458 ARM_2D_COLOUR_RGB888 = ARM_2D_COLOUR_CCCN888 ,
459 ARM_2D_COLOUR_BGRA8888 = ARM_2D_COLOUR_CCCA8888 ,
469 ARM_2D_CHANNEL_8in32 = ARM_2D_COLOUR_SZ_32BIT_msk |
470 ARM_2D_COLOUR_HAS_ALPHA_msk |
471 ARM_2D_COLOUR_VARIANT_msk ,
475#define ARM_2D_M_COLOUR_MONOCHROME ARM_2D_M_COLOUR_SZ_1BIT_msk
476#define ARM_2D_M_COLOUR_BIN ARM_2D_M_COLOUR_SZ_1BIT_msk
477#define ARM_2D_M_COLOUR_1BIT ARM_2D_M_COLOUR_SZ_1BIT_msk
479#define ARM_2D_M_COLOUR_MASK_A1 ARM_2D_M_COLOUR_SZ_1BIT_msk
480#define ARM_2D_M_COLOUR_MASK_A2 ARM_2D_M_COLOUR_SZ_2BIT_msk
481#define ARM_2D_M_COLOUR_MASK_A4 ARM_2D_M_COLOUR_SZ_4BIT_msk
483#define ARM_2D_M_COLOUR_8BIT ARM_2D_M_COLOUR_SZ_8BIT_msk
484#define ARM_2D_M_COLOUR_GRAY8 ARM_2D_M_COLOUR_SZ_8BIT_msk
485#define ARM_2D_M_COLOUR_MASK_A8 ARM_2D_M_COLOUR_SZ_8BIT_msk
487#define ARM_2D_M_COLOUR_16BIT ARM_2D_M_COLOUR_SZ_16BIT_msk
488#define ARM_2D_M_COLOUR_RGB16 ARM_2D_M_COLOUR_SZ_16BIT_msk
489#define ARM_2D_M_COLOUR_RGB565 ARM_2D_M_COLOUR_RGB16
496#define ARM_2D_M_COLOUR_24BIT ARM_2D_M_COLOUR_SZ_24BIT_msk
497#define ARM_2D_M_COLOUR_RGB24 ARM_2D_M_COLOUR_SZ_24BIT_msk
499#define ARM_2D_M_COLOUR_32BIT ARM_2D_M_COLOUR_SZ_32BIT_msk
500#define ARM_2D_M_COLOUR_RGB32 ARM_2D_M_COLOUR_SZ_32BIT_msk
502#define ARM_2D_M_COLOUR_CCCN888 ARM_2D_M_COLOUR_RGB32
505#define ARM_2D_M_COLOUR_CCCA8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
506 | ARM_2D_M_COLOUR_HAS_ALPHA_msk)
508#define ARM_2D_M_COLOUR_RGBX888 ARM_2D_M_COLOUR_CCCN888
509#define ARM_2D_M_COLOUR_BGRA8888 ARM_2D_M_COLOUR_CCCA8888
519#define ARM_2D_M_CHANNEL_8in32 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
520 | ARM_2D_M_COLOUR_HAS_ALPHA_msk) \
521 | ARM_2D_M_COLOUR_VARIANT_msk )
529 uint8_t bHasAlpha : 1;
530 uint8_t u3ColourSZ : 3;
531 uint8_t bBigEndian : 1;
532 uint8_t u2Variant : 2;
536 uint8_t u7ColourFormat : 7;
609 uint8_t bHasEnforcedColour : 1;
610 uint8_t bDerivedResource : 1;
611 uint8_t bVirtualResource : 1;
612 uint8_t bVirtualScreen : 1;
613 uint8_t u3ExtensionID : 3;
619 uint8_t bIsNewFrame : 1;
620 uint8_t bIsDryRun : 1;
623 int16_t iTargetStride;
717 uint8_t chBottomLeft;
718 uint8_t chBottomRight;
731 uint8_t chBottomLeft;
749 uint8_t chBottomLeft;
771 uint32_t u24SizeInByte : 24;
772 uint32_t u2ItemSize : 3;
773 uint32_t u2Align : 3;
786 uint32_t u24SizeInByte : 24;
787 uint32_t u2ItemSize : 3;
788 uint32_t u2Align : 3;
911#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE _BV(0)
912#define ARM_2D_OP_INFO_PARAM_HAS_TARGET _BV(1)
913#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK _BV(2)
914#define ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK _BV(3)
915#define ARM_2D_OP_INFO_PARAM_HAS_ORIGIN _BV(4)
918#define ARM_2D_OP_INFO_PARAM_TILES_MASK ( \
919 ARM_2D_OP_INFO_PARAM_HAS_SOURCE | \
920 ARM_2D_OP_INFO_PARAM_HAS_TARGET | \
921 ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK | \
922 ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK | \
923 ARM_2D_OP_INFO_PARAM_HAS_ORIGIN )
937 uint8_t bHasSource : 1;
938 uint8_t bHasTarget : 1;
939 uint8_t bHasSrcMask : 1;
940 uint8_t bHasDesMask : 1;
941 uint8_t bHasOrigin : 1;
943 uint8_t bAllowEnforcedColour : 1;
948 uint8_t chInClassOffset;
957 uint8_t CopyOrigLike;
958 uint8_t FillOrigLike;
961 uint8_t TileProcessLike;
963 }LowLevelInterfaceIndex;
999 ARM_2D_PREF_ACC_DONT_CARE = 3,
1002#define __ARM_2D_OP_STATUS_BUSY_msk (1 << 4)
1003#define __ARM_2D_OP_STATUS_IO_ERROR_msk (1 << 5)
1004#define __ARM_2D_OP_STATUS_CPL_msk (1 << 6)
1012 uint16_t u4SubTaskCount : 4;
1013 uint16_t bIsBusy : 1;
1014 uint16_t bIOError : 1;
1015 uint16_t bOpCpl : 1;
1032 uint8_t u2ACCMethods : 2;
1041#if __ARM_2D_HAS_ASYNC__
1042 uintptr_t pSemaphore;
1196#if (__ARM_2D_HAS_HELIUM_FLOAT__ || __ARM_2D_HAS_FPU__) \
1197 && !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__
1228#if defined(__clang__)
1229#pragma clang diagnostic pop
1230#elif __IS_COMPILER_ARM_COMPILER_5__
1231#pragma diag_warning 64
1232#elif __IS_COMPILER_GCC__
1233#pragma GCC diagnostic pop