• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021–2022 Beijing OSWare Technology Co., Ltd
3  * This file contains confidential and proprietary information of
4  * OSWare Technology Co., Ltd
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef DISPLAY_ADAPTER_INTERFACE_H
20 #define DISPLAY_ADAPTER_INTERFACE_H
21 #include <cstdint>
22 #include <sys/types.h>
23 #include "display_type.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 typedef struct {
30     IRect rect;
31     unsigned int stride;
32     unsigned long bufaddr;
33     int format;
34     int inFence;
35     int outFence;
36 } DisplayFrameInfo;
37 
38 typedef struct {
39     int32_t (*OpenDevice)(const char *path, int flags, mode_t mode);
40     int32_t (*CloseDevice)(int32_t devFd);
41     int32_t (*Ioctl)(int32_t devFd, uint32_t cmd, void *args);
42     int32_t (*FbGetDmaBuffer)(int32_t devFd);
43     int32_t (*FbFresh)(int32_t devFd, DisplayFrameInfo *frame);
44 } DisplayAdapterFuncs;
45 
46 int32_t DisplayAdapaterInitialize(DisplayAdapterFuncs **funcs);
47 int32_t DisplayAdapaterUninitialize(DisplayAdapterFuncs *funcs);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 #endif // FB_ADAPTER_INTERFACE_H