diff options
author | Prafull Suryawanshi <prafulls@nvidia.com> | 2017-08-16 06:29:02 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-09 04:28:31 -0400 |
commit | 0a2430de92606fc0b022690177d6a17f19addb62 (patch) | |
tree | 87b86fe50eb11ed4b239dbfa69955a1f277e339a /drivers/video/tegra | |
parent | 77f170a2507f4d40f73c2b41c863fccb988da247 (diff) |
video: tegra: dc: fix multiple HPD in HDCP
This change clears the g_fallback flag only when there
is real HPD. HDCP state machine uses g_fallback to decide
if it has to authenticate 2.2 or 1.4 on this. So it skips
multiple HPD to be notified to userspace. Earlier to this
change, when HDCP authentication falls from 2.2 to 1.4,
it used to send hpd unplug and plug event.
bug 1744655
Change-Id: Idd778cfab918e95b6c8c72ad2a684787e673bd9a
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
(cherry picked from commit c7e6e33e7e7afc1e437f8613e21c673a2fc5b4e7)
Reviewed-on: https://git-master.nvidia.com/r/1595885
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
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/dc.h | 1 | ||||
-rw-r--r-- | drivers/video/tegra/dc/hdcp/hdmihdcp.c | 6 | ||||
-rw-r--r-- | drivers/video/tegra/dc/hdcp/hdmihdcp.h | 2 | ||||
-rw-r--r-- | drivers/video/tegra/dc/hdmi2.0.c | 7 |
4 files changed, 14 insertions, 2 deletions
diff --git a/drivers/video/tegra/dc/dc.h b/drivers/video/tegra/dc/dc.h index 2952d6e73..4ec62158a 100644 --- a/drivers/video/tegra/dc/dc.h +++ b/drivers/video/tegra/dc/dc.h | |||
@@ -637,6 +637,7 @@ struct tegra_dc_out { | |||
637 | int hotplug_gpio; | 637 | int hotplug_gpio; |
638 | int hotplug_state; /* TEGRA_HPD_STATE_* */ | 638 | int hotplug_state; /* TEGRA_HPD_STATE_* */ |
639 | int vrr_hotplug_state; | 639 | int vrr_hotplug_state; |
640 | int prev_hotplug_state; | ||
640 | const char *parent_clk; | 641 | const char *parent_clk; |
641 | 642 | ||
642 | unsigned max_pixclock; | 643 | unsigned max_pixclock; |
diff --git a/drivers/video/tegra/dc/hdcp/hdmihdcp.c b/drivers/video/tegra/dc/hdcp/hdmihdcp.c index bcd07bbbc..619cd84d0 100644 --- a/drivers/video/tegra/dc/hdcp/hdmihdcp.c +++ b/drivers/video/tegra/dc/hdcp/hdmihdcp.c | |||
@@ -1435,6 +1435,11 @@ exit: | |||
1435 | return err; | 1435 | return err; |
1436 | } | 1436 | } |
1437 | 1437 | ||
1438 | void tegra_nvhdcp_clear_fallback(struct tegra_nvhdcp *nvhdcp) | ||
1439 | { | ||
1440 | g_fallback = 0; | ||
1441 | } | ||
1442 | |||
1438 | static void nvhdcp_fallback_worker(struct work_struct *work) | 1443 | static void nvhdcp_fallback_worker(struct work_struct *work) |
1439 | { | 1444 | { |
1440 | struct tegra_nvhdcp *nvhdcp = | 1445 | struct tegra_nvhdcp *nvhdcp = |
@@ -1490,7 +1495,6 @@ static void nvhdcp_downstream_worker(struct work_struct *work) | |||
1490 | } | 1495 | } |
1491 | } | 1496 | } |
1492 | 1497 | ||
1493 | g_fallback = 0; | ||
1494 | 1498 | ||
1495 | nvhdcp_vdbg("%s():started thread %s for sor: %x\n", __func__, | 1499 | nvhdcp_vdbg("%s():started thread %s for sor: %x\n", __func__, |
1496 | nvhdcp->name, nvhdcp->hdmi->sor->ctrl_num); | 1500 | nvhdcp->name, nvhdcp->hdmi->sor->ctrl_num); |
diff --git a/drivers/video/tegra/dc/hdcp/hdmihdcp.h b/drivers/video/tegra/dc/hdcp/hdmihdcp.h index b9be41df9..7bc7d9973 100644 --- a/drivers/video/tegra/dc/hdcp/hdmihdcp.h +++ b/drivers/video/tegra/dc/hdcp/hdmihdcp.h | |||
@@ -78,6 +78,7 @@ struct tegra_nvhdcp { | |||
78 | 78 | ||
79 | #ifdef CONFIG_HDCP | 79 | #ifdef CONFIG_HDCP |
80 | void tegra_nvhdcp_set_plug(struct tegra_nvhdcp *nvhdcp, bool hpd); | 80 | void tegra_nvhdcp_set_plug(struct tegra_nvhdcp *nvhdcp, bool hpd); |
81 | void tegra_nvhdcp_clear_fallback(struct tegra_nvhdcp *nvhdcp); | ||
81 | int tegra_nvhdcp_set_policy(struct tegra_nvhdcp *nvhdcp, int pol); | 82 | int tegra_nvhdcp_set_policy(struct tegra_nvhdcp *nvhdcp, int pol); |
82 | void tegra_nvhdcp_suspend(struct tegra_nvhdcp *nvhdcp); | 83 | void tegra_nvhdcp_suspend(struct tegra_nvhdcp *nvhdcp); |
83 | void tegra_nvhdcp_resume(struct tegra_nvhdcp *nvhdcp); | 84 | void tegra_nvhdcp_resume(struct tegra_nvhdcp *nvhdcp); |
@@ -100,6 +101,7 @@ static inline int tegra_nvhdcp_set_policy(struct tegra_nvhdcp *nvhdcp, int pol) | |||
100 | { | 101 | { |
101 | return 0; | 102 | return 0; |
102 | } | 103 | } |
104 | void tegra_nvhdcp_clear_fallback(struct tegra_nvhdcp *nvhdcp) { } | ||
103 | static inline void tegra_nvhdcp_suspend(struct tegra_nvhdcp *nvhdcp) { } | 105 | static inline void tegra_nvhdcp_suspend(struct tegra_nvhdcp *nvhdcp) { } |
104 | static inline void tegra_nvhdcp_resume(struct tegra_nvhdcp *nvhdcp) { } | 106 | static inline void tegra_nvhdcp_resume(struct tegra_nvhdcp *nvhdcp) { } |
105 | static inline void tegra_nvhdcp_shutdown(struct tegra_nvhdcp *nvhdcp) { } | 107 | static inline void tegra_nvhdcp_shutdown(struct tegra_nvhdcp *nvhdcp) { } |
diff --git a/drivers/video/tegra/dc/hdmi2.0.c b/drivers/video/tegra/dc/hdmi2.0.c index ad2a0d4b3..a26619515 100644 --- a/drivers/video/tegra/dc/hdmi2.0.c +++ b/drivers/video/tegra/dc/hdmi2.0.c | |||
@@ -787,6 +787,10 @@ static void tegra_hdmi_hpd_worker(struct work_struct *work) | |||
787 | connected = tegra_dc_hpd(hdmi->dc); | 787 | connected = tegra_dc_hpd(hdmi->dc); |
788 | orig_state = hdmi->plug_state; | 788 | orig_state = hdmi->plug_state; |
789 | 789 | ||
790 | if (hdmi->dc->out->hotplug_state == TEGRA_HPD_STATE_NORMAL && | ||
791 | hdmi->dc->out->prev_hotplug_state == TEGRA_HPD_STATE_NORMAL) | ||
792 | tegra_nvhdcp_clear_fallback(hdmi->nvhdcp); | ||
793 | |||
790 | if (connected) { | 794 | if (connected) { |
791 | switch (orig_state) { | 795 | switch (orig_state) { |
792 | case TEGRA_HDMI_MONITOR_ENABLE: | 796 | case TEGRA_HDMI_MONITOR_ENABLE: |
@@ -859,6 +863,7 @@ static irqreturn_t tegra_hdmi_hpd_irq_handler(int irq, void *ptr) | |||
859 | if (atomic_read(&hdmi->suspended)) | 863 | if (atomic_read(&hdmi->suspended)) |
860 | return IRQ_HANDLED; | 864 | return IRQ_HANDLED; |
861 | 865 | ||
866 | tegra_nvhdcp_clear_fallback(hdmi->nvhdcp); | ||
862 | cancel_delayed_work(&hdmi->hpd_worker); | 867 | cancel_delayed_work(&hdmi->hpd_worker); |
863 | 868 | ||
864 | if (tegra_edid_get_quirks(hdmi->edid) & | 869 | if (tegra_edid_get_quirks(hdmi->edid) & |
@@ -3376,6 +3381,7 @@ void tegra_hdmi_set_hotplug_state(struct tegra_hdmi *hdmi, int new_hpd_state) | |||
3376 | 3381 | ||
3377 | rmb(); | 3382 | rmb(); |
3378 | hotplug_state = dc->out->hotplug_state; | 3383 | hotplug_state = dc->out->hotplug_state; |
3384 | dc->out->prev_hotplug_state = hotplug_state; | ||
3379 | 3385 | ||
3380 | if (hotplug_state == TEGRA_HPD_STATE_NORMAL && | 3386 | if (hotplug_state == TEGRA_HPD_STATE_NORMAL && |
3381 | new_hpd_state != TEGRA_HPD_STATE_NORMAL && | 3387 | new_hpd_state != TEGRA_HPD_STATE_NORMAL && |
@@ -3389,7 +3395,6 @@ void tegra_hdmi_set_hotplug_state(struct tegra_hdmi *hdmi, int new_hpd_state) | |||
3389 | 3395 | ||
3390 | dc->out->hotplug_state = new_hpd_state; | 3396 | dc->out->hotplug_state = new_hpd_state; |
3391 | wmb(); | 3397 | wmb(); |
3392 | |||
3393 | /* | 3398 | /* |
3394 | * sw controlled plug/unplug. | 3399 | * sw controlled plug/unplug. |
3395 | * wait for any already executing hpd worker thread. | 3400 | * wait for any already executing hpd worker thread. |