Skip to content

Commit

Permalink
drm: mali-dp: Fix bug on scaling with rotation
Browse files Browse the repository at this point in the history
In the case, when the user wants to scale and rotate a layer by 90/270
degrees, the scaling engine input dimensions' parameters ie width and
height needs to be swapped with respect to the layer's input dimensions.
This means scaling engine input height should be set to layer's input
width and scaling engine input width should be set to
layer's input height.

Signed-off-by: Ayan Halder <ayan.halder@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
  • Loading branch information
Ayan Halder authored and Liviu Dudau committed Mar 14, 2018
1 parent e0521c0 commit 6cc3a50
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/gpu/drm/arm/malidp_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,14 @@ static int malidp_crtc_atomic_check_scaling(struct drm_crtc *crtc,
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;
if (pstate->rotation & MALIDP_ROTATED_MASK) {
s->input_w = pstate->src_h >> 16;
s->input_h = pstate->src_w >> 16;
} else {
s->input_w = pstate->src_w >> 16;
s->input_h = pstate->src_h >> 16;
}

s->output_w = pstate->crtc_w;
s->output_h = pstate->crtc_h;

Expand Down

0 comments on commit 6cc3a50

Please sign in to comment.