MLK-19470: drm: imx: dcss: enable CTXLD only if not already in use
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Tue, 11 Sep 2018 12:21:43 +0000 (15:21 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Currently, it may happen to enable CTXLD if it's already in use. This
can lead to unpredictable behavior (green screen can be one).

This patch will check if CTXLD is already in use, before enabling it
again.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/imx/dcss/dcss-ctxld.c

index 41f944e..fbcad90 100644 (file)
@@ -383,7 +383,7 @@ void dcss_ctxld_kick(struct dcss_soc *dcss)
        dcss_trace_module(TRACE_CTXLD, TRACE_KICK);
 
        spin_lock_irqsave(&ctxld->lock, flags);
-       if (ctxld->armed) {
+       if (ctxld->armed && !ctxld->in_use) {
                ctxld->armed = false;
                __dcss_ctxld_enable(dcss->ctxld_priv);
        }