summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/android/lowmemorykiller.c3
-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
-rw-r--r--include/uapi/video/msm_hdmi_modes.h10
11 files changed, 80 insertions, 28 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index 80070f67a895..ee4c11b4e164 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -294,6 +294,7 @@ static int lmk_vmpressure_notifier(struct notifier_block *nb,
if (pressure >= 95) {
other_file = global_page_state(NR_FILE_PAGES) + zcache_pages() -
global_page_state(NR_SHMEM) -
+ global_page_state(NR_UNEVICTABLE) -
total_swapcache_pages();
other_free = global_page_state(NR_FREE_PAGES);
@@ -307,6 +308,7 @@ static int lmk_vmpressure_notifier(struct notifier_block *nb,
other_file = global_page_state(NR_FILE_PAGES) + zcache_pages() -
global_page_state(NR_SHMEM) -
+ global_page_state(NR_UNEVICTABLE) -
total_swapcache_pages();
other_free = global_page_state(NR_FREE_PAGES);
@@ -319,6 +321,7 @@ static int lmk_vmpressure_notifier(struct notifier_block *nb,
} else if (atomic_read(&shift_adj)) {
other_file = global_page_state(NR_FILE_PAGES) + zcache_pages() -
global_page_state(NR_SHMEM) -
+ global_page_state(NR_UNEVICTABLE) -
total_swapcache_pages();
other_free = global_page_state(NR_FREE_PAGES);
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c
index c2cfc8e0532e..cc5f21131809 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
@@ -1704,7 +1704,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;
@@ -1775,9 +1775,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 1e0ae618b501..200acc5e61aa 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 {
@@ -1010,6 +1013,7 @@ struct mdss_panel_data {
bool panel_disable_mode;
int panel_te_gpio;
+ bool is_te_irq_enabled;
struct completion te_done;
};
@@ -1021,6 +1025,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
diff --git a/include/uapi/video/msm_hdmi_modes.h b/include/uapi/video/msm_hdmi_modes.h
index 5b4b2b492be4..1a8fbabe0d81 100644
--- a/include/uapi/video/msm_hdmi_modes.h
+++ b/include/uapi/video/msm_hdmi_modes.h
@@ -271,13 +271,13 @@ struct msm_hdmi_mode_timing_info {
720, 5, 5, 20, false, 74250, 60000, false, true, HDMI_RES_AR_16_9, 0}
#define HDMI_VFRMT_1920x1080i60_16_9_TIMING \
{HDMI_VFRMT_1920x1080i60_16_9, 1920, 88, 44, 148, false, \
- 540, 2, 5, 5, false, 74250, 60000, true, true, HDMI_RES_AR_16_9, 0}
+ 540, 2, 5, 5, false, 74250, 60000, true, false, HDMI_RES_AR_16_9, 0}
#define HDMI_VFRMT_1440x480i60_4_3_TIMING \
{HDMI_VFRMT_1440x480i60_4_3, 1440, 38, 124, 114, true, \
- 240, 4, 3, 15, true, 27000, 60000, true, true, HDMI_RES_AR_4_3, 0}
+ 240, 4, 3, 15, true, 27000, 60000, true, false, HDMI_RES_AR_4_3, 0}
#define HDMI_VFRMT_1440x480i60_16_9_TIMING \
{HDMI_VFRMT_1440x480i60_16_9, 1440, 38, 124, 114, true, \
- 240, 4, 3, 15, true, 27000, 60000, true, true, HDMI_RES_AR_16_9, 0}
+ 240, 4, 3, 15, true, 27000, 60000, true, false, HDMI_RES_AR_16_9, 0}
#define HDMI_VFRMT_1920x1080p60_16_9_TIMING \
{HDMI_VFRMT_1920x1080p60_16_9, 1920, 88, 44, 148, false, \
1080, 4, 5, 36, false, 148500, 60000, false, true, HDMI_RES_AR_16_9, 0}
@@ -292,10 +292,10 @@ struct msm_hdmi_mode_timing_info {
720, 5, 5, 20, false, 74250, 50000, false, true, HDMI_RES_AR_16_9, 0}
#define HDMI_VFRMT_1440x576i50_4_3_TIMING \
{HDMI_VFRMT_1440x576i50_4_3, 1440, 24, 126, 138, true, \
- 288, 2, 3, 19, true, 27000, 50000, true, true, HDMI_RES_AR_4_3, 0}
+ 288, 2, 3, 19, true, 27000, 50000, true, false, HDMI_RES_AR_4_3, 0}
#define HDMI_VFRMT_1440x576i50_16_9_TIMING \
{HDMI_VFRMT_1440x576i50_16_9, 1440, 24, 126, 138, true, \
- 288, 2, 3, 19, true, 27000, 50000, true, true, HDMI_RES_AR_16_9, 0}
+ 288, 2, 3, 19, true, 27000, 50000, true, false, HDMI_RES_AR_16_9, 0}
#define HDMI_VFRMT_1920x1080p50_16_9_TIMING \
{HDMI_VFRMT_1920x1080p50_16_9, 1920, 528, 44, 148, false, \
1080, 4, 5, 36, false, 148500, 50000, false, true, HDMI_RES_AR_16_9, 0}