OSDN Git Service

DO NOT MERGE: rename module to gralloc.intel
[android-x86/external-minigbm.git] / i915_private.h
1 /*
2  * Copyright 2017 The Chromium OS Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 #ifdef DRV_I915
8
9 #include <stdint.h>
10
11 #include "i915_private_types.h"
12
13 struct driver;
14
15 /*
16  * 2 plane YCbCr MSB aligned
17  * index 0 = Y plane, [15:0] Y:x [10:6] little endian
18  * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian
19  */
20 #define DRM_FORMAT_P010         fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
21
22 /*
23  * 2 plane YCbCr MSB aligned
24  * index 0 = Y plane, [15:0] Y:x [12:4] little endian
25  * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian
26  */
27 #define DRM_FORMAT_P012         fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */
28
29 /*
30  * 2 plane YCbCr MSB aligned
31  * index 0 = Y plane, [15:0] Y little endian
32  * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian
33  */
34 #define DRM_FORMAT_P016         fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
35
36 /* 64 bpp RGB */
37 #define DRM_FORMAT_XRGB161616  fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */
38 #define DRM_FORMAT_XBGR161616  fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */
39
40 int i915_private_init(struct driver *drv, uint64_t *cursor_width, uint64_t *cursor_height);
41
42 int i915_private_add_combinations(struct driver *drv);
43
44 void i915_private_align_dimensions(uint32_t format, uint32_t *vertical_alignment);
45
46 uint32_t i915_private_bpp_from_format(uint32_t format, size_t plane);
47
48 void i915_private_vertical_subsampling_from_format(uint32_t *vertical_subsampling, uint32_t format,
49                                                    size_t plane);
50
51 size_t i915_private_num_planes_from_format(uint32_t format);
52
53 uint32_t i915_private_resolve_format(uint32_t format, uint64_t usage, uint32_t *resolved_format);
54
55 #endif