linux-stable/drivers/gpu/drm/tilcdc
Jyri Sarha 11abbc9f39 drm/tilcdc: Set framebuffer DMA address to HW only if CRTC is enabled
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 had made it almost unreadable. There 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 correctly initialized the division by zero warning is
quite appropriate.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-03-14 14:28:58 +02:00
..
Kconfig drm/tilcdc: make fbdev support really optional 2016-07-18 09:11:38 +02:00
Makefile drm/tilcdc: Add dummy primary plane implementation 2016-08-08 23:05:00 +03:00
tilcdc_crtc.c drm/tilcdc: Set framebuffer DMA address to HW only if CRTC is enabled 2017-03-14 14:28:58 +02:00
tilcdc_drv.c drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
tilcdc_drv.h drm/tilcdc: Remove tilcdc_debugfs_cleanup() 2017-01-27 15:27:45 +01:00
tilcdc_external.c drm: bridge: Link encoder and bridge in core code 2016-12-18 16:31:45 +05:30
tilcdc_external.h drm/tilcdc: Add drm bridge support for attaching drm bridge drivers 2016-11-30 14:17:52 +02:00
tilcdc_panel.c Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
tilcdc_panel.h drm/tilcdc: add support for LCD panels (v5) 2013-02-19 17:57:45 -05:00
tilcdc_plane.c drm: Replace 'format->format' comparisons to just 'format' comparisons 2016-12-15 14:55:34 +02:00
tilcdc_regs.h drm/tilcdc: Enable frame done irq and functionality for LCDC rev 1 2016-11-30 14:20:03 +02:00
tilcdc_slave_compat.c drm/tilcdc: Return directly after a failed kfree_table_init() in tilcdc_convert_slave_node() 2016-09-23 13:49:52 +03:00
tilcdc_slave_compat.dts drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support 2015-05-27 13:13:33 +03:00
tilcdc_slave_compat.h drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support 2015-05-27 13:13:33 +03:00
tilcdc_tfp410.c drm/tilcdc: Remove obsolete drm_connector_register() calls 2016-11-29 21:03:18 +02:00
tilcdc_tfp410.h