mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 02:16:11 +07:00
cab4c03b4b
"Allwinner V3s" has secondary video layer (VI).
Decoded video is displayed in wrong colors until
secondary CSC registers are programmed correctly.
Fixes: 8830293905
("drm/sun4i: Add DE2 CSC library")
Signed-off-by: Martin Cerveny <m.cerveny@computer.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200906162140.5584-2-m.cerveny@computer.org
37 lines
878 B
C
37 lines
878 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) Jernej Skrabec <jernej.skrabec@siol.net>
|
|
*/
|
|
|
|
#ifndef _SUN8I_CSC_H_
|
|
#define _SUN8I_CSC_H_
|
|
|
|
#include <drm/drm_color_mgmt.h>
|
|
|
|
struct sun8i_mixer;
|
|
|
|
/* VI channel CSC units offsets */
|
|
#define CCSC00_OFFSET 0xAA050
|
|
#define CCSC01_OFFSET 0xFA050
|
|
#define CCSC10_OFFSET 0xA0000
|
|
#define CCSC11_OFFSET 0xF0000
|
|
|
|
#define SUN8I_CSC_CTRL(base) (base + 0x0)
|
|
#define SUN8I_CSC_COEFF(base, i) (base + 0x10 + 4 * i)
|
|
|
|
#define SUN8I_CSC_CTRL_EN BIT(0)
|
|
|
|
enum sun8i_csc_mode {
|
|
SUN8I_CSC_MODE_OFF,
|
|
SUN8I_CSC_MODE_YUV2RGB,
|
|
SUN8I_CSC_MODE_YVU2RGB,
|
|
};
|
|
|
|
void sun8i_csc_set_ccsc_coefficients(struct sun8i_mixer *mixer, int layer,
|
|
enum sun8i_csc_mode mode,
|
|
enum drm_color_encoding encoding,
|
|
enum drm_color_range range);
|
|
void sun8i_csc_enable_ccsc(struct sun8i_mixer *mixer, int layer, bool enable);
|
|
|
|
#endif
|