1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef __MTKFB_INFO_H__ 17 #define __MTKFB_INFO_H__ 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 24 typedef enum { 25 DISPIF_TYPE_DBI = 0, 26 DISPIF_TYPE_DPI, 27 DISPIF_TYPE_DSI, 28 DISPIF_TYPE_DPI0, 29 DISPIF_TYPE_DPI1, 30 DISPIF_TYPE_DSI0, 31 DISPIF_TYPE_DSI1, 32 HDMI = 7, 33 HDMI_SMARTBOOK, 34 MHL, 35 DISPIF_TYPE_EPD, 36 SLIMPORT 37 } MTKFB_DISPIF_TYPE; 38 39 typedef enum { 40 MTKFB_DISPIF_PRIMARY_LCD = 0, 41 MTKFB_DISPIF_HDMI, 42 MTKFB_DISPIF_EPD, 43 MTKFB_MAX_DISPLAY_COUNT 44 } MTKFB_DISPIF_DEVICE_TYPE; 45 46 typedef enum { 47 DISPIF_FORMAT_RGB565 = 0, 48 DISPIF_FORMAT_RGB666, 49 DISPIF_FORMAT_RGB888 50 } MTKFB_DISPIF_FORMAT; 51 52 53 typedef enum { 54 DISPIF_MODE_VIDEO = 0, 55 DISPIF_MODE_COMMAND 56 } MTKFB_DISPIF_MODE; 57 58 typedef struct mtk_dispif_info { 59 unsigned int display_id; 60 unsigned int isHwVsyncAvailable; 61 MTKFB_DISPIF_TYPE displayType; 62 unsigned int displayWidth; 63 unsigned int displayHeight; 64 unsigned int displayFormat; 65 MTKFB_DISPIF_MODE displayMode; 66 unsigned int vsyncFPS; 67 unsigned int physicalWidth; 68 unsigned int physicalHeight; 69 unsigned int isConnected; 70 /* this value is for DFO Multi-Resolution feature, which stores the original LCM Wdith */ 71 unsigned int lcmOriginalWidth; 72 /* this value is for DFO Multi-Resolution feature, which stores the original LCM Height */ 73 unsigned int lcmOriginalHeight; 74 } mtk_dispif_info_t; 75 76 #define MAKE_MTK_FB_FORMAT_ID(id, bpp) (((id) << 8) | (bpp)) 77 78 typedef enum { 79 MTK_FB_FORMAT_UNKNOWN = 0, 80 81 MTK_FB_FORMAT_RGB565 = MAKE_MTK_FB_FORMAT_ID(1, 2), 82 MTK_FB_FORMAT_RGB888 = MAKE_MTK_FB_FORMAT_ID(2, 3), 83 MTK_FB_FORMAT_BGR888 = MAKE_MTK_FB_FORMAT_ID(3, 3), 84 MTK_FB_FORMAT_ARGB8888 = MAKE_MTK_FB_FORMAT_ID(4, 4), 85 MTK_FB_FORMAT_ABGR8888 = MAKE_MTK_FB_FORMAT_ID(5, 4), 86 MTK_FB_FORMAT_YUV422 = MAKE_MTK_FB_FORMAT_ID(6, 2), 87 MTK_FB_FORMAT_XRGB8888 = MAKE_MTK_FB_FORMAT_ID(7, 4), 88 MTK_FB_FORMAT_XBGR8888 = MAKE_MTK_FB_FORMAT_ID(8, 4), 89 MTK_FB_FORMAT_UYVY = MAKE_MTK_FB_FORMAT_ID(9, 2), 90 MTK_FB_FORMAT_YUV420_P = MAKE_MTK_FB_FORMAT_ID(10, 2), 91 MTK_FB_FORMAT_YUY2 = MAKE_MTK_FB_FORMAT_ID(11, 2), 92 MTK_FB_FORMAT_BPP_MASK = 0xFF, 93 } MTK_FB_FORMAT; 94 95 #define GET_MTK_FB_FORMAT_BPP(f) ((f) & MTK_FB_FORMAT_BPP_MASK) 96 97 98 #ifdef __cplusplus 99 } 100 #endif 101 #endif /* __DISP_DRV_H__ */ 102