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.
11 #include "i915_private_types.h"
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
20 #define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
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
27 #define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */
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
34 #define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
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 */
40 int i915_private_init(struct driver *drv, uint64_t *cursor_width, uint64_t *cursor_height);
42 int i915_private_add_combinations(struct driver *drv);
44 void i915_private_align_dimensions(uint32_t format, uint32_t *vertical_alignment);
46 uint32_t i915_private_bpp_from_format(uint32_t format, size_t plane);
48 void i915_private_vertical_subsampling_from_format(uint32_t *vertical_subsampling, uint32_t format,
51 size_t i915_private_num_planes_from_format(uint32_t format);
53 uint32_t i915_private_resolve_format(uint32_t format, uint64_t usage, uint32_t *resolved_format);