diff mbox

[3/9] drm/imx: ipuv3-plane: request modeset if plane offsets changed

Message ID 20161018160757.11595-3-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel Oct. 18, 2016, 4:07 p.m. UTC
If the framebuffer pixel format is planar YUV and unchanged, but the U
or V plane offsets change, do not return an error, but request a modeset
instead.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/gpu/drm/imx/ipuv3-plane.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ying Liu Oct. 19, 2016, 7:19 a.m. UTC | #1
On Wed, Oct 19, 2016 at 12:07 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> If the framebuffer pixel format is planar YUV and unchanged, but the U
> or V plane offsets change, do not return an error, but request a modeset
> instead.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Acked-by: Liu Ying <gnuiyl@gmail.com>

> ---
>  drivers/gpu/drm/imx/ipuv3-plane.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
> index d4a771c..f217444 100644
> --- a/drivers/gpu/drm/imx/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c
> @@ -356,13 +356,11 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
>                 if ((ubo > 0xfffff8) || (vbo > 0xfffff8))
>                         return -EINVAL;
>
> -               if (old_fb &&
> -                   (old_fb->pixel_format == DRM_FORMAT_YUV420 ||
> -                    old_fb->pixel_format == DRM_FORMAT_YVU420)) {
> +               if (old_fb && (fb->pixel_format == old_fb->pixel_format)) {
>                         old_ubo = drm_plane_state_to_ubo(old_state);
>                         old_vbo = drm_plane_state_to_vbo(old_state);
>                         if (ubo != old_ubo || vbo != old_vbo)
> -                               return -EINVAL;
> +                               crtc_state->mode_changed = true;
>                 }
>
>                 if (fb->pitches[1] != fb->pitches[2])
> --
> 2.9.3
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
index d4a771c..f217444 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -356,13 +356,11 @@  static int ipu_plane_atomic_check(struct drm_plane *plane,
 		if ((ubo > 0xfffff8) || (vbo > 0xfffff8))
 			return -EINVAL;
 
-		if (old_fb &&
-		    (old_fb->pixel_format == DRM_FORMAT_YUV420 ||
-		     old_fb->pixel_format == DRM_FORMAT_YVU420)) {
+		if (old_fb && (fb->pixel_format == old_fb->pixel_format)) {
 			old_ubo = drm_plane_state_to_ubo(old_state);
 			old_vbo = drm_plane_state_to_vbo(old_state);
 			if (ubo != old_ubo || vbo != old_vbo)
-				return -EINVAL;
+				crtc_state->mode_changed = true;
 		}
 
 		if (fb->pitches[1] != fb->pitches[2])