MLK-18873: drm: imx: dcss: request PM QoS only when VBLANK is on
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Thu, 12 Jul 2018 07:29:38 +0000 (10:29 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit22489b8feac295476372e007925654668664e180
tree0066c05e9bead9fa713c0573a87b12f95f46c184
parent45c66891eaa977a0a67f4f46408a4a780b08c9a8
MLK-18873: drm: imx: dcss: request PM QoS only when VBLANK is on

DCSS needs PM QoS in order to keep interrupt latency low. Otherwise,
page flipping will not work smooth enough because CTXLD will not be
triggered in time.

Currently, PM QoS is requested all the time but that does not allow the
CPUs to go idle. Hence, this leads to increased power consumption.

This patch will change how PM QoS is requested by doing it only when
VBLANK is enabled/disabled. The VBLANK interrupt is enabled just before
a commit takes place and disabled after one second after last commit.
This will allow DCSS to function properly and, also, allow CPUs to go
idle whenever there's no buffer submitted.

Exception to this is when DTRC is used (when DCSS is passed tiled
buffers). In this case, PM QoS will always be active, even if no buffer
is submitted, because DTRC banks need to be switched in CTXLD ISR, so
that DCSS does not underrun. DTRC does not have the REPEAT feature, as
the rest of DCSS does.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/drm/imx/dcss/dcss-crtc.c
drivers/gpu/imx/dcss/dcss-common.c
drivers/gpu/imx/dcss/dcss-prv.h
include/video/imx-dcss.h