Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / sun4i / sun8i_csc.h
bloba55a38ad849c1304df484f0d234d182a79a8708a
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Copyright (C) Jernej Skrabec <jernej.skrabec@siol.net>
4 */
6 #ifndef _SUN8I_CSC_H_
7 #define _SUN8I_CSC_H_
9 #include <drm/drm_color_mgmt.h>
11 struct sun8i_mixer;
13 /* VI channel CSC units offsets */
14 #define CCSC00_OFFSET 0xAA050
15 #define CCSC01_OFFSET 0xFA050
16 #define CCSC10_OFFSET 0xA0000
17 #define CCSC11_OFFSET 0xF0000
19 #define SUN8I_CSC_CTRL(base) (base + 0x0)
20 #define SUN8I_CSC_COEFF(base, i) (base + 0x10 + 4 * i)
22 #define SUN8I_CSC_CTRL_EN BIT(0)
24 enum sun8i_csc_mode {
25 SUN8I_CSC_MODE_OFF,
26 SUN8I_CSC_MODE_YUV2RGB,
27 SUN8I_CSC_MODE_YVU2RGB,
30 void sun8i_csc_set_ccsc_coefficients(struct sun8i_mixer *mixer, int layer,
31 enum sun8i_csc_mode mode,
32 enum drm_color_encoding encoding,
33 enum drm_color_range range);
34 void sun8i_csc_enable_ccsc(struct sun8i_mixer *mixer, int layer, bool enable);
36 #endif