Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb845292 authored by tianrunlong's avatar tianrunlong Committed by lio.chen
Browse files

LCD: Remove the bright screen to delay the first underlight

Change-Id: Ic0b98fdddb8d5f439235b6d23f7d6e02a4ddca04
parent 783a8000
Loading
Loading
Loading
Loading
+1 −30
Original line number Diff line number Diff line
@@ -130,9 +130,6 @@ static unsigned int partial_y_offset;
static unsigned int partial_height;
unsigned int seg_id_dbg;

extern bool delay_first_set_backlight;
struct delayed_work set_first_backlight_by_workqueue;

struct logger_buffer {
	char **buffer_ptr;
	unsigned int len;
@@ -141,15 +138,6 @@ struct logger_buffer {
	const unsigned int size;
};

struct brightness_buffer {
	unsigned int level;
	unsigned int panel_ext_param;
	unsigned int cfg_flag;
	struct drm_crtc *crtc;
};

static struct brightness_buffer bl_buffer;

static DEFINE_SPINLOCK(dprec_err_logger_spinlock);
static DEFINE_SPINLOCK(dprec_fence_logger_spinlock);
static DEFINE_SPINLOCK(dprec_dbg_logger_spinlock);
@@ -522,11 +510,6 @@ int mtkfb_set_backlight_level_AOD(unsigned int level)
}
EXPORT_SYMBOL(mtkfb_set_backlight_level_AOD);

void set_first_backlight_work(struct work_struct *work)
{
	mtk_drm_setbacklight(bl_buffer.crtc, bl_buffer.level, bl_buffer.panel_ext_param, bl_buffer.cfg_flag, 1);
}

int __mtkfb_set_backlight_level(unsigned int level, unsigned int panel_ext_param,
			       unsigned int cfg_flag, bool group)
{
@@ -548,18 +531,9 @@ int __mtkfb_set_backlight_level(unsigned int level, unsigned int panel_ext_param

	if (group == true) {
		ret = mtk_drm_setbacklight_grp(crtc, level, panel_ext_param, cfg_flag);
	} else {
		if (delay_first_set_backlight) {
			bl_buffer.level = level;
			bl_buffer.panel_ext_param = panel_ext_param;
			bl_buffer.cfg_flag = cfg_flag;
			bl_buffer.crtc = crtc;
			schedule_delayed_work(&set_first_backlight_by_workqueue, msecs_to_jiffies(35));
			ret = 0;
	} else {
		ret = mtk_drm_setbacklight(crtc, level, panel_ext_param, cfg_flag, 1);
	}
	}

	return ret;
}
@@ -5773,8 +5747,6 @@ void disp_dbg_init(struct drm_device *dev)
	else
		DDPMSG("%s, disp debug init\n", __func__);

	INIT_DELAYED_WORK(&set_first_backlight_by_workqueue, set_first_backlight_work);

	drm_dev = dev;
	init_completion(&cwb_cmp);

@@ -5803,7 +5775,6 @@ void disp_dbg_deinit(void)
#ifdef MTK_DPINFO
	mtk_dp_debugfs_deinit();
#endif
	cancel_delayed_work_sync(&set_first_backlight_by_workqueue);
}

void get_disp_dbg_buffer(unsigned long *addr, unsigned long *size,
+0 −5
Original line number Diff line number Diff line
@@ -118,7 +118,6 @@ struct timespec64 atomic_flush_tval;
struct timespec64 rdma_sof_tval;
static bool hrt_usage_status;
bool hdr_en;
extern bool delay_first_set_backlight;
static const char * const crtc_gce_client_str[] = {
	DECLARE_GCE_CLIENT(DECLARE_STR)};
@@ -1733,10 +1732,6 @@ int mtk_drm_setbacklight(struct drm_crtc *crtc, unsigned int level,
	if (lock)
		DDP_MUTEX_UNLOCK(&mtk_crtc->lock, __func__, __LINE__);
	if (delay_first_set_backlight) {
		delay_first_set_backlight = false;
	}
	CRTC_MMP_EVENT_END(index, backlight, (unsigned long)crtc,
			level);
+0 −4
Original line number Diff line number Diff line
@@ -417,8 +417,6 @@ static struct mtk_drm_property mtk_connector_property[CONNECTOR_PROP_MAX] = {

ktime_t time_start;
s64 elapsed_ms[3] = {0};
bool delay_first_set_backlight = false;
EXPORT_SYMBOL(delay_first_set_backlight);

static u32 underrun_cnt;
module_param(underrun_cnt, uint, 0644);
@@ -3684,8 +3682,6 @@ static void mtk_output_dsi_enable(struct mtk_dsi *dsi,
		return;
	}

	delay_first_set_backlight = true;

	if (dsi->panel) {
		DDP_PROFILE("[PROFILE] %s panel init start\n", __func__);
		if (((!dsi->doze_enabled && !dsi->pending_switch) || force_lcm_update)