diff options
author | Jernej Skrabec <jernej.skrabec@siol.net> | 2019-07-13 15:03:46 +0300 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-07-20 08:38:09 +0300 |
commit | b72cb0dc4c46fe75a52a9adb4a13ba1213e50000 (patch) | |
tree | 66ca73f53da7b226cc26dc2d2a7d80f594322fec /drivers/gpu/drm/sun4i/sun8i_vi_layer.c | |
parent | ab38c3b7c3472a6626aceb12fc2a23828152daf3 (diff) | |
download | linux-b72cb0dc4c46fe75a52a9adb4a13ba1213e50000.tar.xz |
drm/sun4i: sun8i-csc: Add support for color encoding and range
Conversion from YUV to RGB depends on range (limited or full) and
encoding (BT.601 or BT.709). Current code doesn't consider this and
always uses BT.601 encoding and limited range.
Fix this by introducing new CSC matrices, which are selected based on
range and encoding parameters.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190713120346.30349-4-jernej.skrabec@siol.net
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun8i_vi_layer.c')
-rw-r--r-- | drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index b227e33738f1..42d445d23773 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -231,7 +231,9 @@ static int sun8i_vi_layer_update_formats(struct sun8i_mixer *mixer, int channel, SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK, val); if (fmt_info->csc != SUN8I_CSC_MODE_OFF) { - sun8i_csc_set_ccsc_coefficients(mixer, channel, fmt_info->csc); + sun8i_csc_set_ccsc_coefficients(mixer, channel, fmt_info->csc, + state->color_encoding, + state->color_range); sun8i_csc_enable_ccsc(mixer, channel, true); } else { sun8i_csc_enable_ccsc(mixer, channel, false); |