summaryrefslogtreecommitdiffstats
path: root/drivers/video/tegra
diff options
context:
space:
mode:
authorAly Hirani <ahirani@nvidia.com>2018-06-27 19:30:33 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-06-29 17:24:44 -0400
commitd9bd47b344cac6b8637e3b07c11bc75aa0ff3371 (patch)
tree9ea810bc27946c011155d374ed0a4ea568614aaf /drivers/video/tegra
parent3d8c340fafd8ef3377a1a43809439d758d643a6b (diff)
video: tegra: hdmi: hpd debounce work around
Few TVs are known to cause HPD debounce of 1 to 4 seconds. This change tries to identify it and retain hdmi state for such debounce for given TVs only. bug 2051353 Change-Id: I3c126e15e3125bdcf8cccc1890de535855a17c48 Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com> Signed-off-by: Aly Hirani <ahirani@nvidia.com> (cherry picked from commit 31fe100d389713988df7d057ab39b6b2346aa542) Reviewed-on: https://git-master.nvidia.com/r/1764674 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/video/tegra')
-rw-r--r--drivers/video/tegra/dc/edid.c4
-rw-r--r--drivers/video/tegra/dc/edid.h4
-rw-r--r--drivers/video/tegra/dc/edid_quirks.c5
-rw-r--r--drivers/video/tegra/dc/hdmi2.0.c9
-rw-r--r--drivers/video/tegra/dc/hdmi2.0.h1
5 files changed, 18 insertions, 5 deletions
diff --git a/drivers/video/tegra/dc/edid.c b/drivers/video/tegra/dc/edid.c
index ce1b225e5..e54d8e48c 100644
--- a/drivers/video/tegra/dc/edid.c
+++ b/drivers/video/tegra/dc/edid.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * Author: Erik Gilling <konkers@android.com> 5 * Author: Erik Gilling <konkers@android.com>
6 * 6 *
7 * Copyright (c) 2010-2017, NVIDIA CORPORATION, All rights reserved. 7 * Copyright (c) 2010-2018, NVIDIA CORPORATION, All rights reserved.
8 * 8 *
9 * This software is licensed under the terms of the GNU General Public 9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and 10 * License version 2, as published by the Free Software Foundation, and
@@ -690,7 +690,7 @@ u32 tegra_edid_get_quirks(struct tegra_edid *edid)
690{ 690{
691 if (!edid || !edid->data) { 691 if (!edid || !edid->data) {
692 pr_warn("edid invalid\n"); 692 pr_warn("edid invalid\n");
693 return false; 693 return 0;
694 } 694 }
695 695
696 return edid->data->quirks; 696 return edid->data->quirks;
diff --git a/drivers/video/tegra/dc/edid.h b/drivers/video/tegra/dc/edid.h
index dfe6f6696..100a4daa5 100644
--- a/drivers/video/tegra/dc/edid.h
+++ b/drivers/video/tegra/dc/edid.h
@@ -4,7 +4,7 @@
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * Author: Erik Gilling <konkers@android.com> 5 * Author: Erik Gilling <konkers@android.com>
6 * 6 *
7 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. 7 * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved.
8 * 8 *
9 * This software is licensed under the terms of the GNU General Public 9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and 10 * License version 2, as published by the Free Software Foundation, and
@@ -140,6 +140,8 @@ enum {
140#define TEGRA_EDID_QUIRK_NO_HDCP (1 << 2) 140#define TEGRA_EDID_QUIRK_NO_HDCP (1 << 2)
141/* Denon 2313 doesn't support YUV422, but declares support for it */ 141/* Denon 2313 doesn't support YUV422, but declares support for it */
142#define TEGRA_EDID_QUIRK_NO_YUV_422 (1 << 3) 142#define TEGRA_EDID_QUIRK_NO_YUV_422 (1 << 3)
143/* TVs that send HPD bounce upto 4 seconds */
144#define TEGRA_EDID_QUIRK_HPD_BOUNCE (1 << 4)
143 145
144struct tegra_edid { 146struct tegra_edid {
145 struct tegra_edid_pvt *data; 147 struct tegra_edid_pvt *data;
diff --git a/drivers/video/tegra/dc/edid_quirks.c b/drivers/video/tegra/dc/edid_quirks.c
index f755969bf..92d023331 100644
--- a/drivers/video/tegra/dc/edid_quirks.c
+++ b/drivers/video/tegra/dc/edid_quirks.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * edid_quirks.c: edid specific exceptions. 2 * edid_quirks.c: edid specific exceptions.
3 * 3 *
4 * Copyright (c) 2015-2017, NVIDIA CORPORATION, All rights reserved. 4 * Copyright (c) 2015-2018, NVIDIA CORPORATION, All rights reserved.
5 * Author: Anshuman Nath Kar <anshumank@nvidia.com> 5 * Author: Anshuman Nath Kar <anshumank@nvidia.com>
6 * 6 *
7 * This software is licensed under the terms of the GNU General Public 7 * This software is licensed under the terms of the GNU General Public
@@ -33,6 +33,9 @@ static const struct hdmi_blacklist {
33 { "BMD", 0, "BMD HDMI", TEGRA_EDID_QUIRK_NO_HDCP }, 33 { "BMD", 0, "BMD HDMI", TEGRA_EDID_QUIRK_NO_HDCP },
34 /* Denon 2313 doesn't support YUV422, but declares support for it */ 34 /* Denon 2313 doesn't support YUV422, but declares support for it */
35 { "DON", 48, "DENON-AVR", TEGRA_EDID_QUIRK_NO_YUV_422 }, 35 { "DON", 48, "DENON-AVR", TEGRA_EDID_QUIRK_NO_YUV_422 },
36 /* Few TVs causing HPD bounce for 1-4 seconds */
37 { "YMH", 12774,"RX-A1070", TEGRA_EDID_QUIRK_HPD_BOUNCE },
38 { "SAM", 3387, "SAMSUNG", TEGRA_EDID_QUIRK_HPD_BOUNCE },
36}; 39};
37 40
38u32 tegra_edid_lookup_quirks(const char *manufacturer, u32 model, 41u32 tegra_edid_lookup_quirks(const char *manufacturer, u32 model,
diff --git a/drivers/video/tegra/dc/hdmi2.0.c b/drivers/video/tegra/dc/hdmi2.0.c
index 13c158738..283dc82e7 100644
--- a/drivers/video/tegra/dc/hdmi2.0.c
+++ b/drivers/video/tegra/dc/hdmi2.0.c
@@ -851,6 +851,7 @@ static irqreturn_t tegra_hdmi_hpd_irq_handler(int irq, void *ptr)
851{ 851{
852 struct tegra_dc *dc = ptr; 852 struct tegra_dc *dc = ptr;
853 struct tegra_hdmi *hdmi = tegra_dc_get_outdata(dc); 853 struct tegra_hdmi *hdmi = tegra_dc_get_outdata(dc);
854 unsigned int hpd_debounce = HDMI_HPD_DEBOUNCE_DELAY_MS;
854 855
855 if (dc->out->type == TEGRA_DC_OUT_FAKE_DP) 856 if (dc->out->type == TEGRA_DC_OUT_FAKE_DP)
856 return IRQ_HANDLED; 857 return IRQ_HANDLED;
@@ -859,8 +860,14 @@ static irqreturn_t tegra_hdmi_hpd_irq_handler(int irq, void *ptr)
859 return IRQ_HANDLED; 860 return IRQ_HANDLED;
860 861
861 cancel_delayed_work(&hdmi->hpd_worker); 862 cancel_delayed_work(&hdmi->hpd_worker);
863
864 if (tegra_edid_get_quirks(hdmi->edid) &
865 TEGRA_EDID_QUIRK_HPD_BOUNCE) {
866 hpd_debounce = HDMI_HPD_DEBOUNCE_WAR_DELAY_MS;
867 }
868
862 schedule_delayed_work(&hdmi->hpd_worker, 869 schedule_delayed_work(&hdmi->hpd_worker,
863 msecs_to_jiffies(HDMI_HPD_DEBOUNCE_DELAY_MS)); 870 msecs_to_jiffies(hpd_debounce));
864 871
865 return IRQ_HANDLED; 872 return IRQ_HANDLED;
866} 873}
diff --git a/drivers/video/tegra/dc/hdmi2.0.h b/drivers/video/tegra/dc/hdmi2.0.h
index 538cb474f..3f9f2115a 100644
--- a/drivers/video/tegra/dc/hdmi2.0.h
+++ b/drivers/video/tegra/dc/hdmi2.0.h
@@ -23,6 +23,7 @@
23#define HDMI_SCDC_MONITOR_TIMEOUT_MS (5000) 23#define HDMI_SCDC_MONITOR_TIMEOUT_MS (5000)
24#define HDMI_EDID_MAX_LENGTH (4 * EDID_BYTES_PER_BLOCK) 24#define HDMI_EDID_MAX_LENGTH (4 * EDID_BYTES_PER_BLOCK)
25#define HDMI_HDR_INFOFRAME_STOP_TIMEOUT_MS (2000) 25#define HDMI_HDR_INFOFRAME_STOP_TIMEOUT_MS (2000)
26#define HDMI_HPD_DEBOUNCE_WAR_DELAY_MS (4000)
26 27
27/* SCDC block */ 28/* SCDC block */
28#define HDMI_SCDC_TMDS_CONFIG_OFFSET (0x20) 29#define HDMI_SCDC_TMDS_CONFIG_OFFSET (0x20)