video: tegra: Skip syncpoint increments if disabled
Yu-Huan Hsu [Wed, 2 Mar 2011 07:57:41 +0000 (23:57 -0800)]
Avoid Display Controller (DC) syncpoint increments if that instance of DC is
not enabled.
Bug 793874

Original-Change-Id: I602b5399da8738824ae2e2c6ad3fa0d83a539567
Reviewed-on: http://git-master/r/21347
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>
Reviewed-by: Kevin Huang <kevinh@nvidia.com>
Tested-by: Kevin Huang <kevinh@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Original-Change-Id: I9ca8ebe373f96470a535199e2c89fc6a605489d9

Rebase-Id: R50565adaf483633ddaa58dd4e44bb608edbaeead

drivers/video/tegra/dc/dc.c

index 01196c6..6c24db4 100644 (file)
@@ -660,7 +660,8 @@ u32 tegra_dc_incr_syncpt_max(struct tegra_dc *dc)
        u32 max;
 
        mutex_lock(&dc->lock);
-       max = nvhost_syncpt_incr_max(&dc->ndev->host->syncpt, dc->syncpt_id, 1);
+       max = nvhost_syncpt_incr_max(&dc->ndev->host->syncpt, dc->syncpt_id,
+                                       ((dc->enabled) ? 1 : 0) );
        dc->syncpt_max = max;
        mutex_unlock(&dc->lock);
 
@@ -670,10 +671,12 @@ u32 tegra_dc_incr_syncpt_max(struct tegra_dc *dc)
 void tegra_dc_incr_syncpt_min(struct tegra_dc *dc, u32 val)
 {
        mutex_lock(&dc->lock);
-       while (dc->syncpt_min < val) {
-               dc->syncpt_min++;
-               nvhost_syncpt_cpu_incr(&dc->ndev->host->syncpt, dc->syncpt_id);
-       }
+       if ( dc->enabled )
+               while (dc->syncpt_min < val) {
+                       dc->syncpt_min++;
+                       nvhost_syncpt_cpu_incr(&dc->ndev->host->syncpt,
+                               dc->syncpt_id);
+               }
        mutex_unlock(&dc->lock);
 }