libhwjpeg: resolve compilation errors
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos.git] / libdisplay / ExynosDisplay.h
CommitLineData
5763fb39
T
1#ifndef EXYNOS_DISPLAY_H
2#define EXYNOS_DISPLAY_H
3
4#include <utils/Mutex.h>
5#include <utils/Vector.h>
6#include "ExynosHWC.h"
7
8#ifndef MAX_BUF_STRIDE
9#define MAX_BUF_STRIDE 4096
10#endif
11
12class ExynosMPPModule;
13
14enum {
15 eSkipLayer = 0x00000001,
16 eUnsupportedPlaneAlpha = 0x00000002,
17 eInvalidHandle = 0x00000004,
18 eHasFloatSrcCrop = 0x00000008,
19 eUnsupportedDstWidth = 0x00000010,
20 eUnsupportedCoordinate = 0x00000020,
21 eUnsupportedFormat = 0x00000040,
22 eUnsupportedBlending = 0x00000080,
23 eDynamicRecomposition = 0x00000100,
24 eForceFbEnabled = 0x00000200,
25 eSandwitchedBetweenGLES = 0x00000400,
26 eHasPopupVideo = 0x00000800,
27 eHasDRMVideo = 0x00001000,
28 eInsufficientBandwidth = 0x00002000,
29 eInsufficientOverlapCount = 0x00004000,
30 eInsufficientWindow = 0x00008000,
31 eInsufficientMPP = 0x00010000,
32 eSwitchingLocalPath = 0x00020000,
33 eRGBLayerDuringVideoPlayback = 0x00040000,
34 eSkipStaticLayer = 0x00080000,
35 eNotAlignedDstPosition = 0x00100000,
36 eUnSupportedUseCase = 0x00200000,
37 eExceedHStrideMaximum = 0x00400000,
38 eMPPUnsupported = 0x40000000,
39 eUnknown = 0x80000000,
40};
41
42const struct s3cFormat {
43 uint32_t format;
44 const char *desc;
45} s3cFormat[] = {
46 {S3C_FB_PIXEL_FORMAT_RGBA_8888, "RGBA8888"},
47 {S3C_FB_PIXEL_FORMAT_RGBX_8888, "RGBX8888"},
48 {S3C_FB_PIXEL_FORMAT_RGBA_5551, "RGBA5551"},
49 {S3C_FB_PIXEL_FORMAT_RGB_565, "RGB565"},
50 {S3C_FB_PIXEL_FORMAT_BGRA_8888, "BGRA8888"},
51 {S3C_FB_PIXEL_FORMAT_BGRX_8888, "BGRX8888"},
52};
53
54class ExynosLayerInfo {
55 public:
56 int32_t compositionType;
57 uint32_t mCheckOverlayFlag;
58 uint32_t mCheckMPPFlag;
59};
60
61bool winConfigChanged(s3c_fb_win_config *c1, s3c_fb_win_config *c2);
62void dumpConfig(s3c_fb_win_config &c);
63enum s3c_fb_pixel_format halFormatToS3CFormat(int format);
64bool isFormatSupported(int format);
65enum s3c_fb_blending halBlendingToS3CBlending(int32_t blending);
66bool isBlendingSupported(int32_t blending);
67const char *s3cFormat2str(uint32_t format);
68
69class ExynosDisplay {
70 public:
71 /* Methods */
72 ExynosDisplay(int numGSCs);
73 virtual ~ExynosDisplay();
74
75 virtual int getDeconWinMap(int overlayIndex, int totalOverlays);
76 virtual int inverseWinMap(int windowIndex, int totalOverlays);
77 virtual int prepare(hwc_display_contents_1_t *contents);
78 virtual int set(hwc_display_contents_1_t *contents);
79 virtual void dump(android::String8& result);
80 virtual void freeMPP();
81 virtual void allocateLayerInfos(hwc_display_contents_1_t* contents);
82 virtual void dumpLayerInfo(android::String8& result);
4e1e36cc 83 virtual int32_t getDisplayAttributes(const uint32_t __unused attribute, uint32_t config __unused) {return 0;};
5763fb39
T
84 virtual int getActiveConfig() {return 0;};
85 virtual int setActiveConfig(int __unused index) {return 0;};
86
87 /* Fields */
88 int mDisplayFd;
89 int32_t mXres;
90 int32_t mYres;
91
92 int32_t mXdpi;
93 int32_t mYdpi;
94 int32_t mVsyncPeriod;
95
96 int mOtfMode;
97 bool mHasDrmSurface;
98 alloc_device_t *mAllocDevice;
99 int mNumMPPs;
100 android::Mutex mLayerInfoMutex;
101 android::Vector<ExynosLayerInfo *> mLayerInfos;
102
103 struct exynos5_hwc_composer_device_1_t *mHwc;
104};
105
106#endif