2019-11-06 09:48:11

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 1/2] drm/gma500: Add missing call to allow enabling vblank on psb/cdv

This adds a missing call to drm_crtc_vblank_on to the common DPMS helper
(used by poulsbo and cedartrail), which is called in the CRTC enable path.

With that call, it becomes possible to enable vblank when needed.
It is already balanced by a drm_crtc_vblank_off call in the helper.

Other platforms (oaktrail and medfield) use a dedicated DPMS helper that
does not have the proper vblank on/off hooks. They are not added in this
commit due to lack of hardware to test it with.

Signed-off-by: Paul Kocialkowski <[email protected]>
---
drivers/gpu/drm/gma500/gma_display.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
index e20ccb5d10fd..bc07ae2a9a1d 100644
--- a/drivers/gpu/drm/gma500/gma_display.c
+++ b/drivers/gpu/drm/gma500/gma_display.c
@@ -255,6 +255,8 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode)
/* Give the overlay scaler a chance to enable
* if it's on this pipe */
/* psb_intel_crtc_dpms_video(crtc, true); TODO */
+
+ drm_crtc_vblank_on(crtc);
break;
case DRM_MODE_DPMS_OFF:
if (!gma_crtc->active)
--
2.23.0


2019-11-06 15:26:24

by Patrik Jakobsson

[permalink] [raw]
Subject: Re: [PATCH 1/2] drm/gma500: Add missing call to allow enabling vblank on psb/cdv

On Wed, Nov 6, 2019 at 10:44 AM Paul Kocialkowski
<[email protected]> wrote:
>
> This adds a missing call to drm_crtc_vblank_on to the common DPMS helper
> (used by poulsbo and cedartrail), which is called in the CRTC enable path.
>
> With that call, it becomes possible to enable vblank when needed.
> It is already balanced by a drm_crtc_vblank_off call in the helper.
>
> Other platforms (oaktrail and medfield) use a dedicated DPMS helper that
> does not have the proper vblank on/off hooks. They are not added in this
> commit due to lack of hardware to test it with.
>
> Signed-off-by: Paul Kocialkowski <[email protected]>

Don't think we ever found a need for having vblanks enabled... until
now. I'll have a look if something can be done for Oaktrail since I
have hw.

Reviewed-by: Patrik Jakobsson <[email protected]>

> ---
> drivers/gpu/drm/gma500/gma_display.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
> index e20ccb5d10fd..bc07ae2a9a1d 100644
> --- a/drivers/gpu/drm/gma500/gma_display.c
> +++ b/drivers/gpu/drm/gma500/gma_display.c
> @@ -255,6 +255,8 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode)
> /* Give the overlay scaler a chance to enable
> * if it's on this pipe */
> /* psb_intel_crtc_dpms_video(crtc, true); TODO */
> +
> + drm_crtc_vblank_on(crtc);
> break;
> case DRM_MODE_DPMS_OFF:
> if (!gma_crtc->active)
> --
> 2.23.0
>

2019-11-07 14:19:00

by Paul Kocialkowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] drm/gma500: Add missing call to allow enabling vblank on psb/cdv

Hi,

On Wed 06 Nov 19, 16:23, Patrik Jakobsson wrote:
> On Wed, Nov 6, 2019 at 10:44 AM Paul Kocialkowski
> <[email protected]> wrote:
> >
> > This adds a missing call to drm_crtc_vblank_on to the common DPMS helper
> > (used by poulsbo and cedartrail), which is called in the CRTC enable path.
> >
> > With that call, it becomes possible to enable vblank when needed.
> > It is already balanced by a drm_crtc_vblank_off call in the helper.
> >
> > Other platforms (oaktrail and medfield) use a dedicated DPMS helper that
> > does not have the proper vblank on/off hooks. They are not added in this
> > commit due to lack of hardware to test it with.
> >
> > Signed-off-by: Paul Kocialkowski <[email protected]>
>
> Don't think we ever found a need for having vblanks enabled... until
> now. I'll have a look if something can be done for Oaktrail since I
> have hw.

Neat, thanks!

IIRC the DPMS paths that don't use gma_crtc_dpms also lack the proper
drm_crtc_vblank_on/off calls so that's probably something to start with :)

Thanks for the review on these patches. I may have more fixes coming up.

Cheers,

Paul

> Reviewed-by: Patrik Jakobsson <[email protected]>
>
> > ---
> > drivers/gpu/drm/gma500/gma_display.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
> > index e20ccb5d10fd..bc07ae2a9a1d 100644
> > --- a/drivers/gpu/drm/gma500/gma_display.c
> > +++ b/drivers/gpu/drm/gma500/gma_display.c
> > @@ -255,6 +255,8 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode)
> > /* Give the overlay scaler a chance to enable
> > * if it's on this pipe */
> > /* psb_intel_crtc_dpms_video(crtc, true); TODO */
> > +
> > + drm_crtc_vblank_on(crtc);
> > break;
> > case DRM_MODE_DPMS_OFF:
> > if (!gma_crtc->active)
> > --
> > 2.23.0
> >

--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


Attachments:
(No filename) (2.08 kB)
signature.asc (499.00 B)
Download all attachments