summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2020-05-10 01:16:37 +0300
committerMichael Bestas <mkbestas@lineageos.org>2020-05-10 01:16:37 +0300
commit47adfb24dc4eabe3507c89902c5068f501b01b13 (patch)
tree43a9520183d7c5e71f35c4232f5969e03a81e2f2 /drivers/video/fbdev
parent3b67690543369a21fb5338e6d44d2153ab6bad14 (diff)
parent8f2aea5ad6d885f885ca399059fab0424e2fef67 (diff)
Merge tag 'LA.UM.8.4.r1-05400-8x98.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4 into lineage-17.1-caf-msm8998
* tag 'LA.UM.8.4.r1-05400-8x98.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4: msm: mdss: hdcp: reauth on rxstatus ddc read failure msm: mdss: edid: restrain support for interlace video modes fbdev/msm: Modify cdm block destroy sequence msm: mdss: hdmi: fix EDID parser issue msm: mdss: hdmi: clear EDID parsed data msm: mdss: hdmi: reset TMDS_Bit_Clock_Ratio bit fbdev: msm: handle unbalanced TE irq calls android: lowmemorykiller: consider unevictable pages Change-Id: I4fbda9ed9d88134dfdd300696ef7f584544967f1
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.c9
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_edid.c8
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_edid.h3
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c19
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_panel.c9
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.c4
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c9
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_intf_video.c13
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.h21
9 files changed, 72 insertions, 23 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c
index 56edef59f259..3871f58280c8 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.c
+++ b/drivers/video/fbdev/msm/mdss_dsi.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1705,7 +1705,7 @@ static int mdss_dsi_unblank(struct mdss_panel_data *pdata)
mipi->vsync_enable && mipi->hw_vsync_mode) {
mdss_dsi_set_tear_on(ctrl_pdata);
if (mdss_dsi_is_te_based_esd(ctrl_pdata))
- enable_irq(gpio_to_irq(ctrl_pdata->disp_te_gpio));
+ panel_update_te_irq(pdata, true);
}
ctrl_pdata->ctrl_state |= CTRL_STATE_PANEL_INIT;
@@ -1776,9 +1776,8 @@ static int mdss_dsi_blank(struct mdss_panel_data *pdata, int power_state)
if ((pdata->panel_info.type == MIPI_CMD_PANEL) &&
mipi->vsync_enable && mipi->hw_vsync_mode) {
if (mdss_dsi_is_te_based_esd(ctrl_pdata)) {
- disable_irq(gpio_to_irq(
- ctrl_pdata->disp_te_gpio));
- atomic_dec(&ctrl_pdata->te_irq_ready);
+ panel_update_te_irq(pdata, false);
+ atomic_dec(&ctrl_pdata->te_irq_ready);
}
mdss_dsi_set_tear_off(ctrl_pdata);
}
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.c b/drivers/video/fbdev/msm/mdss_hdmi_edid.c
index cb4ef1781dfb..6f0234500d70 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_edid.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2017,2019-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -192,8 +192,10 @@ static bool hdmi_edid_is_mode_supported(struct hdmi_edid_ctrl *edid_ctrl,
return true;
}
-static int hdmi_edid_reset_parser(struct hdmi_edid_ctrl *edid_ctrl)
+int hdmi_edid_reset_parser(void *input)
{
+ struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;
+
if (!edid_ctrl) {
DEV_ERR("%s: invalid input\n", __func__);
return -EINVAL;
@@ -2445,7 +2447,7 @@ int hdmi_edid_parser(void *input)
}
/* reset edid data for new hdmi connection */
- hdmi_edid_reset_parser(edid_ctrl);
+ hdmi_edid_reset_parser(input);
edid_buf = edid_ctrl->edid_buf;
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.h b/drivers/video/fbdev/msm/mdss_hdmi_edid.h
index ae4f47ca42aa..d258aa9f95bc 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_edid.h
+++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2017,2019-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -69,6 +69,7 @@ struct hdmi_edid_override_data {
};
int hdmi_edid_parser(void *edid_ctrl);
+int hdmi_edid_reset_parser(void *edid_ctrl);
u32 hdmi_edid_get_raw_data(void *edid_ctrl, u8 *buf, u32 size);
u8 hdmi_edid_get_sink_scaninfo(void *edid_ctrl, u32 resolution);
bool hdmi_edid_is_dvi_mode(void *input);
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c b/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c
index b922662d25aa..6399be1328e2 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_hdcp2p2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2017,2019-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -740,6 +740,14 @@ static void hdmi_hdcp2p2_recv_msg(struct hdmi_hdcp2p2_ctrl *ctrl)
goto exit;
}
+ if (ddc_data->ddc_max_retries_fail) {
+ pr_debug("rxstatus ddc failed\n");
+
+ ddc_data->ddc_max_retries_fail = false;
+ rc = -ENOLINK;
+ goto exit;
+ }
+
if (ddc_data->reauth_req) {
ddc_data->reauth_req = false;
@@ -897,6 +905,15 @@ static void hdmi_hdcp2p2_link_work(struct kthread_work *work)
ddc_data = &ddc_ctrl->hdcp2p2_ddc_data;
+ if (ddc_data->ddc_max_retries_fail) {
+ pr_debug("rxstatus ddc failed\n");
+
+ ddc_data->ddc_max_retries_fail = false;
+ rc = -ENOLINK;
+ cdata.cmd = HDCP_LIB_WKUP_CMD_STOP;
+ goto exit;
+ }
+
if (ddc_data->reauth_req) {
pr_debug("reauth triggered by sink\n");
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_panel.c b/drivers/video/fbdev/msm/mdss_hdmi_panel.c
index 20afa08155c1..f0447116539f 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_panel.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_panel.c
@@ -797,6 +797,15 @@ static int hdmi_panel_setup_scrambler(struct hdmi_panel *panel)
rc = hdmi_setup_ddc_timers(panel->ddc,
HDMI_TX_DDC_TIMER_SCRAMBLER_STATUS, timeout_hsync);
} else {
+ tmds_clock_ratio = 0;
+ rc = hdmi_scdc_write(panel->ddc,
+ HDMI_TX_SCDC_TMDS_BIT_CLOCK_RATIO_UPDATE,
+ tmds_clock_ratio);
+ if (rc) {
+ pr_err("TMDS CLK RATIO ERR\n");
+ return rc;
+ }
+
hdmi_scdc_write(panel->ddc,
HDMI_TX_SCDC_SCRAMBLING_ENABLE, 0x0);
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
index 79a6a16d4fed..b70937a8f5fe 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2017,2019-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -3517,6 +3517,8 @@ static void hdmi_tx_hpd_off(struct hdmi_tx_ctrl *hdmi_ctrl)
hdmi_ctrl->hpd_off_pending = false;
hdmi_ctrl->dc_support = false;
+ hdmi_edid_reset_parser(hdmi_tx_get_fd(HDMI_TX_FEAT_EDID));
+
DEV_DBG("%s: HPD is now OFF\n", __func__);
} /* hdmi_tx_hpd_off */
diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c b/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c
index 83ab9c3973af..b46e955f280b 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -2099,7 +2099,7 @@ static int mdss_mdp_cmd_wait4pingpong(struct mdss_mdp_ctl *ctl, void *arg)
struct mdss_mdp_cmd_ctx *ctx;
struct mdss_panel_data *pdata;
unsigned long flags;
- int rc = 0, te_irq;
+ int rc = 0;
ctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[MASTER_CTX];
if (!ctx) {
@@ -2155,8 +2155,7 @@ static int mdss_mdp_cmd_wait4pingpong(struct mdss_mdp_ctl *ctl, void *arg)
atomic_read(&ctx->koff_cnt));
/* enable TE irq to check if it is coming from the panel */
- te_irq = gpio_to_irq(pdata->panel_te_gpio);
- enable_irq(te_irq);
+ panel_update_te_irq(pdata, true);
/* wait for 20ms to ensure we are getting the next TE */
usleep_range(20000, 20010);
@@ -2179,7 +2178,7 @@ static int mdss_mdp_cmd_wait4pingpong(struct mdss_mdp_ctl *ctl, void *arg)
}
/* disable te irq */
- disable_irq_nosync(te_irq);
+ panel_update_te_irq(pdata, false);
ctx->pp_timeout_report_cnt++;
rc = -EPERM;
diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
index 29fe0f861593..3761fa4af0eb 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
@@ -1097,13 +1097,6 @@ static int mdss_mdp_video_stop(struct mdss_mdp_ctl *ctl, int panel_power_state)
{
int intfs_num, ret = 0;
- if (ctl->cdm) {
- if (!mdss_mdp_cdm_destroy(ctl->cdm))
- mdss_mdp_ctl_write(ctl,
- MDSS_MDP_REG_CTL_FLUSH, BIT(26));
- ctl->cdm = NULL;
- }
-
intfs_num = ctl->intf_num - MDSS_MDP_INTF0;
ret = mdss_mdp_video_intfs_stop(ctl, ctl->panel_data, intfs_num);
if (IS_ERR_VALUE(ret)) {
@@ -1111,6 +1104,12 @@ static int mdss_mdp_video_stop(struct mdss_mdp_ctl *ctl, int panel_power_state)
return ret;
}
+ if (ctl->cdm) {
+ if (!mdss_mdp_cdm_destroy(ctl->cdm))
+ mdss_mdp_ctl_write(ctl,
+ MDSS_MDP_REG_CTL_FLUSH, BIT(26));
+ ctl->cdm = NULL;
+ }
MDSS_XLOG(ctl->num, ctl->vsync_cnt);
mdss_mdp_ctl_reset(ctl, false);
diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h
index 767b6e631d78..2dcd038aa393 100644
--- a/drivers/video/fbdev/msm/mdss_panel.h
+++ b/drivers/video/fbdev/msm/mdss_panel.h
@@ -19,6 +19,9 @@
#include <linux/stringify.h>
#include <linux/types.h>
#include <linux/debugfs.h>
+#include <linux/of_gpio.h>
+#include <linux/gpio.h>
+#include <linux/interrupt.h>
/* panel id type */
struct panel_id {
@@ -1015,6 +1018,7 @@ struct mdss_panel_data {
bool panel_disable_mode;
int panel_te_gpio;
+ bool is_te_irq_enabled;
struct completion te_done;
};
@@ -1026,6 +1030,23 @@ struct mdss_panel_debugfs_info {
struct mdss_panel_debugfs_info *next;
};
+static inline void panel_update_te_irq(struct mdss_panel_data *pdata,
+ bool enable)
+{
+ if (!pdata) {
+ pr_err("Invalid Params\n");
+ return;
+ }
+
+ if (enable && !pdata->is_te_irq_enabled) {
+ enable_irq(gpio_to_irq(pdata->panel_te_gpio));
+ pdata->is_te_irq_enabled = true;
+ } else if (!enable && pdata->is_te_irq_enabled) {
+ disable_irq(gpio_to_irq(pdata->panel_te_gpio));
+ pdata->is_te_irq_enabled = false;
+ }
+}
+
/**
* mdss_get_panel_framerate() - get panel frame rate based on panel information
* @panel_info: Pointer to panel info containing all panel information