File Index
Files and directories
Sign in
FILE

mdp_format.h

File preview with syntax highlighting.

linux-6.19.14/drivers/gpu/drm/msm/disp/mdp_format.h C
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 4 * Copyright (C) 2013 Red Hat
 5 * Author: Rob Clark <robdclark@gmail.com>
 6 */
 7
 8#ifndef __MSM_FORMAT_H__
 9#define __MSM_FORMAT_H__
10
11#include "mdp_common.xml.h"
12
13enum msm_format_flags {
14	MSM_FORMAT_FLAG_YUV_BIT,
15	MSM_FORMAT_FLAG_DX_BIT,
16	MSM_FORMAT_FLAG_COMPRESSED_BIT,
17	MSM_FORMAT_FLAG_UNPACK_TIGHT_BIT,
18	MSM_FORMAT_FLAG_UNPACK_ALIGN_MSB_BIT,
19};
20
21#define MSM_FORMAT_FLAG_YUV		BIT(MSM_FORMAT_FLAG_YUV_BIT)
22#define MSM_FORMAT_FLAG_DX		BIT(MSM_FORMAT_FLAG_DX_BIT)
23#define MSM_FORMAT_FLAG_COMPRESSED	BIT(MSM_FORMAT_FLAG_COMPRESSED_BIT)
24#define MSM_FORMAT_FLAG_UNPACK_TIGHT	BIT(MSM_FORMAT_FLAG_UNPACK_TIGHT_BIT)
25#define MSM_FORMAT_FLAG_UNPACK_ALIGN_MSB BIT(MSM_FORMAT_FLAG_UNPACK_ALIGN_MSB_BIT)
26
27/*
28 * DPU HW,Component order color map
29 */
30enum {
31	C0_G_Y = 0,
32	C1_B_Cb = 1,
33	C2_R_Cr = 2,
34	C3_ALPHA = 3
35};
36
37/**
38 * struct msm_format: defines the format configuration
39 * @pixel_format: format fourcc
40 * @bpc_g_y: element bit widths: BPC for G or Y
41 * @bpc_b_cb: element bit widths: BPC for B or Cb
42 * @bpc_r_cr: element bit widths: BPC for R or Cr
43 * @bpc_a: element bit widths: BPC for the alpha channel
44 * @element: element color ordering
45 * @fetch_type: how the color components are packed in pixel format
46 * @chroma_sample: chroma sub-samplng type
47 * @alpha_enable: whether the format has an alpha channel
48 * @unpack_count: number of the components to unpack
49 * @bpp: bytes per pixel
50 * @flags: usage bit flags
51 * @num_planes: number of planes (including meta data planes)
52 * @fetch_mode: linear, tiled, or ubwc hw fetch behavior
53 * @tile_height: format tile height
54 */
55struct msm_format {
56	uint32_t pixel_format;
57	enum mdp_bpc bpc_g_y, bpc_b_cb, bpc_r_cr;
58	enum mdp_bpc_alpha bpc_a;
59	u8 element[4];
60	enum mdp_fetch_type fetch_type;
61	enum mdp_chroma_samp_type chroma_sample;
62	bool alpha_enable;
63	u8 unpack_count;
64	u8 bpp;
65	unsigned long flags;
66	u8 num_planes;
67	enum mdp_fetch_mode fetch_mode;
68	u16 tile_height;
69};
70
71#define MSM_FORMAT_IS_YUV(X)		((X)->flags & MSM_FORMAT_FLAG_YUV)
72#define MSM_FORMAT_IS_DX(X)		((X)->flags & MSM_FORMAT_FLAG_DX)
73#define MSM_FORMAT_IS_LINEAR(X)		((X)->fetch_mode == MDP_FETCH_LINEAR)
74#define MSM_FORMAT_IS_TILE(X) \
75	(((X)->fetch_mode == MDP_FETCH_UBWC) && \
76	 !((X)->flags & MSM_FORMAT_FLAG_COMPRESSED))
77#define MSM_FORMAT_IS_UBWC(X) \
78	(((X)->fetch_mode == MDP_FETCH_UBWC) && \
79	 ((X)->flags & MSM_FORMAT_FLAG_COMPRESSED))
80
81#endif
~/ Read-only file preview.