aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/arm/malidp_crtc.c
diff options
context:
space:
mode:
authorMihail Atanassov <mihail.atanassov@arm.com>2017-02-06 12:20:56 +0000
committerLiviu Dudau <Liviu.Dudau@arm.com>2017-04-24 13:28:08 +0100
commit0274e6a0ba9a4994a449fcd3483ef530027e152f (patch)
treedde8a491de30aae9a9b98c26275a5610f72979aa /drivers/gpu/drm/arm/malidp_crtc.c
parentdrm: mali-dp: Add plane upscaling support (diff)
downloadlinux-dev-0274e6a0ba9a4994a449fcd3483ef530027e152f.tar.xz
linux-dev-0274e6a0ba9a4994a449fcd3483ef530027e152f.zip
drm: mali-dp: Enable image enhancement when scaling
Apply image enhacement when we are upscaling by a factor of 2 or more in either direction. Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm/malidp_crtc.c')
-rw-r--r--drivers/gpu/drm/arm/malidp_crtc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c
index ceee2a77bfb4..b0f0365efd23 100644
--- a/drivers/gpu/drm/arm/malidp_crtc.c
+++ b/drivers/gpu/drm/arm/malidp_crtc.c
@@ -288,6 +288,9 @@ static int malidp_crtc_atomic_check_scaling(struct drm_crtc *crtc,
if (!(h_upscale_factor >> 16) || !(v_upscale_factor >> 16))
return -EINVAL;
+ s->enhancer_enable = ((h_upscale_factor >> 16) >= 2 ||
+ (v_upscale_factor >> 16) >= 2);
+
s->input_w = pstate->src_w >> 16;
s->input_h = pstate->src_h >> 16;
s->output_w = pstate->crtc_w;
@@ -530,9 +533,11 @@ int malidp_crtc_init(struct drm_device *drm)
drm_crtc_helper_add(&malidp->crtc, &malidp_crtc_helper_funcs);
drm_mode_crtc_set_gamma_size(&malidp->crtc, MALIDP_GAMMA_LUT_SIZE);
- /* No inverse-gamma: it is per-plane */
+ /* No inverse-gamma: it is per-plane. */
drm_crtc_enable_color_mgmt(&malidp->crtc, 0, true, MALIDP_GAMMA_LUT_SIZE);
+ malidp_se_set_enh_coeffs(malidp->dev);
+
return 0;
crtc_cleanup_planes: