diff mbox series

[v2] drm/mediatek: Set the default value of rotation to DRM_MODE_ROTATE_0

Message ID 20211213160742.744333-1-markyacoub@chromium.org (mailing list archive)
State New, archived
Headers show
Series [v2] drm/mediatek: Set the default value of rotation to DRM_MODE_ROTATE_0 | expand

Commit Message

Mark Yacoub Dec. 13, 2021, 4:07 p.m. UTC
At the reset hook, call __drm_atomic_helper_plane_reset which is
called at the initialization of the plane and sets the default value of
rotation on all planes to DRM_MODE_ROTATE_0 which is equal to 1.

Tested on Jacuzzi (MTK).
Resolves IGT@kms_properties@plane-properties-{legacy,atomic}

Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Chun-Kuang Hu Dec. 13, 2021, 11:27 p.m. UTC | #1
Hi, Mark:

Mark Yacoub <markyacoub@chromium.org> 於 2021年12月14日 週二 上午12:08寫道:
>
> At the reset hook, call __drm_atomic_helper_plane_reset which is
> called at the initialization of the plane and sets the default value of
> rotation on all planes to DRM_MODE_ROTATE_0 which is equal to 1.

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> Tested on Jacuzzi (MTK).
> Resolves IGT@kms_properties@plane-properties-{legacy,atomic}
>
> Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index e6dcb34d30522..accd26481b9fb 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -44,9 +44,10 @@ static void mtk_plane_reset(struct drm_plane *plane)
>                 state = kzalloc(sizeof(*state), GFP_KERNEL);
>                 if (!state)
>                         return;
> -               plane->state = &state->base;
>         }
>
> +       __drm_atomic_helper_plane_reset(plane, &state->base);
> +
>         state->base.plane = plane;
>         state->pending.format = DRM_FORMAT_RGB565;
>  }
> --
> 2.34.1.173.g76aa8bc2d0-goog
>
Mark Yacoub Dec. 14, 2021, 3:26 p.m. UTC | #2
Thank you so much!

On Mon, Dec 13, 2021 at 6:27 PM Chun-Kuang Hu <chunkuang.hu@kernel.org> wrote:
>
> Hi, Mark:
>
> Mark Yacoub <markyacoub@chromium.org> 於 2021年12月14日 週二 上午12:08寫道:
> >
> > At the reset hook, call __drm_atomic_helper_plane_reset which is
> > called at the initialization of the plane and sets the default value of
> > rotation on all planes to DRM_MODE_ROTATE_0 which is equal to 1.
>
> Applied to mediatek-drm-next [1], thanks.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
>
> Regards,
> Chun-Kuang.
>
> >
> > Tested on Jacuzzi (MTK).
> > Resolves IGT@kms_properties@plane-properties-{legacy,atomic}
> >
> > Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > index e6dcb34d30522..accd26481b9fb 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > @@ -44,9 +44,10 @@ static void mtk_plane_reset(struct drm_plane *plane)
> >                 state = kzalloc(sizeof(*state), GFP_KERNEL);
> >                 if (!state)
> >                         return;
> > -               plane->state = &state->base;
> >         }
> >
> > +       __drm_atomic_helper_plane_reset(plane, &state->base);
> > +
> >         state->base.plane = plane;
> >         state->pending.format = DRM_FORMAT_RGB565;
> >  }
> > --
> > 2.34.1.173.g76aa8bc2d0-goog
> >
Mark Yacoub Dec. 29, 2021, 7:30 p.m. UTC | #3
hey - uploaded v2 that takes care of the panel:
https://patchwork.kernel.org/project/linux-mediatek/patch/20211229184420.793234-1-markyacoub@chromium.org/

Thanks!

On Tue, Dec 14, 2021 at 10:26 AM Mark Yacoub <markyacoub@chromium.org> wrote:
>
> Thank you so much!
>
> On Mon, Dec 13, 2021 at 6:27 PM Chun-Kuang Hu <chunkuang.hu@kernel.org> wrote:
> >
> > Hi, Mark:
> >
> > Mark Yacoub <markyacoub@chromium.org> 於 2021年12月14日 週二 上午12:08寫道:
> > >
> > > At the reset hook, call __drm_atomic_helper_plane_reset which is
> > > called at the initialization of the plane and sets the default value of
> > > rotation on all planes to DRM_MODE_ROTATE_0 which is equal to 1.
> >
> > Applied to mediatek-drm-next [1], thanks.
> >
> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
> >
> > Regards,
> > Chun-Kuang.
> >
> > >
> > > Tested on Jacuzzi (MTK).
> > > Resolves IGT@kms_properties@plane-properties-{legacy,atomic}
> > >
> > > Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> > > ---
> > >  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > > index e6dcb34d30522..accd26481b9fb 100644
> > > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > > @@ -44,9 +44,10 @@ static void mtk_plane_reset(struct drm_plane *plane)
> > >                 state = kzalloc(sizeof(*state), GFP_KERNEL);
> > >                 if (!state)
> > >                         return;
> > > -               plane->state = &state->base;
> > >         }
> > >
> > > +       __drm_atomic_helper_plane_reset(plane, &state->base);
> > > +
> > >         state->base.plane = plane;
> > >         state->pending.format = DRM_FORMAT_RGB565;
> > >  }
> > > --
> > > 2.34.1.173.g76aa8bc2d0-goog
> > >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index e6dcb34d30522..accd26481b9fb 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -44,9 +44,10 @@  static void mtk_plane_reset(struct drm_plane *plane)
 		state = kzalloc(sizeof(*state), GFP_KERNEL);
 		if (!state)
 			return;
-		plane->state = &state->base;
 	}
 
+	__drm_atomic_helper_plane_reset(plane, &state->base);
+
 	state->base.plane = plane;
 	state->pending.format = DRM_FORMAT_RGB565;
 }