Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08a89018 authored by Liu Ying's avatar Liu Ying Committed by Philipp Zabel
Browse files

drm/imx: ipuv3 plane: Check different types of plane separately



The IPUv3 primary plane doesn't support partial off screen.
So, this patch separates plane check logics for primary plane and overlay
plane and adds more limitations on the primary plane.

Signed-off-by: default avatarLiu Ying <gnuiyl@gmail.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent 9253d059
Loading
Loading
Loading
Loading
+38 −29
Original line number Diff line number Diff line
@@ -199,6 +199,16 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,
	if (src_w != crtc_w || src_h != crtc_h)
		return -EINVAL;

	if (ipu_plane->base.type == DRM_PLANE_TYPE_PRIMARY) {
		/* full plane doesn't support partial off screen */
		if (crtc_x || crtc_y || crtc_w != mode->hdisplay ||
			crtc_h != mode->vdisplay)
			return -EINVAL;

		/* full plane minimum width is 13 pixels */
		if (crtc_w < 13)
			return -EINVAL;
	} else if (ipu_plane->base.type == DRM_PLANE_TYPE_OVERLAY) {
		/* clip to crtc bounds */
		if (crtc_x < 0) {
			if (-crtc_x > crtc_w)
@@ -228,8 +238,7 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,
			crtc_h = mode->vdisplay - crtc_y;
			src_h = crtc_h;
		}
	/* full plane minimum width is 13 pixels */
	if (crtc_w < 13 && (ipu_plane->dp_flow != IPU_DP_FLOW_SYNC_FG))
	} else
		return -EINVAL;
	if (crtc_h < 2)
		return -EINVAL;