Revert "drivers: drm: import minimal changes from xiaomi"

This reverts commit 708e9691535ba6a63433463e677943b321731739.

Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
azrim 2021-09-15 10:27:15 +00:00
parent 316d894c02
commit 5fb6da7b29
No known key found for this signature in database
GPG Key ID: 497F8FB059B45D1C
6 changed files with 3 additions and 154 deletions

View File

@ -18,7 +18,6 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/err.h>
#include <drm/drm_notifier.h>
#include "msm_drv.h"
#include "sde_connector.h"
@ -1062,57 +1061,29 @@ int dsi_display_set_power(struct drm_connector *connector,
{
struct dsi_display *display = disp;
int rc = 0;
struct drm_notify_data g_notify_data;
struct drm_device *dev = NULL;
int event = 0;
if (!display || !display->panel) {
pr_err("invalid display/panel\n");
return -EINVAL;
}
if (!connector || !connector->dev) {
pr_err("invalid connector/dev\n");
return -EINVAL;
} else {
dev = connector->dev;
}
g_notify_data.data = &event;
switch (power_mode) {
case SDE_MODE_DPMS_LP1:
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
rc = dsi_panel_set_lp1(display->panel);
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
break;
case SDE_MODE_DPMS_LP2:
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
rc = dsi_panel_set_lp2(display->panel);
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
break;
case SDE_MODE_DPMS_ON:
if (display->panel->power_mode == SDE_MODE_DPMS_LP1 ||
display->panel->power_mode == SDE_MODE_DPMS_LP2) {
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
display->panel->power_mode == SDE_MODE_DPMS_LP2)
rc = dsi_panel_set_nolp(display->panel);
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
}
break;
case SDE_MODE_DPMS_OFF:
default:
if (dev->pre_state != SDE_MODE_DPMS_LP1 &&
dev->pre_state != SDE_MODE_DPMS_LP2)
break;
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
rc = dsi_panel_set_nolp(display->panel);
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
return rc;
}
dev->pre_state = power_mode;
pr_debug("Power mode transition from %d to %d %s",
display->panel->power_mode, power_mode,
rc ? "failed" : "successful");

View File

@ -16,8 +16,6 @@
#define pr_fmt(fmt) "dsi-drm:[%s] " fmt, __func__
#include <drm/drm_atomic_helper.h>
#include <drm/drm_atomic.h>
#include <drm/drm_notifier.h>
#include <linux/notifier.h>
#include "msm_kms.h"
#include "sde_connector.h"
@ -33,8 +31,6 @@
#define DEFAULT_PANEL_JITTER_ARRAY_SIZE 2
#define DEFAULT_PANEL_PREFILL_LINES 25
static BLOCKING_NOTIFIER_HEAD(drm_notifier_list);
static struct dsi_display_mode_priv_info default_priv_info = {
.panel_jitter_numer = DEFAULT_PANEL_JITTER_NUMERATOR,
.panel_jitter_denom = DEFAULT_PANEL_JITTER_DENOMINATOR,
@ -42,38 +38,6 @@ static struct dsi_display_mode_priv_info default_priv_info = {
.dsc_enabled = false,
};
struct drm_notify_data g_notify_data;
/*
* drm_register_client - register a client notifier
* @nb:notifier block to callback when event happen
*/
int drm_register_client(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&drm_notifier_list, nb);
}
EXPORT_SYMBOL(drm_register_client);
/*
* drm_unregister_client - unregister a client notifier
* @nb:notifier block to callback when event happen
*/
int drm_unregister_client(struct notifier_block *nb)
{
return blocking_notifier_chain_unregister(&drm_notifier_list, nb);
}
EXPORT_SYMBOL(drm_unregister_client);
/*
* drm_notifier_call_chain - notify clients of drm_event
*
*/
int drm_notifier_call_chain(unsigned long val, void *v)
{
return blocking_notifier_call_chain(&drm_notifier_list, val, v);
}
EXPORT_SYMBOL(drm_notifier_call_chain);
static void convert_to_dsi_mode(const struct drm_display_mode *drm_mode,
struct dsi_display_mode *dsi_mode)
{
@ -208,8 +172,6 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
{
int rc = 0;
struct dsi_bridge *c_bridge = to_dsi_bridge(bridge);
int event = DRM_BLANK_UNBLANK;
g_notify_data.data = &event;
if (!bridge) {
pr_err("Invalid params\n");
@ -221,8 +183,6 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
return;
}
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
atomic_set(&c_bridge->display->panel->esd_recovery_pending, 0);
/* By this point mode should have been validated through mode_fixup */
@ -258,9 +218,6 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
c_bridge->id, rc);
(void)dsi_display_unprepare(c_bridge->display);
}
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
SDE_ATRACE_END("dsi_display_enable");
rc = dsi_display_splash_res_cleanup(c_bridge->display);
@ -334,16 +291,12 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
{
int rc = 0;
struct dsi_bridge *c_bridge = to_dsi_bridge(bridge);
int event = DRM_BLANK_POWERDOWN;
g_notify_data.data = &event;
if (!bridge) {
pr_err("Invalid params\n");
return;
}
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
SDE_ATRACE_BEGIN("dsi_bridge_post_disable");
SDE_ATRACE_BEGIN("dsi_display_disable");
rc = dsi_display_disable(c_bridge->display);
@ -363,8 +316,6 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
return;
}
SDE_ATRACE_END("dsi_bridge_post_disable");
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
}
static void dsi_bridge_mode_set(struct drm_bridge *bridge,

View File

@ -471,15 +471,6 @@ exit:
return rc;
}
#if CONFIG_TOUCHSCREEN_COMMON
static bool lcd_reset_keep_high;
void set_lcd_reset_gpio_keep_high(bool en)
{
lcd_reset_keep_high = en;
}
EXPORT_SYMBOL(set_lcd_reset_gpio_keep_high);
#endif
static int dsi_panel_power_off(struct dsi_panel *panel)
{
int rc = 0;
@ -487,18 +478,8 @@ static int dsi_panel_power_off(struct dsi_panel *panel)
if (gpio_is_valid(panel->reset_config.disp_en_gpio))
gpio_set_value(panel->reset_config.disp_en_gpio, 0);
if (gpio_is_valid(panel->reset_config.reset_gpio)) {
#if CONFIG_TOUCHSCREEN_COMMON
if (lcd_reset_keep_high)
pr_warn("%s: lcd-reset-gpio keep high\n", __func__);
else {
gpio_set_value(panel->reset_config.reset_gpio, 0);
pr_err("%s: lcd-reset_gpio = 0\n", __func__);
}
#else
gpio_set_value(panel->reset_config.reset_gpio, 0);
#endif
}
if (gpio_is_valid(panel->reset_config.reset_gpio))
gpio_set_value(panel->reset_config.reset_gpio, 0);
if (gpio_is_valid(panel->reset_config.lcd_mode_sel_gpio))
gpio_set_value(panel->reset_config.lcd_mode_sel_gpio, 0);

View File

@ -206,7 +206,6 @@ struct drm_device {
struct drm_vma_offset_manager *vma_offset_manager;
/*@} */
int switch_power_state;
int pre_state;
};
#endif

View File

@ -1,33 +0,0 @@
#ifndef _DRM_NOTIFIER_H_
#define _DRM_NOTIFIER_H_
/*
* This include file is intended for touch panel that to receive
* blank/unblank event.
*
*/
#define DRM_EARLY_EVENT_BLANK 0x01
#define DRM_EVENT_BLANK 0x02
#define DRM_R_EARLY_EVENT_BLANK 0x03
enum {
DRM_BLANK_UNBLANK = 0,
DRM_BLANK_LP1,
DRM_BLANK_LP2,
DRM_BLANK_STANDBY,
DRM_BLANK_SUSPEND,
DRM_BLANK_POWERDOWN,
};
struct drm_notify_data {
bool is_primary;
void *data;
};
extern int drm_register_client(struct notifier_block *nb);
extern int drm_unregister_client(struct notifier_block *nb);
extern int drm_notifier_call_chain(unsigned long val, void *v);
#endif /*_DRM_NOTIFIER_H*/

View File

@ -20,9 +20,6 @@
/* A hardware display blank early change occurred */
#define MSM_DRM_EARLY_EVENT_BLANK 0x02
#define DRM_EARLY_EVENT_BLANK 0x01
#define DRM_EVENT_BLANK 0x02
enum {
/* panel: power on */
MSM_DRM_BLANK_UNBLANK,
@ -30,15 +27,6 @@ enum {
MSM_DRM_BLANK_POWERDOWN,
};
enum {
DRM_BLANK_UNBLANK = 0,
DRM_BLANK_LP1,
DRM_BLANK_LP2,
DRM_BLANK_STANDBY,
DRM_BLANK_SUSPEND,
DRM_BLANK_POWERDOWN,
};
enum msm_drm_display_id {
/* primary display */
MSM_DRM_PRIMARY_DISPLAY,
@ -52,14 +40,6 @@ struct msm_drm_notifier {
void *data;
};
struct drm_notify_data {
bool is_primary;
void *data;
};
int msm_drm_register_client(struct notifier_block *nb);
int msm_drm_unregister_client(struct notifier_block *nb);
int drm_register_client(struct notifier_block *nb);
int drm_unregister_client(struct notifier_block *nb);
int drm_notifier_call_chain(unsigned long val, void *v);
#endif