summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-11-02 16:51:06 +0300
committerRob Clark <robdclark@gmail.com>2016-11-26 23:45:17 +0300
commit394da4b8f37e6ceceed68821957de5fc9e22b69b (patch)
treeb1cb7a61c689658fb5cad379b86ec88d6e926e8e /drivers
parent7ed216e53cb98683636d745dacf0406af7629100 (diff)
downloadlinux-394da4b8f37e6ceceed68821957de5fc9e22b69b.tar.xz
drm/msm/mdp5: clip img size to src size
If fb dimensions are larger than what can be scanned out, but the src dimensions are not, the hw can still handle this. So clip. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
index 81c0562ab489..ba4ebfad69da 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
@@ -771,8 +771,8 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
spin_lock_irqsave(&mdp5_plane->pipe_lock, flags);
mdp5_write(mdp5_kms, REG_MDP5_PIPE_SRC_IMG_SIZE(pipe),
- MDP5_PIPE_SRC_IMG_SIZE_WIDTH(fb->width) |
- MDP5_PIPE_SRC_IMG_SIZE_HEIGHT(fb->height));
+ MDP5_PIPE_SRC_IMG_SIZE_WIDTH(min(fb->width, src_w)) |
+ MDP5_PIPE_SRC_IMG_SIZE_HEIGHT(min(fb->height, src_h)));
mdp5_write(mdp5_kms, REG_MDP5_PIPE_SRC_SIZE(pipe),
MDP5_PIPE_SRC_SIZE_WIDTH(src_w) |