xref: /utopia/UTPA2-700.0.x/mxlib/include/apiXC_Dlc.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 ///
97 /// @file   apiXC_Dlc.h
98 /// @brief  DLC API layer Interface
99 /// @author MStar Semiconductor Inc.
100 //  CL171075++: sync to DLC libv32.59 :
101 //      1.Add guard condition to msDlcOnOff & msDlc_CGC_Init; msDlcOnOff & msDlc_CGC_Init will check
102 //        DLC On/Off status before execution.
103 ///////////////////////////////////////////////////////////////////////////////////////////////////
104 
105 /*! \defgroup Video Video modules
106 
107  *  \defgroup XC_BE XC_BE modules
108  *  \ingroup Video
109 
110 	DLC is used for\n
111 	1. Dynamic Luma Curve : Calculate the DLC curve base on histogram and average value.\n
112 	For more information,see \link DLC DLC interface (apiXC_DLC.h) \endlink
113 
114  *  \defgroup DLC DLC interface (apiXC_DLC.h)
115  *  \ingroup XC_BE
116 
117     DLC is used for:
118 
119     - Dynamic Luma Curve : Calculate the DLC curve base on histogram and average value.
120 
121     <b> Operation Code Flow: </b> \n
122     check flow chart directly.
123     \image html apiXC_DLC_DBC_Handler_flow.png
124 
125  *  \defgroup DLC_INIT DLC init control
126  *  \ingroup DLC
127 
128  *! \defgroup DLC_FEATURE DLC feature operation
129  *  \ingroup DLC
130 
131  *! \defgroup DLC_INFO DLC Infomation pool
132  *  \ingroup DLC
133 
134  *! \defgroup DLC_ToBeModified DLC api to be modified
135  *  \ingroup DLC
136 
137  *! \defgroup DLC_ToBeRemove DLC api to be removed
138  *  \ingroup DLC
139  */
140 
141 #ifndef _API_XC_DLC_H_
142 #define _API_XC_DLC_H_
143 #include "MsCommon.h"
144 #include "MsDevice.h"
145 #include "UFO.h"
146 
147 #ifdef __cplusplus
148 extern "C"
149 {
150 #endif
151 
152 //-------------------------------------------------------------------------------------------------
153 //  Macro and Define
154 //-------------------------------------------------------------------------------------------------
155 
156 
157 //-------------------------------------------------------------------------------------------------
158 //  Type and Structure
159 //-------------------------------------------------------------------------------------------------
160 #define MSIF_DLC_LIB_CODE               {'D','L','C','_'}
161 #define MSIF_DLC_LIBVER                 {'0','0'}
162 #define MSIF_DLC_BUILDNUM               {'3','0'}
163 #define MSIF_DLC_CHANGELIST             {'0','0','6','1','8','0','7','0'}
164 #define XC_DLC_API_VERSION /* Character String for DRV/API version */  \
165     MSIF_TAG           ,   /* 'MSIF'                               */  \
166     MSIF_CLASS         ,   /* '00'                                 */  \
167     MSIF_CUS           ,   /* 0x0000                               */  \
168     MSIF_MOD           ,   /* 0x0000                               */  \
169     MSIF_CHIP          , \
170     MSIF_CPU           , \
171     MSIF_DLC_LIB_CODE  ,   /* IP__                                 */  \
172     MSIF_DLC_LIBVER    ,   /* 0.0 ~ Z.Z                            */  \
173     MSIF_DLC_BUILDNUM  ,   /* 00 ~ 99                              */  \
174     MSIF_DLC_CHANGELIST,   /* CL#                                  */  \
175     MSIF_OS
176 #if defined(UFO_PUBLIC_HEADER_500)
177 #define XC_DLC_HDR_VERSION  1
178 #else
179 #define XC_DLC_HDR_VERSION  4
180 #endif
181 
182 #define ENABLE_10_BIT_DLC   0
183 /// 0: Init
184 /// 1: Add SDR panel gain
185 /// 2: Add u16Smin, u16Smed, u16Smax, u16Tmin, u16Tmed, u16Tmax
186 /// 3: Add bRefMode, used for UHDA test.
187 /// 4: Add TMO 1D LUT
188 #if defined(UFO_PUBLIC_HEADER_500)
189 #define DLC_TMO_INFO_VERSION 3
190 #else
191 #define DLC_TMO_INFO_VERSION 4
192 #endif
193 /// DLC_MFINIT_Ex version of current DLC lib
194 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_212)
195 #define DLC_MFINIT_EX_VERSION                      1
196 #else
197 #define DLC_MFINIT_EX_VERSION                      2
198 #endif
199 /// The ucDlcHistogramLimitCurve arrary num
200 #define DLC_HISTOGRAM_LIMIT_CURVE_ARRARY_NUM       17
201 
202 #ifndef UNUSED
203 #define UNUSED(x) (void)(x)
204 #endif
205 
206 /*!
207  *  The DLC curve settings, ways of enable DLC or, disable DLC.
208  */
209 typedef enum
210 {
211     /// DLC curve
212     E_XC_DLC_PURE_IMAGE_DLC_CURVE = 0,
213     /// Linear curve
214     E_XC_DLC_PURE_IMAGE_LINEAR_CURVE ,
215     /// get base address failed when initialize panel driver
216     E_XC_DLC_PURE_IMAGE_DO_NOTHING ,
217 } E_XC_DLC_PURE_IMAGE_CURVE ;
218 
219 /*!
220  *  The DLC curve mode, ways of decide DLC algorithm.
221  */
222 typedef enum
223 {
224     ///
225     E_XC_DLC_CURVE_MODE_BY_YAVG = 0,
226     ///
227     E_XC_DLC_CURVE_MODE_BY_HISTOGRAM ,
228     ///
229     E_XC_DLC_CURVE_MODE_BY_MIX ,
230 } E_XC_DLC_CURVE_MODE ;
231 
232 /*!
233  *  The DLC algorthm mode, ways of decide DLC algorithm.
234  */
235 typedef enum
236 {
237     ///
238     E_XC_DLC_ALGORITHM_OLD = 0,
239     ///
240     E_XC_DLC_ALGORITHM_NEW ,
241 } E_XC_DLC_ALGORITHM_MODE ;
242 /*!
243  *  The DLC curve settings, ways of enable DLC or, disable DLC.
244  */
245 typedef enum
246 {
247     /// fail
248     E_XC_DLC_FAIL = 0,
249     /// ok
250     E_XC_DLC_OK = 1,
251     /// get base address failed when initialize panel driver
252     E_XC_DLC_GET_BASEADDR_FAIL,
253     /// obtain mutex timeout when calling this function
254     E_XC_DLC_OBTAIN_MUTEX_FAIL,
255 } E_XC_DLC_RESULT;
256 
257 
258 typedef enum
259 {
260     E_XC_DLC_HISTOGRAM_32,
261     E_XC_DLC_HISTOGRAM_8,
262 }E_XC_DLC_HISTOGRAM_TYPE;
263 /******************************************************************************/
264 /*         Structures                                                         */
265 /******************************************************************************/
266 
267 //----------------------------
268 // XC DLC initialize
269 //----------------------------
270 /*!
271  *  Initial Settings of MF Dyanmic Luma Curve
272  */
273 typedef struct
274 {
275     /// Default luma curve
276     MS_U8 ucLumaCurve[16];
277     /// Default luma curve 2a
278     MS_U8 ucLumaCurve2_a[16];
279     /// Default luma curve 2b
280     MS_U8 ucLumaCurve2_b[16];
281     /// Default luma curve 2
282     MS_U8 ucLumaCurve2[16];
283 
284     /// default value: 10
285     MS_U8 u8_L_L_U;
286     /// default value: 10
287     MS_U8 u8_L_L_D;
288     /// default value: 10
289     MS_U8 u8_L_H_U;
290     /// default value: 10
291     MS_U8 u8_L_H_D;
292     /// default value: 128 (0x80)
293     MS_U8 u8_S_L_U;
294     /// default value: 128 (0x80)
295     MS_U8 u8_S_L_D;
296     /// default value: 128 (0x80)
297     MS_U8 u8_S_H_U;
298     /// default value: 128 (0x80)
299     MS_U8 u8_S_H_D;
300     /// -31 ~ 31 (bit7 = minus, ex. 0x88 => -8)
301     MS_U8 ucCGCCGain_offset;
302     /// 0x00~0x6F
303     MS_U8 ucCGCChroma_GainLimitH;
304     /// 0x00~0x10
305     MS_U8 ucCGCChroma_GainLimitL;
306     /// 0x01~0x20
307     MS_U8 ucCGCYCslope;
308     /// 0x01
309     MS_U8 ucCGCYth;
310     /// Compare difference of max and min bright
311     MS_U8 ucDlcPureImageMode;
312     /// n = 0 ~ 4 => Limit n levels => ex. n=2, limit 2 level 0xF7, 0xE7
313     MS_U8 ucDlcLevelLimit;
314     /// n = 0 ~ 50, default value: 12
315     MS_U8 ucDlcAvgDelta;
316     /// n = 0 ~ 15 => 0: disable still curve, 1 ~ 15: enable still curve
317     MS_U8 ucDlcAvgDeltaStill;
318     /// min 17 ~ max 32
319     MS_U8 ucDlcFastAlphaBlending;
320     /// some event is triggered, DLC must do slowly // for PIP On/Off, msMultiPic.c
321     MS_U8 ucDlcSlowEvent;
322     /// for IsrApp.c
323     MS_U8 ucDlcTimeOut;
324     /// for force to do fast DLC in a while
325     MS_U8 ucDlcFlickAlphaStart;
326     /// default value: 128
327     MS_U8 ucDlcYAvgThresholdH;
328     /// default value: 0
329     MS_U8 ucDlcYAvgThresholdL;
330     /// n = 24 ~ 64, default value: 48
331     MS_U8 ucDlcBLEPoint;
332     /// n = 24 ~ 64, default value: 48
333     MS_U8 ucDlcWLEPoint;
334     /// 1: enable; 0: disable
335     MS_U8 bCGCCGainCtrl : 1;
336     /// 1: enable; 0: disable
337     MS_U8 bEnableBLE : 1;
338     /// 1: enable; 0: disable
339     MS_U8 bEnableWLE : 1;
340 } XC_DLC_MFinit;
341 
342 
343 typedef struct
344 {
345     MS_U32 u32DLC_MFinit_Ex_Version;   ///<Version of current structure. Please always set to "DLC_MFINIT_EX_VERSION" as input
346     /// Default luma curve
347     MS_U8 ucLumaCurve[16];
348     /// Default luma curve 2a
349     MS_U8 ucLumaCurve2_a[16];
350     /// Default luma curve 2b
351     MS_U8 ucLumaCurve2_b[16];
352     /// Default luma curve 2
353     MS_U8 ucLumaCurve2[16];
354 
355     /// default value: 10
356     MS_U8 u8_L_L_U;
357     /// default value: 10
358     MS_U8 u8_L_L_D;
359     /// default value: 10
360     MS_U8 u8_L_H_U;
361     /// default value: 10
362     MS_U8 u8_L_H_D;
363     /// default value: 128 (0x80)
364     MS_U8 u8_S_L_U;
365     /// default value: 128 (0x80)
366     MS_U8 u8_S_L_D;
367     /// default value: 128 (0x80)
368     MS_U8 u8_S_H_U;
369     /// default value: 128 (0x80)
370     MS_U8 u8_S_H_D;
371     /// -31 ~ 31 (bit7 = minus, ex. 0x88 => -8)
372     MS_U8 ucCGCCGain_offset;
373     /// 0x00~0x6F
374     MS_U8 ucCGCChroma_GainLimitH;
375     /// 0x00~0x10
376     MS_U8 ucCGCChroma_GainLimitL;
377     /// 0x01~0x20
378     MS_U8 ucCGCYCslope;
379     /// 0x01
380     MS_U8 ucCGCYth;
381     /// Compare difference of max and min bright
382     MS_U8 ucDlcPureImageMode;
383     /// n = 0 ~ 4 => Limit n levels => ex. n=2, limit 2 level 0xF7, 0xE7
384     MS_U8 ucDlcLevelLimit;
385     /// n = 0 ~ 50, default value: 12
386     MS_U8 ucDlcAvgDelta;
387     /// n = 0 ~ 15 => 0: disable still curve, 1 ~ 15: enable still curve
388     MS_U8 ucDlcAvgDeltaStill;
389     /// min 17 ~ max 32
390     MS_U8 ucDlcFastAlphaBlending;
391     /// some event is triggered, DLC must do slowly // for PIP On/Off, msMultiPic.c
392     MS_U8 ucDlcSlowEvent;
393     /// for IsrApp.c
394     MS_U8 ucDlcTimeOut;
395     /// for force to do fast DLC in a while
396     MS_U8 ucDlcFlickAlphaStart;
397     /// default value: 128
398     MS_U8 ucDlcYAvgThresholdH;
399     /// default value: 0
400     MS_U8 ucDlcYAvgThresholdL;
401     /// n = 24 ~ 64, default value: 48
402     MS_U8 ucDlcBLEPoint;
403     /// n = 24 ~ 64, default value: 48
404     MS_U8 ucDlcWLEPoint;
405     /// 1: enable; 0: disable
406     MS_U8 bCGCCGainCtrl : 1;
407     /// 1: enable; 0: disable
408     MS_U8 bEnableBLE : 1;
409     /// 1: enable; 0: disable
410     MS_U8 bEnableWLE : 1;
411     /// default value: 64
412     MS_U8 ucDlcYAvgThresholdM;
413     /// Compare difference of max and min bright
414     MS_U8 ucDlcCurveMode;
415     /// min 00 ~ max 128
416     MS_U8 ucDlcCurveModeMixAlpha;
417     ///
418     MS_U8 ucDlcAlgorithmMode;
419     /// Dlc Histogram Limit Curve
420     MS_U8 ucDlcHistogramLimitCurve[DLC_HISTOGRAM_LIMIT_CURVE_ARRARY_NUM];
421     ///
422     MS_U8 ucDlcSepPointH;
423     ///
424     MS_U8 ucDlcSepPointL;
425     ///
426     MS_U16 uwDlcBleStartPointTH;
427     ///
428     MS_U16 uwDlcBleEndPointTH;
429     ///
430     MS_U8 ucDlcCurveDiff_L_TH;
431     ///
432     MS_U8 ucDlcCurveDiff_H_TH;
433     ///
434     MS_U16 uwDlcBLESlopPoint_1;
435     ///
436     MS_U16 uwDlcBLESlopPoint_2;
437     ///
438     MS_U16 uwDlcBLESlopPoint_3;
439     ///
440     MS_U16 uwDlcBLESlopPoint_4;
441     ///
442     MS_U16 uwDlcBLESlopPoint_5;
443     ///
444     MS_U16 uwDlcDark_BLE_Slop_Min;
445     ///
446     MS_U8 ucDlcCurveDiffCoringTH;
447     ///
448     MS_U8 ucDlcAlphaBlendingMin;
449     ///
450     MS_U8 ucDlcAlphaBlendingMax;
451     ///
452     MS_U8 ucDlcFlicker_alpha;
453     ///
454     MS_U8 ucDlcYAVG_L_TH;
455     ///
456     MS_U8 ucDlcYAVG_H_TH;
457     ///
458     MS_U8 ucDlcDiffBase_L;
459     ///
460     MS_U8 ucDlcDiffBase_M;
461     ///
462     MS_U8 ucDlcDiffBase_H;
463 #if defined(UFO_PUBLIC_HEADER_500_3) || defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_700)
464     MS_U8 u8LMaxThreshold;
465     MS_U8 u8LMinThreshold;
466     MS_U8 u8LMaxCorrection;
467     MS_U8 u8LMinCorrection;
468     MS_U8 u8RMaxThreshold;
469     MS_U8 u8RMinThreshold;
470     MS_U8 u8RMaxCorrection;
471     MS_U8 u8RMinCorrection;
472     MS_U8 u8AllowLoseContrast;
473 #endif
474 } XC_DLC_MFinit_Ex;
475 
476 /*!
477  *  Initial Settings of Dynamic Backlight Control
478  */
479 typedef struct
480 {
481     /// Max PWM
482     MS_U8 ucMaxPWM;
483     /// Min PWM
484     MS_U8 ucMinPWM;
485     /// Max Video
486     MS_U8 ucMax_Video;
487     /// Mid Video
488     MS_U8 ucMid_Video;
489     /// Min Video
490     MS_U8 ucMin_Video;
491     /// Current PWM
492     MS_U8 ucCurrentPWM;
493     /// Alpha
494     MS_U8 ucAlpha;
495     /// Backlight thres
496     MS_U8 ucBackLight_Thres;
497     /// Avg delta
498     MS_U8 ucAvgDelta;
499     /// Flick alpha
500     MS_U8 ucFlickAlpha;
501     /// Fast alpha blending, min 17 ~ max 32
502     MS_U8 ucFastAlphaBlending;
503     // TBD
504     MS_U8 ucLoop_Dly;
505     // TBD
506     MS_U8 ucLoop_Dly_H_Init;
507     // TBD
508     MS_U8 ucLoop_Dly_MH_Init;
509     // TBD
510     MS_U8 ucLoop_Dly_ML_Init;
511     // TBD
512     MS_U8 ucLoop_Dly_L_Init;
513     /// Y gain H
514     MS_U8 ucY_Gain_H;
515     /// C gain H
516     MS_U8 ucC_Gain_H;
517     /// Y gain M
518     MS_U8 ucY_Gain_M;
519     /// C gain M
520     MS_U8 ucC_Gain_M;
521     /// Y gain L
522     MS_U8 ucY_Gain_L;
523     /// C gain L
524     MS_U8 ucC_Gain_L;
525     /// 1: enable; 0: disable
526     MS_U8 bYGainCtrl : 1;
527     /// 1: enable; 0: disable
528     MS_U8 bCGainCtrl : 1;
529 }XC_DLC_DBC_MFinit;
530 
531 typedef struct __attribute__((packed))
532 {
533     MS_U8      u8ColorPrimaries;
534     MS_U8      u8TransferCharacteristics;
535     MS_U8      u8MatrixCoefficients;
536 } XC_DLC_HDRMetadataMpegVUI;
537 
538 // Data format follows HDR_Metadata_MpegSEI_MasteringColorVolume
539 typedef struct __attribute__((packed))
540 {
541     MS_U16     display_primaries_x[3]; // x = data*0.00002    [709] {15000, 7500, 32000}
542     MS_U16     display_primaries_y[3]; // y = data*0.00002    [709] {30000, 3000, 16500}
543     MS_U16     white_point_x; // x = data*0.00002    [709] 15635
544     MS_U16     white_point_y; // y = data*0.00002    [709] 16450
545     MS_U32     max_display_mastering_luminance; // data*0.0001 nits    [600nits] 6000000
546     MS_U32     min_display_mastering_luminance; // data*0.0001 nits    [0.3nits] 3000
547 } XC_DLC_HDRMetadataMpegSEIMasteringColorVolume;
548 
549 ///HDR Code////
550 typedef struct __attribute__((packed))
551 {
552     MS_U16 u16Smin; // 0.10
553     MS_U16 u16Smed; // 0.10
554     MS_U16 u16Smax; // 0.10
555     MS_U16 u16Tmin; // 0.10
556     MS_U16 u16Tmed; // 0.10
557     MS_U16 u16Tmax; // 0.10
558     MS_U16 u16MidSourceOffset;
559     MS_U16 u16MidTargetOffset;
560     MS_U16 u16MidSourceRatio;
561     MS_U16 u16MidTargetRatio;
562 } XC_DLC_HDRToneMappingData;
563 
564 typedef struct __attribute__((packed))
565 {
566     MS_U16 u16tRx; // target Rx
567     MS_U16 u16tRy; // target Ry
568     MS_U16 u16tGx; // target Gx
569     MS_U16 u16tGy; // target Gy
570     MS_U16 u16tBx; // target Bx
571     MS_U16 u16tBy; // target By
572     MS_U16 u16tWx; // target Wx
573     MS_U16 u16tWy; // target Wy
574 } XC_DLC_HDRGamutMappingData;
575 
576 typedef struct __attribute__((packed))
577 {
578     MS_U8      u8EOTF; // 0:SDR gamma, 1:HDR gamma, 2:SMPTE ST2084, 3:Future EOTF, 4-7:Reserved
579     MS_U16     u16Rx; // display primaries Rx
580     MS_U16     u16Ry; // display primaries Ry
581     MS_U16     u16Gx; // display primaries Gx
582     MS_U16     u16Gy; // display primaries Gy
583     MS_U16     u16Bx; // display primaries Bx
584     MS_U16     u16By; // display primaries By
585     MS_U16     u16Wx; // display primaries Wx
586     MS_U16     u16Wy; // display primaries Wy
587     MS_U16     u16Lmax; // max display mastering luminance
588     MS_U16     u16Lmin; // min display mastering luminance
589     MS_U16     u16MaxCLL; // maximum content light level
590     MS_U16     u16MaxFALL; // maximum frame-average light level
591 } XC_DLC_HDRMetadataHdmiTxInfoFrame;
592 
593 // HDR customer DLC curve.
594 typedef struct __attribute__((packed))
595 {
596     MS_BOOL bFixHdrCurve;
597     MS_U16 u16DlcCurveSize;
598     MS_U8 *pucDlcCurve;
599 #if !defined (__aarch64__)
600     void    *pDummy;
601 #endif
602 } XC_DLC_HDRCustomerDlcCurve;
603 
604 /// HDR customer color primaries setting.
605 typedef struct __attribute__((packed))
606 {
607     MS_BOOL bCustomerEnable;
608     MS_U16 u16sWx;
609     MS_U16 u16sWy;
610 } XC_DLC_HDRCustomerColorPrimaries;
611 
612 typedef struct __attribute__((packed))
613 {
614     MS_U8 PixelFormat;              // Pixel Format
615     MS_U8 Colorimetry;              // Color imetry
616     MS_U8 ExtendedColorimetry;      // Extended Color imetry
617     MS_U8 RgbQuantizationRange;     // Rgb Quantization Range
618     MS_U8 YccQuantizationRange;     // Ycc Quantization Range
619     MS_U8 StaticMetadataDescriptorID; //Static Metadata Descriptor ID
620 } XC_DLC_HDRHdmiTxAviInfoFrame;
621 
622 typedef struct __attribute__((packed))
623 {
624     MS_BOOL bUsed;
625     MS_BOOL bContentLightLevelEnabled;
626     MS_U16 u16MaxContentLightLevel;
627     MS_U16 u16MaxPicAverageLightLevel;
628 } XC_DLC_HDRMetadataSeiContentLightLevel;
629 
630 // HDR new tone mapping parameters.
631 typedef struct __attribute__((packed))
632 {
633     // TMO
634     MS_U16 u16SrcMinRatio;            //default 10
635     MS_U16 u16SrcMedRatio;                   //default 512
636     MS_U16 u16SrcMaxRatio;            //default 990
637 
638     MS_U8 u8TgtMinFlag;                         //default 1
639     MS_U16 u16TgtMin;                    //default 500
640     MS_U8 u8TgtMaxFlag;                        //default 0
641     MS_U16 u16TgtMax;                //default 300
642 
643     MS_U16 u16FrontSlopeMin;            //default 256
644     MS_U16 u16FrontSlopeMax;            //default 512
645     MS_U16 u16BackSlopeMin;            //default 128
646     MS_U16 u16BackSlopeMax;            //default 256
647 
648     MS_U16 u16SceneChangeThrd;        //default 1024
649     MS_U16 u16SceneChangeRatioMax;    //default 1024
650 
651     MS_U8 u8IIRRatio;                    //default 31
652     MS_U8 u8TMO_TargetMode;      // default 0. 0 : keeps the value in initial function  1 : from output source
653 
654 } XC_DLC_HDRNewToneMapping;
655 
656 /*!
657  *  Initial  HDR   Settings
658  */
659 typedef struct __attribute__((packed))
660 {
661     /// HDR Version Info
662     MS_U16 u16HDRVerInfo;
663     /// HDR init Length
664     MS_U16 u16HDRInitLength;
665     /// HDR Enable
666     MS_BOOL bHDREnable;
667     /// HDR Function Select
668     MS_U16 u16HDRFunctionSelect;
669     /// HDR Metadata Mpeg VUI
670     XC_DLC_HDRMetadataMpegVUI DLC_HDRMetadataMpegVUI;
671     // HDR Tone Mapping Data
672     XC_DLC_HDRToneMappingData DLC_HDRToneMappingData;
673     // HDR Gamut Mapping Data
674     XC_DLC_HDRGamutMappingData DLC_HDRGamutMappingData;
675     // HDR Metadata Hdmi Tx Info Frame
676     XC_DLC_HDRMetadataHdmiTxInfoFrame DLC_HDRMetadataHdmiTxInfoFrame;
677     // Customer DLC Curve
678     XC_DLC_HDRCustomerDlcCurve DLC_HDRCustomerDlcCurve;
679     // Customer color primaries.
680     XC_DLC_HDRCustomerColorPrimaries DLC_HDRCustomerColorPrimaries;
681     //HDR Hdmi Tx Avi Info Frame
682     XC_DLC_HDRHdmiTxAviInfoFrame DLC_HDRHdmiTxAviInfoFrame;
683 #if defined(UFO_PUBLIC_HEADER_212) || defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_500_3) || defined(UFO_PUBLIC_HEADER_700)
684     /// HDR metadata MPEG SEI mastering color volume/
685     XC_DLC_HDRMetadataMpegSEIMasteringColorVolume DLC_HDRMetadataMpegSEIMasteringColorVolume;
686 #endif
687 
688     /// New tone mapping parameters.
689     XC_DLC_HDRNewToneMapping DLC_HDRNewToneMapping;
690 
691 } XC_DLC_HDRinit;
692 
693 /*!
694  *  Initial Settings of Dyanmic Luma Curve
695  */
696 typedef struct
697 {
698     /// Scaler DCL MF init
699     XC_DLC_MFinit DLC_MFinit;
700     /// Scaler DCL MF init Ex
701     XC_DLC_MFinit_Ex DLC_MFinit_Ex;
702     /// Curve Horizontal start
703     MS_U16 u16CurveHStart;
704     /// Curve Horizontal end
705     MS_U16 u16CurveHEnd;
706     /// Curve Vertical start
707     MS_U16 u16CurveVStart;
708     /// Curve Vertical end
709     MS_U16 u16CurveVEnd;
710     /// Scaler DLC MF init
711     XC_DLC_DBC_MFinit DLC_DBC_MFinit;
712 #if (ENABLE_10_BIT_DLC)
713     /// DLC init ext
714     MS_BOOL b10BitsEn;
715 #endif
716 
717 #if defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_500_3) || defined(UFO_PUBLIC_HEADER_700)
718 #if defined(UFO_XC_HDR_VERSION) && (UFO_XC_HDR_VERSION == 2)
719     MS_U8 u8DlcMode;
720     MS_U8 u8TmoMode;
721 #endif
722 #endif
723 } XC_DLC_init;
724 
725 /*!
726  *  Luma Statistics & Data of Dyanmic Luma Curve
727  */
728 typedef struct
729 {
730     /// Luma histogram 32H
731     MS_U16 g_wLumaHistogram32H[32];
732     /// Luma total count
733     MS_U16 g_wLumiTotalCount;
734     /// Luma average temp
735     MS_U16 g_wLumiAverageTemp;
736     /// table
737     MS_U8 g_ucTable[16];
738     /// Histogram max
739     MS_U8 g_ucHistogramMax;
740     /// Histogram min
741     MS_U8 g_ucHistogramMin;
742 } XC_DLC_lumadata;
743 
744 /*!
745  *  Infomation of XC_DLC library.
746  */
747 typedef struct
748 {
749 
750 } XC_DLC_ApiInfo;
751 
752 
753 /*!
754  *  Current Status of XC_DLC and library info.
755  */
756 typedef struct DLL_PACKED
757 {
758     /// Scaler DLC init
759     XC_DLC_init DLCinit;
760     /// Scaler DLC Luma data
761     XC_DLC_lumadata DLCluma;
762     /// DLC Lib version
763     MS_U8  u8DLC_LibVer;
764     /// DLC MF version
765     MS_U16 u16DLC_MFVer;
766     /// DLC CGC MF version
767     MS_U16 u16DLC_CGC_MFVer;
768     /// DLC DBC init
769     XC_DLC_DBC_MFinit DLC_DBCinit;
770     /// DLC DBC MF version
771     MS_U16 u16DLC_DBC_MFVer;
772 } XC_DLC_ApiStatus;
773 /*
774  * DLC capture Range
775  */
776 typedef struct DLL_PACKED
777 {
778     MS_U16 wHStart;
779     MS_U16 wHEnd;
780     MS_U16 wVStart;
781     MS_U16 wVEnd;
782 }XC_DLC_CAPTURE_Range;
783 
784 #ifdef UFO_XC_HDR
785 #if (UFO_XC_HDR_VERSION == 2)
786 
787 #if defined(UFO_PUBLIC_HEADER_700)
788 typedef struct DLL_PACKED
789 {
790     MS_U32 u32OutputNits[512];
791     MS_U16 u16InputPoint[512];
792     MS_U16 u16ControlPoints;
793     MS_S16 s16LastLess1IndexOutputnits;
794     MS_S16 s16LastIndexM10000Outputs;
795     MS_S16 s16LastIndexM100Outputs;
796 }ST_XC_DLC_TMO_1DLUT;
797 #endif
798 
799 typedef struct DLL_PACKED
800 {
801     MS_U32 u32TMOInfo_Version;         ///<Version of current structure. Please always set to "DLC_TMO_INFO_VERSION" as input
802     MS_U16 u16TMOInfo_Length;          ///<Length of this structure, u163DLutInfo_Length=sizeof(ST_XC_DLC_TMO_INFO)
803     // TMO
804     MS_U16 u16SrcMinRatio;          //default 10
805     MS_U16 u16SrcMedRatio;          //default 512
806     MS_U16 u16SrcMaxRatio;          //default 990
807 
808     MS_U16 u16TgtMin;               //default 500
809     MS_U16 u16TgtMed;
810     MS_U16 u16TgtMax;               //default 300
811 
812     MS_U16 u16FrontSlopeMin;        //default 256
813     MS_U16 u16FrontSlopeMax;        //default 512
814     MS_U16 u16BackSlopeMin;         //default 128
815     MS_U16 u16BackSlopeMax;         //default 256
816 
817     MS_U16 u16SceneChangeThrd;      //default 1024
818     MS_U16 u16SceneChangeRatioMax;  //default 1024
819 
820     MS_U8 u8IIRRatio;               //default 31
821     MS_U8 u8TMOTargetMode;          // default 0. 0 : keeps the value in initial function  1 : from output source
822     MS_U16 u16SDRPanelGain;        // default 80
823 
824     MS_U16 u16Smin;
825     MS_U16 u16Smed;
826     MS_U16 u16Smax;
827     MS_U16 u16Tmin;
828     MS_U16 u16Tmed;
829     MS_U16 u16Tmax;
830 
831     MS_BOOL bRefMode;
832 
833 #if defined(UFO_PUBLIC_HEADER_700)
834     MS_U8 u8TMOUseIniControls;
835     ST_XC_DLC_TMO_1DLUT stTMO1DLUT;
836 #endif
837 } ST_XC_DLC_TMO_INFO;
838 #endif
839 #endif
840 /******************************************************************************/
841 /*         Variables                                                         */
842 /******************************************************************************/
843 
844 /******************************************************************************/
845 /*         Function Prototypes                                                */
846 /******************************************************************************/
847 
848 //-------------------------------------------------------------------------------------------------
849 /// DLC initiation
850 /// @ingroup DLC_INIT
851 // @param  pstXC_DLC_InitData             \b IN: TBD
852 // @param  u32InitDataLen                 \b IN: TBD
853 // @return @ref MS_BOOL
854 //-------------------------------------------------------------------------------------------------
855 MS_BOOL MApi_XC_DLC_Init_Ex(XC_DLC_init *pstXC_DLC_InitData, MS_U32 u32InitDataLen);
856 
857 //-------------------------------------------------------------------------------------------------
858 /// Setting DLC
859 /// @ingroup DLC_FEATURE
860 // @param  DLC_MFinit_Ex             \b IN: DLC data
861 //-------------------------------------------------------------------------------------------------
862 void MApi_XC_DLC_SetSetting_Ex(XC_DLC_MFinit_Ex *DLC_MFinit_Ex );
863 
864 
865 //-------------------------------------------------------------------------------------------------
866 /// Set DLC curve
867 /// @ingroup DLC_FEATURE
868 // @param  pNormal             \b IN: DLC normal curve
869 // @param  pLight              \b IN: DLC light curve
870 // @param  pDark               \b IN: DLC dark curve
871 //-------------------------------------------------------------------------------------------------
872 void MApi_XC_DLC_SetCurve(MS_U8 *pNormal, MS_U8 *pLight, MS_U8 *pDark);
873 
874 //-------------------------------------------------------------------------------------------------
875 /// Set BLE Slop Point
876 /// @ingroup DLC_FEATURE
877 // @param  pBLESlopPoint             \b IN: BLE Slop Point
878 //-------------------------------------------------------------------------------------------------
879 void MApi_XC_DLC_SetBleSlopPoint(MS_U16 *pBLESlopPoint);
880 
881 //-------------------------------------------------------------------------------------------------
882 /// Set Set HDR Init
883 // @param  pstDLC_HDRInitData             \b IN: HDR Init Info
884 //-------------------------------------------------------------------------------------------------
885 MS_BOOL SYMBOL_WEAK MApi_XC_DLC_SetHDRInit(XC_DLC_HDRinit *pstDLC_HDRInitData);
886 
887 //-------------------------------------------------------------------------------------------------
888 /// Get wether support EOTFor not // 1:E_EOTF_SDR 2:E_EOTF_HDR 4:E_EOTF_SMPTE_ST_2084 8:E_EOTF_HLG
889 /// @ingroup DLC_INFO
890 /// @return @ref MS_U32
891 //-------------------------------------------------------------------------------------------------
892 MS_U32 SYMBOL_WEAK MApi_XC_DLC_GetEOTFInfo(void);
893 
894 //-------------------------------------------------------------------------------------------------
895 /// DLC exit
896 /// @ingroup DLC_INIT
897 /// @return @ref MS_BOOL
898 //-------------------------------------------------------------------------------------------------
899 MS_BOOL MApi_XC_DLC_Exit(void);
900 
901 //-------------------------------------------------------------------------------------------------
902 ///Enable/disable DLC to control MDrv_DLC_SetOnOff ,used DLC enbale register to control.
903 /// @ingroup DLC_FEATURE
904 ///@param bSwitch \b IN:
905 ///   - # TRUE  Enable
906 ///   - # FALSE Disable
907 ///@param  bWindow                 \b IN: The window which applys the function effect, MAIN_WINDOW:0
908 ///                                                                                    SUB_WINDOW: 1
909 //-------------------------------------------------------------------------------------------------
910 void    MApi_XC_DLC_SetOnOff(MS_BOOL bSwitch, MS_BOOL bWindow);
911 
912 //-------------------------------------------------------------------------------------------------
913 ///Enable/disable DLC to control MDrv_DLC_Handler function.
914 /// @ingroup DLC_FEATURE
915 ///@param bSwitch \b IN:
916 ///   - # TRUE  Enable
917 ///   - # FALSE Disable
918 // @return @ref MS_BOOL
919 //-------------------------------------------------------------------------------------------------
920 MS_BOOL MApi_XC_DLC_SetDlcHandlerOnOff(MS_BOOL bDlcEnable );
921 
922 /******************************************************************************/
923 //Enable/disable BLE to control BLE function.
924 /// @ingroup DLC_FEATURE
925 //@param bSwitch \b IN
926 //   - # TRUE  Enable
927 //   - # FALSE Disable
928 // @return @ref MS_BOOL
929 /******************************************************************************/
930 MS_BOOL MApi_XC_DLC_SetBleOnOff( MS_BOOL bSwitch );
931 
932 /******************************************************************************/
933 //Enable/disable DLC Set Curve Both for main and sub.
934 /// @ingroup DLC_FEATURE
935 //@param bEnable \b IN
936 //   - # TRUE  Enable
937 //   - # FALSE Disable
938 /******************************************************************************/
939 void MApi_XC_DLC_EnableMainSubCurveSynchronization (MS_BOOL bEnable);
940 
941 //-------------------------------------------------------------------------------------------------
942 /// DLC handler
943 /// @ingroup DLC_FEATURE
944 ///@param  bWindow                 \b IN: The window which applys the function effect, MAIN_WINDOW:0
945 ///                                                                                    SUB_WINDOW: 1
946 //-------------------------------------------------------------------------------------------------
947 void    MApi_XC_DLC_Handler(MS_BOOL bWindow);
948 
949 //-------------------------------------------------------------------------------------------------
950 /// DLC get histogram handler
951 /// @ingroup DLC_INFO
952 ///@param  bWindow                 \b IN: The window which applys the function effect, MAIN_WINDOW:0
953 ///                                                                                    SUB_WINDOW: 1
954 /// @return @ref MS_BOOL
955 //-------------------------------------------------------------------------------------------------
956 MS_BOOL MApi_XC_DLC_GetHistogramHandler(MS_BOOL bWindow);
957 
958 //-------------------------------------------------------------------------------------------------
959 /// DLC get average value from 0 to 255
960 /// @ingroup DLC_INFO
961 /// @return @ref MS_U8
962 //-------------------------------------------------------------------------------------------------
963 MS_U8   MApi_XC_DLC_GetAverageValue(void);
964 
965 //-------------------------------------------------------------------------------------------------
966 /// DLC get average exactness value from 0 to 1023
967 /// @ingroup DLC_INFO
968 /// @return @ref MS_U16
969 //-------------------------------------------------------------------------------------------------
970 MS_U16 MApi_XC_DLC_GetAverageValue_Ex(void);
971 
972 //-------------------------------------------------------------------------------------------------
973 /// DLC initilization curve
974 /// @ingroup DLC_INIT
975 // @param  u16HStart               \b IN: TBD
976 // @param  u16HEnd                 \b IN: TBD
977 // @param  u16VStart               \b IN: TBD
978 // @param  u16VEnd                 \b IN: TBD
979 //-------------------------------------------------------------------------------------------------
980 void    MApi_XC_DLC_InitCurve (MS_U16 u16HStart, MS_U16 u16HEnd, MS_U16 u16VStart, MS_U16 u16VEnd);
981 
982 //-------------------------------------------------------------------------------------------------
983 /// DLC speedup trigger
984 /// @ingroup DLC_FEATURE
985 // @param  u8Loop               \b IN: TBD
986 //-------------------------------------------------------------------------------------------------
987 void    MApi_XC_DLC_SpeedupTrigger (MS_U8 u8Loop);
988 
989 //-------------------------------------------------------------------------------------------------
990 /// DLC get luma curve status
991 /// @ingroup DLC_INFO
992 /// @return @ref MS_BOOL
993 //-------------------------------------------------------------------------------------------------
994 MS_BOOL MApi_XC_DLC_GetLumaCurveStatus( void );
995 
996 //-------------------------------------------------------------------------------------------------
997 /// DLC CGC reset C gain
998 /// @ingroup DLC_FEATURE
999 //-------------------------------------------------------------------------------------------------
1000 void    MApi_XC_DLC_CGC_ResetCGain(void);
1001 
1002 //-------------------------------------------------------------------------------------------------
1003 /// DLC CGC check C gain in PQCom
1004 /// @ingroup DLC_FEATURE
1005 //-------------------------------------------------------------------------------------------------
1006 void    MApi_XC_DLC_CGC_CheckCGainInPQCom(void);
1007 
1008 //-------------------------------------------------------------------------------------------------
1009 /// DLC CGC reset Y gain
1010 /// @ingroup DLC_FEATURE
1011 //-------------------------------------------------------------------------------------------------
1012 void    MApi_XC_DLC_CGC_ResetYGain(void);
1013 
1014 //-------------------------------------------------------------------------------------------------
1015 /// DLC CGC reset Y gain in PQCom
1016 /// @ingroup DLC_FEATURE
1017 //-------------------------------------------------------------------------------------------------
1018 void    MApi_XC_DLC_CGC_CheckYGainInPQCom(void);
1019 
1020 //-------------------------------------------------------------------------------------------------
1021 /// DLC CGC reset
1022 /// @ingroup DLC_FEATURE
1023 //-------------------------------------------------------------------------------------------------
1024 void    MApi_XC_DLC_CGC_Reset(void);
1025 
1026 //-------------------------------------------------------------------------------------------------
1027 /// DLC CGC initilization
1028 /// @ingroup DLC_INIT
1029 //-------------------------------------------------------------------------------------------------
1030 void    MApi_XC_DLC_CGC_Init(void);
1031 
1032 //-------------------------------------------------------------------------------------------------
1033 /// DLC CGC Re-initilization
1034 /// @ingroup DLC_INIT
1035 //-------------------------------------------------------------------------------------------------
1036 void    MApi_XC_DLC_CGC_ReInit(void);
1037 
1038 //-------------------------------------------------------------------------------------------------
1039 /// DLC CGC handler
1040 /// @ingroup DLC_FEATURE
1041 //-------------------------------------------------------------------------------------------------
1042 void    MApi_XC_DLC_CGC_Handler(void);
1043 
1044 //-------------------------------------------------------------------------------------------------
1045 /// Get version (without Mutex protect)
1046 /// @ingroup DLC_INFO
1047 // @param ppVersion               \b IN: TBD
1048 /// @return @ref E_XC_DLC_RESULT
1049 //-------------------------------------------------------------------------------------------------
1050 E_XC_DLC_RESULT MApi_XC_DLC_GetLibVer(const MSIF_Version **ppVersion) ;
1051 
1052 //-------------------------------------------------------------------------------------------------
1053 /// DLC get information
1054 /// @ingroup DLC_INFO
1055 /// @return XC_DLC_ApiInfo
1056 //-------------------------------------------------------------------------------------------------
1057 const XC_DLC_ApiInfo * MApi_XC_DLC_GetInfo(void);                                      ///< Get info from driver (without Mutex protect)
1058 
1059 //-------------------------------------------------------------------------------------------------
1060 /// Get DLC current status
1061 /// @ingroup DLC_INFO
1062 // @param pDrvStatus               \b IN: TBD
1063 // @param bWindow                  \b IN: TBD
1064 /// @return @ref MS_BOOL
1065 //-------------------------------------------------------------------------------------------------
1066 MS_BOOL MApi_XC_DLC_GetStatus_Ex(XC_DLC_ApiStatus *pDrvStatus, MS_BOOL bWindow);       ///< Get panel current status
1067 
1068 //-------------------------------------------------------------------------------------------------
1069 /// DLC get Dbg level
1070 /// @ingroup DLC_INFO
1071 /// @param u16DbgSwitch               \b IN: Set debug level
1072 /// @return @ref MS_BOOL
1073 //-------------------------------------------------------------------------------------------------
1074 MS_BOOL MApi_XC_DLC_SetDbgLevel(MS_U16 u16DbgSwitch);                                  ///< Set debug level (without Mutex protect), refer to XC_DBGLEVEL_OFF
1075 
1076 //-------------------------------------------------------------------------------------------------
1077 /// Write DLC curve
1078 /// @ingroup DLC_FEATURE
1079 /// @param pu8Table                     \b IN: the value of curve
1080 // @return @ref MS_BOOL
1081 //-------------------------------------------------------------------------------------------------
1082 MS_BOOL MApi_XC_DLC_WriteCurve(MS_U8 *pu8Table);
1083 
1084 //-------------------------------------------------------------------------------------------------
1085 /// Write DLC curve
1086 /// @ingroup DLC_FEATURE
1087 /// @param pu8Table                     \b IN: the value of curve
1088 // @return @ref MS_BOOL
1089 //-------------------------------------------------------------------------------------------------
1090 MS_BOOL MApi_XC_DLC_WriteCurve_Sub(MS_U8 *pu8Table);
1091 
1092 //-------------------------------------------------------------------------------------------------
1093 /// get histogram data
1094 /// @ingroup DLC_INFO
1095 /// @param pu16Histogram                \b OUT: the value of histogram
1096 /// @param u8section_num                \b IN: the number of histogram section
1097 // @return @ref MS_BOOL
1098 //-------------------------------------------------------------------------------------------------
1099 MS_BOOL MApi_XC_DLC_GetHistogram(MS_U16 *pu16Histogram, E_XC_DLC_HISTOGRAM_TYPE enHistogramType);
1100 
1101 /******************************************************************************/
1102 /// API DLC DBC library start
1103 /******************************************************************************/
1104 typedef void   (*MApi_XC_DLC_Print_Callback)(MS_U8 /*PWM_VALUE*/);
1105 
1106 typedef struct DLL_PACKED  {
1107     MS_U8 *pCmdBuff;                           ///<1. command buffer from UART
1108     MS_U16 u16PNL_Width;                       ///<2. Panel Widht
1109     MS_U16 u16PNL_Height;                      ///<3. Panel Height
1110     MApi_XC_DLC_Print_Callback fnDLC_Putchar;  ///<4. User putchar function
1111 }tDLC_CONTROL_PARAMS;
1112 
1113 //-------------------------------------------------------------------------------------------------
1114 /// brief uart debug command decoder for Dynamic Luminance Control.
1115 /// @ingroup DLC_FEATURE
1116 /// @param params   passin params
1117 //-------------------------------------------------------------------------------------------------
1118 void MApi_XC_DLC_DecodeExtCmd(tDLC_CONTROL_PARAMS *params);
1119 
1120 //-------------------------------------------------------------------------------------------------
1121 /// Setup DLC capture range
1122 /// @ingroup DLC_FEATURE
1123 /// @param StuDlc_Range                     \b IN: Hstart, Hend, Vstart, Vend
1124 //-------------------------------------------------------------------------------------------------
1125 void MApi_XC_DLC_SetCaptureRange(XC_DLC_CAPTURE_Range *pu16_Range);
1126 
1127 //-------------------------------------------------------------------------------------------------
1128 /// Dlc power state control for fastboot
1129 /// @ingroup DLC_FEATURE
1130 /// @param  u16PowerState                 \b IN: power state
1131 // @return @ref MS_U32                      \b return result of power state control.
1132 //-------------------------------------------------------------------------------------------------
1133 MS_U32 MApi_XC_DLC_SetPowerState(EN_POWER_MODE enPowerState);
1134 
1135 /******************************************************************************/
1136 /// API DLC DBC library end
1137 /******************************************************************************/
1138 
1139 
1140 //================================ Obsolete Function Start =======================================
1141 //-------------------------------------------------------------------------------------------------
1142 /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  Alert !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1143 /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  Alert !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1144 /// !!! below function will be "REMOVED" or "REFACTORING" later, please do not use it !!!!!!!!!
1145 //-------------------------------------------------------------------------------------------------
1146 
1147 //-------------------------------------------------------------------------------------------------
1148 /// @ingroup DLC_ToBeRemove
1149 //-------------------------------------------------------------------------------------------------
1150 
1151 void MApi_XC_DLC_SetSetting(XC_DLC_MFinit DLC_MFinit ); // Setting DLC
1152 //-------------------------------------------------------------------------------------------------
1153 /// @ingroup DLC_ToBeRemove
1154 //-------------------------------------------------------------------------------------------------
1155 MS_BOOL MApi_XC_DLC_Init(XC_DLC_init *pstXC_DLC_InitData, MS_U32 u32InitDataLen); // DLC initiation
1156 
1157 //-------------------------------------------------------------------------------------------------
1158 /// @ingroup DLC_ToBeRemove
1159 //-------------------------------------------------------------------------------------------------
1160 MS_BOOL MApi_XC_DLC_GetStatus(XC_DLC_ApiStatus *pDrvStatus, MS_BOOL bWindow);  // Get DLC current status
1161 
1162 //================================ Obsolete Function End =======================================
1163 #ifdef UFO_XC_HDR
1164 #if (UFO_XC_HDR_VERSION == 2)
1165 MS_BOOL SYMBOL_WEAK MApi_XC_DLC_SetTMOInfo(ST_XC_DLC_TMO_INFO *pstDLCTmoInfo);
1166 #endif
1167 #endif
1168 #ifdef __cplusplus
1169 }
1170 #endif
1171 
1172 #endif // _API_XC_DLC_H_
1173 
1174 
1175