Skip to contentSkip to conversation

drm/plane-helper: Fix primary plane scaling check

PATCH In review Matt Roper 2 participants 2 messages Apr 10, 2014 – Apr 11, 2014

Subsystems (2)
lore
Share & tools
lore

Matt Roper

author
#0 lore raw

PATCH 1/1 drm/plane-helper: Fix primary plane scaling check

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.

---
 drivers/gpu/drm/drm_plane_helper.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_plane_helper.c +2 -0
index e768d35..9eca283 100644
@@ -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;
Signature · 1 line
1.8.5.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Matt Roper

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.

Quoted 24 lines
---
 drivers/gpu/drm/drm_plane_helper.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_plane_helper.c +2 -0
index e768d35..9eca283 100644
@@ -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;
Signature · 6 lines
1.8.5.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch