]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: dc: change vrr native mode location
authorDaniel Solomon <daniels@nvidia.com>
Wed, 20 May 2015 04:56:19 +0000 (21:56 -0700)
committerMitch Luban <mluban@nvidia.com>
Mon, 29 Jun 2015 17:12:14 +0000 (10:12 -0700)
Change VRR native mode location from mode list index
VRR_NATIVE_MODE_IDX to the last mode in the list. This
matches bootloader behavior.

Bug 1645593

Change-Id: I79f17c80d846cc236b0dd8c8f4874c2daf863894
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-on: http://git-master/r/744705
(cherry picked from commit 860c86538feb0febace6305510e894580f1176c2)
Reviewed-on: http://git-master/r/751050
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Tested-by: Mitch Luban <mluban@nvidia.com>
Documentation/devicetree/bindings/video/nvidia,tegra114-dsi.txt
Documentation/devicetree/bindings/video/nvidia,tegra124-dsi.txt
Documentation/devicetree/bindings/video/nvidia,tegra210-dsi.txt
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/dc_priv.h
drivers/video/tegra/dc/mode.c

index f602c947c5f5c3927f2e02aa79b4f68b540214c9..28904ef15b119e7ba56de263055f69d0a56136b8 100644 (file)
@@ -100,8 +100,7 @@ NVIDIA TEGRA114 Display Serial Interface
  Required properties:
  - name: Should be "display-timings"
  - Child nodes represent modes. Several modes can be prepared. For VRR panels, the panel's native mode
-   must be placed in index VRR_NATIVE_MODE_IDX (value 1, i.e. second mode in the list, as of the writing
-   of this comment).
+   must be placed in the last index
 
 1.A.i.x) NVIDIA Display Controller Mode timing
  This must be contained in display-timings parent node. This contains mode settings, including
index b303a0d2b540f6a095b9767dca4e73baf447de5d..2dcb1c8c7aa34c1bd7de3ce70238cf977948703d 100644 (file)
@@ -100,8 +100,7 @@ NVIDIA TEGRA124 Display Serial Interface
  Required properties:
  - name: Should be "display-timings"
  - Child nodes represent modes. Several modes can be prepared. For VRR panels, the panel's native mode
-   must be placed in index VRR_NATIVE_MODE_IDX (value 1, i.e. second mode in the list, as of the writing
-   of this comment).
+   must be placed in the last index
 
 1.A.i.x) NVIDIA Display Controller Mode timing
  This must be contained in display-timings parent node. This contains mode settings, including
index 1c71724e52af2bf9103dd41a4514dd3105d42354..13744a6766dbbc371242fa6e13428a496709ebdf 100644 (file)
@@ -101,8 +101,7 @@ NVIDIA TEGRA210 Display Serial Interface
  Required properties:
  - name: Should be "display-timings"
  - Child nodes represent modes. Several modes can be prepared. For VRR panels, the panel's native mode
-   must be placed in index VRR_NATIVE_MODE_IDX (value 1, i.e. second mode in the list, as of the writing
-   of this comment).
+   must be placed in the last index
 
 1.A.i.x) NVIDIA Display Controller Mode timing
  This must be contained in display-timings parent node. This contains mode settings, including
index 1cef28568c42995e3b9940e5d1b2d2352e87d2a1..89b4495c94d2040c3a00d1b4fa5ed4308a15ea1d 100644 (file)
@@ -1719,7 +1719,7 @@ static void tegra_dc_setup_vrr(struct tegra_dc *dc)
 
        if (!vrr) return;
 
-       m = &dc->out->modes[VRR_NATIVE_MODE_IDX];
+       m = &dc->out->modes[dc->out->n_modes-1];
        vrr->v_front_porch = m->v_front_porch;
        vrr->v_back_porch = m->v_back_porch;
        vrr->pclk = m->pclk;
@@ -2430,11 +2430,11 @@ static int tegra_dc_set_out(struct tegra_dc *dc, struct tegra_dc_out *out)
                dc->initialized = true;
        } else if (out->n_modes > 0) {
                /* For VRR panels, default mode is first in the list,
-                * and native panel mode is at index VRR_NATIVE_MODE_IDX.
+                * and native panel mode is the last.
                 * Initialization must occur using the native panel mode. */
                if (dc->out->vrr) {
                        tegra_dc_set_mode(dc,
-                               &dc->out->modes[VRR_NATIVE_MODE_IDX]);
+                               &dc->out->modes[dc->out->n_modes-1]);
                        tegra_dc_setup_vrr(dc);
                } else
                        tegra_dc_set_mode(dc, &dc->out->modes[0]);
index 8f6dbb1064f41a888a4d33c345001d6c38a662c0..88952d92f2d4ec3057ae665583518bd7fe97f2fa 100644 (file)
@@ -46,8 +46,6 @@
                (dc->out->hotplug_gpio >= 0 || \
                dc->out->type == TEGRA_DC_OUT_DP) : 0)
 
-#define VRR_NATIVE_MODE_IDX 1
-
 static inline int tegra_dc_io_start(struct tegra_dc *dc)
 {
        int ret = 0;
index 7ce5e8d4b00ad914d481c1c706795d872323fa3b..e6ceb5a041f3720deb669f78b776cc4d28230db0 100644 (file)
@@ -322,9 +322,9 @@ static bool check_mode_timings(struct tegra_dc *dc, struct tegra_dc_mode *mode)
                mode->v_ref_to_sync = 1;
        } else if (dc->out->vrr) {
                mode->h_ref_to_sync =
-                       dc->out->modes[VRR_NATIVE_MODE_IDX].h_ref_to_sync;
+                       dc->out->modes[dc->out->n_modes-1].h_ref_to_sync;
                mode->v_ref_to_sync =
-                       dc->out->modes[VRR_NATIVE_MODE_IDX].v_ref_to_sync;
+                       dc->out->modes[dc->out->n_modes-1].v_ref_to_sync;
        } else {
                calc_ref_to_sync(mode);
        }