[PATCH] drm/tilcdc: Set framebuffer DMA address to HW only if CRTC is enabled

Tomi Valkeinen tomi.valkeinen at ti.com
Mon Mar 13 08:29:11 UTC 2017


On 11/03/17 19:25, Jyri Sarha wrote:
> Touching HW while clocks are off is a serious error and for instance
> breaks suspend functionality. After this patch tilcdc_crtc_update_fb()
> always updates the primary plane's framebuffer pointer, increases fb's
> reference count and stores vblank event. tilcdc_crtc_update_fb() only
> writes the fb's DMA address to HW if the crtc is enabled, as
> tilcdc_crtc_enable() takes care of writing the address on enable.
> 
> This patch also refactors the tilcdc_crtc_update_fb() a bit. Number of
> subsequent small changes to had made it almost unreadable. There

Something is missing from the line above...

> should be no other functional changes but checking the CRTC's enable
> state. However, the locking goes a bit differently and some of the
> redundant checks have been removed in this new version.
> 
> The enable_lock should be enough to protect the access to
> tilcdc_crtc->enabled. The irq_lock protects the access to last_vblank
> and next_fb. The check for vrefresh and last_vblank being valid is
> redundant, as the vrefresh should be always valid if the CRTC is
> enabled and now last_vblank should be too, because it is initialized
> to current time when CRTC raster is enabled. If for some reason the
> values are not corretly initialized the division by zero waning is

2 typoes above.

> quite appropriate.
> 
> Signed-off-by: Jyri Sarha <jsarha at ti.com>
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 37 +++++++++++++++++++++++-------------
>  1 file changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> index f80bf93..bd92c89 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -1,4 +1,4 @@
> -/*
> +*

This breaks the compilation of the whole driver...

 Tomi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170313/3f456c36/attachment.sig>


More information about the dri-devel mailing list