drm/plane-helper: Fix primary plane scaling check
authorMatt Roper <matthew.d.roper@intel.com>
Thu, 10 Apr 2014 21:18:06 +0000 (14:18 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 22 Apr 2014 09:19:08 +0000 (11:19 +0200)
The src_w / src_h parameters to update_plane include a subpixel offset;
we need to shift off the subpixel bits before comparing to CRTC size
when checking for primary plane scaling.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_plane_helper.c

index d2b1c03b3d7113f03027199107732d76acdf58ea..f48566445c318d0915c06c908875229b1592eae5 100644 (file)
@@ -145,6 +145,8 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
        }
 
        /* Disallow scaling */
+       src_w >>= 16;
+       src_h >>= 16;
        if (crtc_w != src_w || crtc_h != src_h) {
                DRM_DEBUG_KMS("Can't scale primary plane\n");
                return -EINVAL;