1 #ifndef EXYNOS_VPP_HDMI_H
2 #define EXYNOS_VPP_HDMI_H
4 #include <utils/Vector.h>
6 #include "ExynosDisplay.h"
7 #include <linux/videodev2.h>
8 #include "videodev2_exynos_hdmi.h"
10 #define MAX_HDMI_VIDEO_LAYERS 1
12 #define SUPPORTED_DV_TIMINGS_NUM 28
14 struct preset_index_mapping
{
19 const struct preset_index_mapping preset_index_mappings
[SUPPORTED_DV_TIMINGS_NUM
] = {
20 {V4L2_DV_480P59_94
, 0},
30 {V4L2_DV_1080P60
, 10},
31 {V4L2_DV_2160P24
, 11},
32 {V4L2_DV_2160P25
, 12},
33 {V4L2_DV_2160P30
, 13},
34 {V4L2_DV_2160P24_1
, 14},
35 {V4L2_DV_720P60_SB_HALF
, 15},
36 {V4L2_DV_720P60_TB
, 16},
37 {V4L2_DV_720P50_SB_HALF
, 17},
38 {V4L2_DV_720P50_TB
, 18},
39 {V4L2_DV_1080P24_FP
, 19},
40 {V4L2_DV_1080P24_SB_HALF
, 20},
41 {V4L2_DV_1080P24_TB
, 21},
42 {V4L2_DV_1080I60_SB_HALF
, 22},
43 {V4L2_DV_1080I50_SB_HALF
, 23},
44 {V4L2_DV_1080P60_SB_HALF
, 24},
45 {V4L2_DV_1080P60_TB
, 25},
46 {V4L2_DV_1080P30_SB_HALF
, 26},
47 {V4L2_DV_1080P30_TB
, 27}
51 HDMI_RESOLUTION_BASE
= 0,
77 #define S3D_720P_60_BASE 22
78 #define S3D_720P_59_94_BASE 25
79 #define S3D_720P_50_BASE 28
80 #define S3D_1080P_24_BASE 31
81 #define S3D_1080P_23_98_BASE 34
82 #define S3D_1080P_60_BASE 39
83 #define S3D_1080P_30_BASE 42
85 class ExynosExternalDisplay
: public ExynosDisplay
{
88 ExynosExternalDisplay(struct exynos5_hwc_composer_device_1_t
*pdev
);
89 ~ExynosExternalDisplay();
91 void setHdmiStatus(bool status
);
93 bool isPresetSupported(unsigned int preset
);
97 void setPreset(int preset
);
98 int convert3DTo2D(int preset
);
99 void setHdcpStatus(int status
);
100 void setAudioChannel(uint32_t channels
);
101 uint32_t getAudioChannel();
103 bool isIONBufferAllocated() {return mFlagIONBufferAllocated
;};
105 virtual int openHdmi();
106 virtual void closeHdmi();
108 virtual int prepare(hwc_display_contents_1_t
* contents
);
109 virtual int set(hwc_display_contents_1_t
* contents
);
110 virtual void allocateLayerInfos(hwc_display_contents_1_t
* contents
);
111 virtual int32_t getDisplayAttributes(const uint32_t attribute
, uint32_t config
= 0);
112 virtual void determineYuvOverlay(hwc_display_contents_1_t
*contents
);
113 virtual void determineSupportedOverlays(hwc_display_contents_1_t
*contents
);
114 virtual int clearDisplay();
115 virtual void freeExtVideoBuffers();
116 virtual int getDisplayConfigs(uint32_t *configs
, size_t *numConfigs
);
117 virtual int getActiveConfig();
118 virtual int setActiveConfig(int index
);
125 android::Vector
< unsigned int > mConfigurations
;
128 void skipUILayers(hwc_display_contents_1_t
*contents
);
129 int getDVTimingsIndex(int preset
);
130 virtual void handleStaticLayers(hwc_display_contents_1_t
*contents
, struct decon_win_config_data
&win_data
, int tot_ovly_wins
);
131 void cleanConfigurations();
132 void dumpConfigurations();
133 virtual void configureHandle(private_handle_t
*handle
, size_t index
, hwc_layer_1_t
&layer
, int fence_fd
, decon_win_config
&cfg
);
134 virtual int postMPPM2M(hwc_layer_1_t
&layer
, struct decon_win_config
*config
, int win_map
, int index
);
135 virtual int postFrame(hwc_display_contents_1_t
*contents
);
136 virtual void doPreProcessing(hwc_display_contents_1_t
* contents
);
138 buffer_handle_t mDRMTempBuffer
;
139 bool mFlagIONBufferAllocated
;
140 void requestIONMemory();
141 void freeIONMemory();
142 bool checkIONBufferPrepared();
143 int configureDRMSkipHandle(decon_win_config
&cfg
);
144 void setHdmiResolution(int resolution
, int s3dMode
);