Commit | Line | Data |
---|---|---|
5763fb39 T |
1 | #ifndef EXYNOS_VPP_VIRTUALDISPLAY_H |
2 | #define EXYNOS_VPP_VIRTUALDISPLAY_H | |
3 | ||
4 | #include "ExynosHWC.h" | |
5 | #include "ExynosDisplay.h" | |
a4e95a20 | 6 | #include <linux/videodev2.h> |
5763fb39 T |
7 | #ifdef USES_VDS_BGRA8888 |
8 | #include "ExynosMPPModule.h" | |
9 | #endif | |
10 | ||
11 | #define NUM_FRAME_BUFFER 5 | |
12 | #define HWC_SKIP_RENDERING 0x80000000 | |
13 | #define MAX_BUFFER_COUNT 8 | |
14 | ||
15 | #define MAX_VIRTUALDISPLAY_VIDEO_LAYERS 1 | |
16 | ||
17 | class ExynosVirtualDisplay : public ExynosDisplay { | |
18 | public: | |
19 | /* Methods */ | |
20 | ExynosVirtualDisplay(struct exynos5_hwc_composer_device_1_t *pdev); | |
21 | ~ExynosVirtualDisplay(); | |
22 | ||
23 | virtual int32_t getDisplayAttributes(const uint32_t attribute); | |
24 | virtual void configureWriteBack(hwc_display_contents_1_t *contents, decon_win_config_data &win_data); | |
25 | ||
26 | virtual int blank(); | |
27 | virtual int unblank(); | |
28 | ||
29 | virtual int getConfig(); | |
30 | ||
31 | virtual int prepare(hwc_display_contents_1_t* contents); | |
32 | virtual int set(hwc_display_contents_1_t* contents); | |
33 | ||
34 | virtual void allocateLayerInfos(hwc_display_contents_1_t* contents); | |
35 | virtual void determineYuvOverlay(hwc_display_contents_1_t *contents); | |
36 | virtual void determineSupportedOverlays(hwc_display_contents_1_t *contents); | |
37 | virtual void determineBandwidthSupport(hwc_display_contents_1_t *contents); | |
38 | ||
39 | virtual void init(hwc_display_contents_1_t* contents); | |
40 | virtual void deInit(); | |
41 | ||
42 | void setWFDOutputResolution(unsigned int width, unsigned int height, unsigned int disp_w, unsigned int disp_h); | |
43 | #ifdef USES_VDS_OTHERFORMAT | |
44 | void setVDSGlesFormat(int format); | |
45 | #endif | |
46 | void setPriContents(hwc_display_contents_1_t* contents); | |
47 | ||
48 | enum CompositionType { | |
49 | COMPOSITION_UNKNOWN = 0, | |
50 | COMPOSITION_GLES = 1, | |
51 | COMPOSITION_HWC = 2, | |
52 | COMPOSITION_MIXED = COMPOSITION_GLES | COMPOSITION_HWC | |
53 | }; | |
54 | ||
55 | unsigned int mWidth; | |
56 | unsigned int mHeight; | |
57 | unsigned int mDisplayWidth; | |
58 | unsigned int mDisplayHeight; | |
59 | ||
60 | bool mIsWFDState; | |
61 | bool mIsRotationState; | |
62 | ||
63 | bool mPresentationMode; | |
64 | unsigned int mDeviceOrientation; | |
65 | unsigned int mFrameBufferTargetTransform; | |
66 | ||
67 | CompositionType mCompositionType; | |
68 | CompositionType mPrevCompositionType; | |
69 | int mGLESFormat; | |
70 | int mSinkUsage; | |
71 | ||
72 | protected: | |
73 | void setSinkBufferUsage(); | |
74 | void processGles(hwc_display_contents_1_t* contents); | |
75 | void processHwc(hwc_display_contents_1_t* contents); | |
76 | void processMixed(hwc_display_contents_1_t* contents); | |
77 | ||
78 | virtual void configureHandle(private_handle_t *handle, size_t index, hwc_layer_1_t &layer, int fence_fd, decon_win_config &cfg); | |
79 | virtual int postFrame(hwc_display_contents_1_t *contents); | |
80 | #ifdef USES_VDS_BGRA8888 | |
81 | virtual bool isBothMPPProcessingRequired(hwc_layer_1_t &layer); | |
82 | #endif | |
83 | virtual void determineSkipLayer(hwc_display_contents_1_t *contents); | |
84 | #ifdef USES_VDS_OTHERFORMAT | |
85 | virtual bool isSupportGLESformat(); | |
86 | #endif | |
87 | bool mIsSecureDRM; | |
88 | bool mIsNormalDRM; | |
89 | ||
90 | hwc_layer_1_t *mOverlayLayer; | |
91 | hwc_layer_1_t *mFBTargetLayer; | |
92 | hwc_layer_1_t *mFBLayer[NUM_FRAME_BUFFER]; | |
93 | size_t mNumFB; | |
94 | ||
95 | void calcDisplayRect(hwc_layer_1_t &layer); | |
96 | ||
97 | #ifdef USES_DISABLE_COMPOSITIONTYPE_GLES | |
98 | ExynosMPPModule *mExternalMPPforCSC; | |
99 | #endif | |
100 | ||
101 | #ifdef USES_VDS_BGRA8888 | |
102 | bool mForceDoubleOperation; | |
103 | ExynosMPPModule *mExternalMPPforCSC; | |
104 | #endif | |
105 | ||
106 | #ifdef USE_VIDEO_EXT_FOR_WFD_DRM | |
107 | protected: | |
108 | int mSMemFd; | |
109 | bool mSMemProtected; | |
110 | ||
111 | void setMemoryProtection(int protection); | |
112 | ||
113 | int mReserveMemFd; | |
114 | bool mFlagIONBufferAllocated; | |
115 | bool checkIONBufferPrepared(); | |
116 | public: | |
117 | void requestIONMemory(); | |
118 | void freeIONMemory(); | |
119 | #endif | |
120 | ||
121 | }; | |
122 | ||
123 | #endif |