summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_mixer.c
diff options
context:
space:
mode:
authorMarek Szyprowski2015-11-30 14:53:27 +0100
committerInki Dae2015-12-13 14:22:58 +0100
commite463b0695a0d52e280c8c42668b9c118c6d06d82 (patch)
treec9e35b5d6ec2879ca1e78a6f1b365dff493fb2a2 /drivers/gpu/drm/exynos/exynos_mixer.c
parentdrm/exynos: add generic check for plane state (diff)
downloadkernel-qcow2-linux-e463b0695a0d52e280c8c42668b9c118c6d06d82.tar.gz
kernel-qcow2-linux-e463b0695a0d52e280c8c42668b9c118c6d06d82.tar.xz
kernel-qcow2-linux-e463b0695a0d52e280c8c42668b9c118c6d06d82.zip
drm/exynos: mixer: use ratio precalculated in exynos_state
Common plane code already calculates and checks for supported scalling modes, so additional code in mixer driver can be now removed. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_mixer.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 4190285798ef..dfb35e2da4db 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -528,33 +528,6 @@ static void mixer_layer_update(struct mixer_context *ctx)
mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE);
}
-static int mixer_setup_scale(const struct exynos_drm_plane *plane,
- unsigned int *x_ratio, unsigned int *y_ratio)
-{
- struct exynos_drm_plane_state *state =
- to_exynos_plane_state(plane->base.state);
-
- if (state->crtc.w != state->src.w) {
- if (state->crtc.w == 2 * state->src.w)
- *x_ratio = 1;
- else
- goto fail;
- }
-
- if (state->crtc.h != state->src.h) {
- if (state->crtc.h == 2 * state->src.h)
- *y_ratio = 1;
- else
- goto fail;
- }
-
- return 0;
-
-fail:
- DRM_DEBUG_KMS("only 2x width/height scaling of plane supported\n");
- return -ENOTSUPP;
-}
-
static void mixer_graph_buffer(struct mixer_context *ctx,
struct exynos_drm_plane *plane)
{
@@ -594,9 +567,9 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
return;
}
- /* check if mixer supports requested scaling setup */
- if (mixer_setup_scale(plane, &x_ratio, &y_ratio))
- return;
+ /* ratio is already checked by common plane code */
+ x_ratio = state->h_ratio == (1 << 15);
+ y_ratio = state->v_ratio == (1 << 15);
dst_x_offset = state->crtc.x;
dst_y_offset = state->crtc.y;