.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * |
---|
3 | 4 | * (C) COPYRIGHT 2013-2016 ARM Limited. All rights reserved. |
---|
4 | | - * |
---|
5 | | - * This program is free software and is provided to you under the terms of the |
---|
6 | | - * GNU General Public License version 2 as published by the Free Software |
---|
7 | | - * Foundation, and any use by you of this program is subject to the terms |
---|
8 | | - * of such GNU licence. |
---|
9 | 5 | * |
---|
10 | 6 | * ARM Mali DP hardware manipulation routines. |
---|
11 | 7 | */ |
---|
.. | .. |
---|
36 | 32 | SE_MEMWRITE = BIT(5), |
---|
37 | 33 | }; |
---|
38 | 34 | |
---|
| 35 | +enum rotation_features { |
---|
| 36 | + ROTATE_NONE, /* does not support rotation at all */ |
---|
| 37 | + ROTATE_ANY, /* supports rotation on any buffers */ |
---|
| 38 | + ROTATE_COMPRESSED, /* supports rotation only on compressed buffers */ |
---|
| 39 | +}; |
---|
| 40 | + |
---|
39 | 41 | struct malidp_format_id { |
---|
40 | 42 | u32 format; /* DRM fourcc */ |
---|
41 | 43 | u8 layer; /* bitmask of layers supporting it */ |
---|
.. | .. |
---|
62 | 64 | u16 ptr; /* address offset for the pointer register */ |
---|
63 | 65 | u16 stride_offset; /* offset to the first stride register. */ |
---|
64 | 66 | s16 yuv2rgb_offset; /* offset to the YUV->RGB matrix entries */ |
---|
| 67 | + u16 mmu_ctrl_offset; /* offset to the MMU control register */ |
---|
| 68 | + enum rotation_features rot; /* type of rotation supported */ |
---|
| 69 | + /* address offset for the AFBC decoder registers */ |
---|
| 70 | + u16 afbc_decoder_offset; |
---|
65 | 71 | }; |
---|
66 | 72 | |
---|
67 | 73 | enum malidp_scaling_coeff_set { |
---|
.. | .. |
---|
85 | 91 | }; |
---|
86 | 92 | |
---|
87 | 93 | /* regmap features */ |
---|
88 | | -#define MALIDP_REGMAP_HAS_CLEARIRQ (1 << 0) |
---|
| 94 | +#define MALIDP_REGMAP_HAS_CLEARIRQ BIT(0) |
---|
| 95 | +#define MALIDP_DEVICE_AFBC_SUPPORT_SPLIT BIT(1) |
---|
| 96 | +#define MALIDP_DEVICE_AFBC_YUV_420_10_SUPPORT_SPLIT BIT(2) |
---|
| 97 | +#define MALIDP_DEVICE_AFBC_YUYV_USE_422_P2 BIT(3) |
---|
89 | 98 | |
---|
90 | 99 | struct malidp_hw_regmap { |
---|
91 | 100 | /* address offset of the DE register bank */ |
---|
.. | .. |
---|
171 | 180 | * Calculate the required rotation memory given the active area |
---|
172 | 181 | * and the buffer format. |
---|
173 | 182 | */ |
---|
174 | | - int (*rotmem_required)(struct malidp_hw_device *hwdev, u16 w, u16 h, u32 fmt); |
---|
| 183 | + int (*rotmem_required)(struct malidp_hw_device *hwdev, u16 w, u16 h, |
---|
| 184 | + u32 fmt, bool has_modifier); |
---|
175 | 185 | |
---|
176 | 186 | int (*se_set_scaling_coeffs)(struct malidp_hw_device *hwdev, |
---|
177 | 187 | struct malidp_se_config *se_config, |
---|
.. | .. |
---|
241 | 251 | |
---|
242 | 252 | /* size of memory used for rotating layers, up to two banks available */ |
---|
243 | 253 | u32 rotation_memory[2]; |
---|
| 254 | + |
---|
| 255 | + /* priority level of RQOS register used for driven the ARQOS signal */ |
---|
| 256 | + u32 arqos_value; |
---|
244 | 257 | }; |
---|
245 | 258 | |
---|
246 | 259 | static inline u32 malidp_hw_read(struct malidp_hw_device *hwdev, u32 reg) |
---|
.. | .. |
---|
311 | 324 | void malidp_se_irq_fini(struct malidp_hw_device *hwdev); |
---|
312 | 325 | |
---|
313 | 326 | u8 malidp_hw_get_format_id(const struct malidp_hw_regmap *map, |
---|
314 | | - u8 layer_id, u32 format); |
---|
| 327 | + u8 layer_id, u32 format, bool has_modifier); |
---|
| 328 | + |
---|
| 329 | +int malidp_format_get_bpp(u32 fmt); |
---|
315 | 330 | |
---|
316 | 331 | static inline u8 malidp_hw_get_pitch_align(struct malidp_hw_device *hwdev, bool rotated) |
---|
317 | 332 | { |
---|
.. | .. |
---|
380 | 395 | |
---|
381 | 396 | #define MALIDP_GAMMA_LUT_SIZE 4096 |
---|
382 | 397 | |
---|
| 398 | +#define AFBC_SIZE_MASK AFBC_FORMAT_MOD_BLOCK_SIZE_MASK |
---|
| 399 | +#define AFBC_SIZE_16X16 AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 |
---|
| 400 | +#define AFBC_YTR AFBC_FORMAT_MOD_YTR |
---|
| 401 | +#define AFBC_SPARSE AFBC_FORMAT_MOD_SPARSE |
---|
| 402 | +#define AFBC_CBR AFBC_FORMAT_MOD_CBR |
---|
| 403 | +#define AFBC_SPLIT AFBC_FORMAT_MOD_SPLIT |
---|
| 404 | +#define AFBC_TILED AFBC_FORMAT_MOD_TILED |
---|
| 405 | +#define AFBC_SC AFBC_FORMAT_MOD_SC |
---|
| 406 | + |
---|
| 407 | +#define AFBC_MOD_VALID_BITS (AFBC_SIZE_MASK | AFBC_YTR | AFBC_SPLIT | \ |
---|
| 408 | + AFBC_SPARSE | AFBC_CBR | AFBC_TILED | AFBC_SC) |
---|
| 409 | + |
---|
| 410 | +extern const u64 malidp_format_modifiers[]; |
---|
| 411 | + |
---|
383 | 412 | #endif /* __MALIDP_HW_H__ */ |
---|