video: tegra: dc: rename tegra_dc_blank
Ujwal Patel [Tue, 11 Oct 2016 16:11:15 +0000 (09:11 -0700)]
bug 1865109

tegra_dc_blank detaches list of windows passed in the argument from
a given head. Purpose of this function is limited to detaching
windows only. However current function name is misleading and
non-window specific logic is being added into that function.
Rename this function to tegra_dc_blank_wins and move out non-window
specific logic.

TDS 1232

Change-Id: I22c77a32af1f81ca73abea4dd531ef03ae91f94c
Signed-off-by: Ujwal Patel <ujwalp@nvidia.com>
Reviewed-on: http://git-master/r/1234529
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Tested-by: Alex Waterman <alexw@nvidia.com>
(cherry picked from commit feafeede194469a454f98bd87f58827999f4a9e9)
Reviewed-on: http://git-master/r/1278025
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
(cherry picked from commit 67dc7f01d85ec4098cbf3ee1fe8b190955731a39)
Reviewed-on: http://git-master/r/1458819
Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>
Tested-by: Manish Tuteja <mtuteja@nvidia.com>

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/dsi.c
drivers/video/tegra/dc/ext/dev.c
drivers/video/tegra/fb.c
drivers/video/tegra/tegra_adf.c

index b6e2498..0f75711 100644 (file)
@@ -6,7 +6,7 @@
  * Author:
  *     Erik Gilling <konkers@google.com>
  *
- * Copyright (c) 2010-2016, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2010-2017, 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
@@ -1049,7 +1049,7 @@ bool tegra_dc_has_vsync(struct tegra_dc *dc);
 int tegra_dc_vsync_enable(struct tegra_dc *dc);
 void tegra_dc_vsync_disable(struct tegra_dc *dc);
 int tegra_dc_wait_for_vsync(struct tegra_dc *dc);
-int tegra_dc_blank(struct tegra_dc *dc, unsigned windows);
+int tegra_dc_blank_wins(struct tegra_dc *dc, unsigned windows);
 int tegra_dc_restore(struct tegra_dc *dc);
 
 void tegra_dc_enable(struct tegra_dc *dc);
index 976c828..9c07bc0 100644 (file)
@@ -4414,7 +4414,7 @@ bool tegra_dc_stats_get(struct tegra_dc *dc)
 }
 
 /* blank selected windows by disabling them */
-int tegra_dc_blank(struct tegra_dc *dc, unsigned windows)
+int tegra_dc_blank_wins(struct tegra_dc *dc, unsigned windows)
 {
        struct tegra_dc_win *dcwins[DC_N_WINDOWS];
        struct tegra_dc_win blank_win;
@@ -4500,6 +4500,7 @@ int tegra_dc_blank(struct tegra_dc *dc, unsigned windows)
                }
                tegra_dc_disable_window(dc, i);
        }
+
        return ret;
 }
 
@@ -4538,16 +4539,25 @@ void tegra_dc_disable(struct tegra_dc *dc)
 
 static void tegra_dc_disable_irq_ops(struct tegra_dc *dc, bool from_irq)
 {
+       bool blank_windows = true;
+
        if (WARN_ON(!dc || !dc->out || !dc->out_ops))
                return;
 
+       if (dc->shutdown) {
+               if ((dc->out->type == TEGRA_DC_OUT_HDMI) ||
+                   (dc->out->type == TEGRA_DC_OUT_DP))
+                       if (dc->out_ops && dc->out_ops->shutdown_interface)
+                               dc->out_ops->shutdown_interface(dc);
+       }
+
 #ifdef CONFIG_TEGRA_DC_EXTENSIONS
-       if (!tegra_dc_ext_disable(dc->ext))
-               tegra_dc_blank(dc, BLANK_ALL);
-#else
-       tegra_dc_blank(dc, BLANK_ALL);
+       blank_windows = !tegra_dc_ext_disable(dc->ext);
 #endif
 
+       if (blank_windows)
+               tegra_dc_blank_wins(dc, BLANK_ALL);
+
        /* it's important that new underflow work isn't scheduled before the
         * lock is acquired. */
        cancel_delayed_work_sync(&dc->underflow_work);
index a3f8fe0..42c5551 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * drivers/video/tegra/dc/dsi.c
  *
- * Copyright (c) 2011-2016, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2011-2017, 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
@@ -4154,12 +4154,12 @@ static void tegra_dsi_send_dc_frames(struct tegra_dc *dc,
         * Send frames in Continuous or One-shot mode.
         */
        if (dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE) {
-               /* FIX ME: tegra_dc_blank() implicitly takes lock */
+               /* FIX ME: tegra_dc_blank_wins() implicitly takes lock */
                int flag = mutex_is_locked(&dc->lock);
                if (flag)
                        mutex_unlock(&dc->lock);
                while (no_of_frames--)
-                       tegra_dc_blank(dc, BLANK_ALL);
+                       tegra_dc_blank_wins(dc, BLANK_ALL);
                if (flag)
                        mutex_lock(&dc->lock);
        } else
index 10b51cc..9cd72e6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * drivers/video/tegra/dc/ext/dev.c
  *
- * Copyright (c) 2011-2016, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2011-2017, NVIDIA CORPORATION, All rights reserved.
  *
  * Author: Robert Morell <rmorell@nvidia.com>
  * Some code based on fbdev extensions written by:
@@ -284,7 +284,7 @@ int tegra_dc_ext_disable(struct tegra_dc_ext *ext)
                                windows |= BIT(i);
                }
 
-               tegra_dc_blank(ext->dc, windows);
+               tegra_dc_blank_wins(ext->dc, windows);
                for_each_set_bit(i, &windows, DC_N_WINDOWS) {
                        tegra_dc_ext_unpin_window(&ext->win[i]);
                }
@@ -1833,7 +1833,7 @@ static long tegra_dc_ioctl(struct file *filp, unsigned int cmd,
        case TEGRA_DC_EXT_PUT_WINDOW:
                ret = tegra_dc_ext_put_window(user, arg);
                if (!ret) {
-                       ret = tegra_dc_blank(user->ext->dc, BIT(arg));
+                       ret = tegra_dc_blank_wins(user->ext->dc, BIT(arg));
                        if (ret < 0)
                                return ret;
                        tegra_dc_ext_unpin_window(&user->ext->win[arg]);
@@ -2523,7 +2523,7 @@ static int tegra_dc_release(struct inode *inode, struct file *filp)
        }
 
        if (ext->dc->enabled) {
-               tegra_dc_blank(ext->dc, windows);
+               tegra_dc_blank_wins(ext->dc, windows);
                for_each_set_bit(i, &windows, DC_N_WINDOWS) {
                        tegra_dc_ext_unpin_window(&ext->win[i]);
                        tegra_dc_disable_window(ext->dc, i);
index 0e830a4..35614ef 100644 (file)
@@ -389,7 +389,7 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
 #ifdef CONFIG_FRAMEBUFFER_CONSOLE
                tegra_dc_cursor_suspend(dc);
 #endif
-               tegra_dc_blank(dc, BLANK_ALL);
+               tegra_dc_blank_wins(dc, BLANK_ALL);
                return 0;
 
        case FB_BLANK_VSYNC_SUSPEND:
index e16e038..c174898 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2013 Google, Inc.
- * Copyright (c) 2014, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2014-2017, NVIDIA CORPORATION, All rights reserved.
  *
  * modified from drivers/video/tegra/dc/{mode.c,ext/dev.c}
  *
@@ -1027,7 +1027,7 @@ static int tegra_adf_intf_blank(struct adf_interface *intf, u8 state)
                break;
 
        case DRM_MODE_DPMS_STANDBY:
-               tegra_dc_blank(adf_info->dc, BLANK_ALL);
+               tegra_dc_blank_wins(adf_info->dc, BLANK_ALL);
                break;
 
        case DRM_MODE_DPMS_SUSPEND: