1 #ifndef EXYNOS_VPP_VIRTUALDISPLAY_H
2 #define EXYNOS_VPP_VIRTUALDISPLAY_H
5 #include "ExynosDisplay.h"
6 #include <linux/videodev2.h>
7 #ifdef USES_VDS_BGRA8888
8 #include "ExynosMPPModule.h"
11 #define NUM_FRAME_BUFFER 5
12 #define HWC_SKIP_RENDERING 0x80000000
13 #define MAX_BUFFER_COUNT 8
15 #define MAX_VIRTUALDISPLAY_VIDEO_LAYERS 1
17 class ExynosVirtualDisplay
: public ExynosDisplay
{
20 ExynosVirtualDisplay(struct exynos5_hwc_composer_device_1_t
*pdev
);
21 ~ExynosVirtualDisplay();
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
);
27 virtual int unblank();
29 virtual int getConfig();
31 virtual int prepare(hwc_display_contents_1_t
* contents
);
32 virtual int set(hwc_display_contents_1_t
* contents
);
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
);
39 virtual void init(hwc_display_contents_1_t
* contents
);
40 virtual void deInit();
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
);
46 void setPriContents(hwc_display_contents_1_t
* contents
);
48 enum CompositionType
{
49 COMPOSITION_UNKNOWN
= 0,
52 COMPOSITION_MIXED
= COMPOSITION_GLES
| COMPOSITION_HWC
57 unsigned int mDisplayWidth
;
58 unsigned int mDisplayHeight
;
61 bool mIsRotationState
;
63 bool mPresentationMode
;
64 unsigned int mDeviceOrientation
;
65 unsigned int mFrameBufferTargetTransform
;
67 CompositionType mCompositionType
;
68 CompositionType mPrevCompositionType
;
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
);
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
);
83 virtual void determineSkipLayer(hwc_display_contents_1_t
*contents
);
84 #ifdef USES_VDS_OTHERFORMAT
85 virtual bool isSupportGLESformat();
90 hwc_layer_1_t
*mOverlayLayer
;
91 hwc_layer_1_t
*mFBTargetLayer
;
92 hwc_layer_1_t
*mFBLayer
[NUM_FRAME_BUFFER
];
95 void calcDisplayRect(hwc_layer_1_t
&layer
);
97 #ifdef USES_DISABLE_COMPOSITIONTYPE_GLES
98 ExynosMPPModule
*mExternalMPPforCSC
;
101 #ifdef USES_VDS_BGRA8888
102 bool mForceDoubleOperation
;
103 ExynosMPPModule
*mExternalMPPforCSC
;
106 #ifdef USE_VIDEO_EXT_FOR_WFD_DRM
111 void setMemoryProtection(int protection
);
114 bool mFlagIONBufferAllocated
;
115 bool checkIONBufferPrepared();
117 void requestIONMemory();
118 void freeIONMemory();