]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: dc: add VRR capability checks
authorDaniel Solomon <daniels@nvidia.com>
Fri, 15 Jan 2016 20:17:50 +0000 (12:17 -0800)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 5 Feb 2016 20:06:18 +0000 (12:06 -0800)
On platforms that support VRR, but that run with non-VRR displays,
certain VRR logic was still being activated. Checking for VRR
capability prevents that from happening.

Change-Id: Idb4fc279c3fa0c50ca42335c7f8aae94c401c8aa
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-on: http://git-master/r/933276
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/window.c

index c9c07331151a6d91825d2c029125dfa33cd2ef33..e7215aff176a15d75d59e669a5cb0ff7aa3fcd0b 100644 (file)
@@ -2966,6 +2966,9 @@ void tegra_dc_set_act_vfp(struct tegra_dc *dc, int vfp)
 {
        WARN_ON(!mutex_is_locked(&dc->lock));
        WARN_ON(vfp < dc->mode.v_ref_to_sync + 1);
+       /* It's very unlikely that active vfp will need to
+        * be changed outside of vrr context */
+       WARN_ON(!dc->out->vrr || !dc->out->vrr->capability);
 
        tegra_dc_writel(dc, WRITE_MUX_ACTIVE | READ_MUX_ACTIVE,
                        DC_CMD_STATE_ACCESS);
@@ -2979,7 +2982,10 @@ static void tegra_dc_vrr_extend_vfp(struct tegra_dc *dc)
 {
        struct tegra_vrr *vrr  = dc->out->vrr;
 
-       if (!vrr || !vrr->enable)
+       if (!vrr || !vrr->capability)
+               return;
+
+       if (!vrr->enable)
                return;
 
        tegra_dc_set_act_vfp(dc, MAX_VRR_V_FRONT_PORCH);
@@ -2998,7 +3004,8 @@ static void tegra_dc_vrr_get_ts(struct tegra_dc *dc)
        struct timespec time_now;
        struct tegra_vrr *vrr  = dc->out->vrr;
 
-       if (!vrr || (!vrr->enable && !vrr->lastenable))
+       if (!vrr || !vrr->capability ||
+               (!vrr->enable && !vrr->lastenable))
                return;
 
        getnstimeofday(&time_now);
@@ -3011,7 +3018,10 @@ static void tegra_dc_vrr_sec(struct tegra_dc *dc)
 {
        struct tegra_vrr *vrr  = dc->out->vrr;
 
-       if (!vrr || (!vrr->enable && !vrr->fe_intr_req))
+       if (!vrr || !vrr->capability)
+               return;
+
+       if (!vrr->enable && !vrr->fe_intr_req)
                return;
 
        /* Decrement frame end interrupt refcount previously
@@ -4098,7 +4108,8 @@ static void _tegra_dc_controller_disable(struct tegra_dc *dc)
        if (dc->out && dc->out->prepoweroff)
                dc->out->prepoweroff();
 
-       if (dc->out_ops && dc->out_ops->vrr_enable) {
+       if (dc->out_ops && dc->out_ops->vrr_enable &&
+               dc->out->vrr && dc->out->vrr->capability) {
                dc->out_ops->vrr_enable(dc, 0);
                /* TODO: Fix properly. Bug 1644102. */
                tegra_dc_set_act_vfp(dc, dc->mode.v_front_porch);
index 46e2af1566af0eabac2e63579deb4fe350dcdb40..10c1b3994a984f5816a67bef62f18e76167b37d1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2010 Google, Inc.
  *
- * Copyright (c) 2010-2015, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION, All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -508,7 +508,8 @@ static void tegra_dc_vrr_flip_time(struct tegra_dc *dc)
        struct timespec time_now;
        struct tegra_vrr *vrr  = dc->out->vrr;
 
-       if (!vrr) return;
+       if (!vrr || !vrr->capability)
+               return;
 
        if (vrr->enable) {
                vrr->lastenable = 1;
@@ -527,7 +528,8 @@ static void tegra_dc_vrr_cancel_vfp(struct tegra_dc *dc)
 {
        struct tegra_vrr *vrr  = dc->out->vrr;
 
-       if (!vrr) return;
+       if (!vrr || !vrr->capability)
+               return;
 
        if (vrr->enable) {
                if (dc->out->type == TEGRA_DC_OUT_DSI)