2 // Copyright (c) 2017 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef WSI_COMMONDRMUTILS_H_
18 #define WSI_COMMONDRMUTILS_H_
20 #include <drm_fourcc.h>
21 static size_t drm_bo_get_num_planes(uint32_t format) {
23 case DRM_FORMAT_ABGR1555:
24 case DRM_FORMAT_ABGR2101010:
25 case DRM_FORMAT_ABGR4444:
26 case DRM_FORMAT_ABGR8888:
27 case DRM_FORMAT_ARGB1555:
28 case DRM_FORMAT_ARGB2101010:
29 case DRM_FORMAT_ARGB4444:
30 case DRM_FORMAT_ARGB8888:
32 case DRM_FORMAT_BGR233:
33 case DRM_FORMAT_BGR565:
34 case DRM_FORMAT_BGR888:
35 case DRM_FORMAT_BGRA1010102:
36 case DRM_FORMAT_BGRA4444:
37 case DRM_FORMAT_BGRA5551:
38 case DRM_FORMAT_BGRA8888:
39 case DRM_FORMAT_BGRX1010102:
40 case DRM_FORMAT_BGRX4444:
41 case DRM_FORMAT_BGRX5551:
42 case DRM_FORMAT_BGRX8888:
47 case DRM_FORMAT_RGB332:
48 case DRM_FORMAT_RGB565:
49 case DRM_FORMAT_RGB888:
50 case DRM_FORMAT_RGBA1010102:
51 case DRM_FORMAT_RGBA4444:
52 case DRM_FORMAT_RGBA5551:
53 case DRM_FORMAT_RGBA8888:
54 case DRM_FORMAT_RGBX1010102:
55 case DRM_FORMAT_RGBX4444:
56 case DRM_FORMAT_RGBX5551:
57 case DRM_FORMAT_RGBX8888:
60 case DRM_FORMAT_XBGR1555:
61 case DRM_FORMAT_XBGR2101010:
62 case DRM_FORMAT_XBGR4444:
63 case DRM_FORMAT_XBGR8888:
64 case DRM_FORMAT_XRGB1555:
65 case DRM_FORMAT_XRGB2101010:
66 case DRM_FORMAT_XRGB4444:
67 case DRM_FORMAT_XRGB8888:
73 case DRM_FORMAT_YVU420:
77 fprintf(stderr, "DRM: UNKNOWN FORMAT %d\n", format);
81 #endif // WSI_COMMONDRMUTILS_H_