1 /*
2  * Copyright 2019-2020 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef _DISPLAY_SUPPORT_H_
9 #define _DISPLAY_SUPPORT_H_
10 
11 #include "fsl_dc_fb.h"
12 
13 /*******************************************************************************
14  * Definitions
15  ******************************************************************************/
16 #define DEMO_PANEL_RK055AHD091 0
17 #define DEMO_PANEL_RK055IQH091 1
18 
19 #define DEMO_DISPLAY_CONTROLLER_ELCDIF  0
20 #define DEMO_DISPLAY_CONTROLLER_LCDIFV2 1
21 
22 #ifndef DEMO_PANEL
23 #define DEMO_PANEL DEMO_PANEL_RK055AHD091
24 #endif
25 
26 #ifndef DEMO_DISPLAY_CONTROLLER
27 /* Use LCDIFV2 by default, could use ELCDIF by changing this macro. */
28 #define DEMO_DISPLAY_CONTROLLER DEMO_DISPLAY_CONTROLLER_LCDIFV2
29 #endif
30 
31 #define DEMO_BUFFER_FIXED_ADDRESS 0
32 
33 #if DEMO_BUFFER_FIXED_ADDRESS
34 #define DEMO_BUFFER0_ADDR 0x80000000
35 #define DEMO_BUFFER1_ADDR 0x80200000
36 #endif
37 
38 /*
39  * Use the MIPI dumb panel
40  */
41 
42 /* Definitions for the frame buffer. */
43 #define DEMO_BUFFER_COUNT 2 /* 2 is enough for DPI interface display. */
44 
45 #define DEMO_BUFFER_PIXEL_FORMAT   kVIDEO_PixelFormatRGB565
46 #define DEMO_BUFFER_BYTE_PER_PIXEL 2
47 
48 #if (DEMO_PANEL_RK055AHD091 == DEMO_PANEL)
49 
50 #define DEMO_PANEL_WIDTH  (720)
51 #define DEMO_PANEL_HEIGHT (1280)
52 
53 #elif (DEMO_PANEL_RK055IQH091 == DEMO_PANEL)
54 
55 #define DEMO_PANEL_WIDTH  (540)
56 #define DEMO_PANEL_HEIGHT (960)
57 
58 #endif
59 
60 #define DEMO_BUFFER_WIDTH  DEMO_PANEL_WIDTH
61 #define DEMO_BUFFER_HEIGHT DEMO_PANEL_HEIGHT
62 
63 /* Where the frame buffer is shown in the screen. */
64 #define DEMO_BUFFER_START_X 0U
65 #define DEMO_BUFFER_START_Y 0U
66 
67 #define DEMO_BUFFER_STRIDE_BYTE (DEMO_BUFFER_WIDTH * DEMO_BUFFER_BYTE_PER_PIXEL)
68 /* There is not frame buffer aligned requirement, consider the 64-bit AXI data
69  * bus width and 32-byte cache line size, the frame buffer alignment is set to
70  * 32 byte.
71  */
72 #define FRAME_BUFFER_ALIGN 32
73 
74 extern const dc_fb_t g_dc;
75 
76 /*******************************************************************************
77  * API
78  ******************************************************************************/
79 #if defined(__cplusplus)
80 extern "C" {
81 #endif /* __cplusplus */
82 
83 status_t BOARD_PrepareDisplayController(void);
84 
85 #if defined(__cplusplus)
86 }
87 #endif /* __cplusplus */
88 
89 #endif /* _DISPLAY_SUPPORT_H_ */
90