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

Commit 070d776e authored by xieshuangshuang's avatar xieshuangshuang Committed by hecaiqiang
Browse files

Fix white line issue

Change-Id: Id1b89e8a778879bdbd1fe9a825b0cd4d87917fe6
(cherry picked from commit 6d125bc3281fe158e43a549f12f332dbd7e58a68)
parent e18b22b6
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -975,6 +975,7 @@ int oneplus_panel_alpha =0;
int oneplus_force_screenfp = 0;
int op_dimlayer_bl_enable = 0;
int op_dp_enable = 0;
int op_dither_enable = 0;
extern int oneplus_get_panel_brightness_to_alpha(void);

static ssize_t oneplus_display_get_dim_alpha(struct device *dev,
@@ -1042,6 +1043,21 @@ static ssize_t op_display_set_dimlayer_enable(struct device *dev,
	return count;
}

static ssize_t op_display_get_dither_enable(struct device *dev,
				struct device_attribute *attr, char *buf)
{
	return sprintf(buf, "%d\n", op_dither_enable);
}

static ssize_t op_display_set_dither_enable(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{
	sscanf(buf, "%d", &op_dither_enable);

	return count;
}

static ssize_t op_display_get_dp_enable(struct device *dev,
				struct device_attribute *attr, char *buf)
{
@@ -1100,6 +1116,7 @@ static DEVICE_ATTR(notify_dim, S_IRUGO|S_IWUSR, NULL, oneplus_display_notify_dim
static DEVICE_ATTR(notify_aod, S_IRUGO|S_IWUSR, NULL, oneplus_display_notify_aod_hid);
static DEVICE_ATTR(dimlayer_bl_en, S_IRUGO|S_IWUSR, op_display_get_dimlayer_enable, op_display_set_dimlayer_enable);
static DEVICE_ATTR(dp_en, S_IRUGO|S_IWUSR, op_display_get_dp_enable, op_display_set_dp_enable);
static DEVICE_ATTR(dither_en, S_IRUGO|S_IWUSR, op_display_get_dither_enable, op_display_set_dither_enable);

static struct attribute *connector_dev_attrs[] = {
	&dev_attr_status.attr,
@@ -1133,6 +1150,7 @@ static struct attribute *connector_dev_attrs[] = {
	&dev_attr_notify_aod.attr,
	&dev_attr_dimlayer_bl_en.attr,
	&dev_attr_dp_en.attr,
	&dev_attr_dither_en.attr,
	NULL
};

+7 −1
Original line number Diff line number Diff line
@@ -8048,6 +8048,7 @@ int dsi_display_get_acl_mode(struct drm_connector *connector)
	return dsi_display->panel->acl_mode;
}

int op_resolution = 0;
int dsi_display_get_gamma_para(struct dsi_display *dsi_display, struct dsi_panel *panel)
{
    int i = 0;
@@ -8252,7 +8253,12 @@ int dsi_display_get_gamma_para(struct dsi_display *dsi_display, struct dsi_panel
        pr_err("Failed to send DSI_CMD_SET_GAMMA_OTP_READ_C9_SMRPS command\n");
        goto error;
    }
    pr_err("Read 90hz gamma done\n");
    if(panel->cur_mode->timing.h_active == 1440){
        op_resolution = 2;
    }else if(panel->cur_mode->timing.h_active == 1080){
        op_resolution = 1;
    }
    pr_err("Read 90hz gamma done op_resolution = %d\n",op_resolution);

error:
    dsi_panel_release_panel_lock(panel);
+7 −2
Original line number Diff line number Diff line
@@ -4346,7 +4346,7 @@ int dsi_panel_send_roi_dcs(struct dsi_panel *panel, int ctrl_idx,

	return rc;
}

extern int op_resolution;
int dsi_panel_switch(struct dsi_panel *panel)
{
	int rc = 0;
@@ -4365,7 +4365,12 @@ int dsi_panel_switch(struct dsi_panel *panel)
		pr_err("[%s] Failed to send DSI_CMD_SET_TIMING_SWITCH cmds, rc=%d\n",
		       panel->name, rc);
	pr_err("Send DSI_CMD_SET_TIMING_SWITCH cmds\n");
	pr_err("panel->cur_mode->timing->h_active = %d\n", panel->cur_mode->timing.h_active);
	if(panel->cur_mode->timing.h_active == 1440){
		op_resolution = 2;
	}else if(panel->cur_mode->timing.h_active == 1080){
		op_resolution = 1;
	}
	pr_err("panel->cur_mode->timing->h_active = %d op_resolution = %d\n", panel->cur_mode->timing.h_active,op_resolution);
	if((strcmp(panel->name, "samsung dsc cmd mode oneplus dsi panel") == 0) && (gamma_read_flag == GAMMA_READ_SUCCESS)) {
		if (mode_fps == 90) {
			rc = dsi_panel_tx_gamma_cmd_set(panel, DSI_GAMMA_CMD_SET_SWITCH_90HZ);
+17 −5
Original line number Diff line number Diff line
@@ -4037,6 +4037,9 @@ void sde_encoder_trigger_kickoff_pending(struct drm_encoder *drm_enc)
	sde_enc->idle_pc_restore = false;
}

extern int op_dither_enable;
extern int op_dimlayer_bl_enable;
extern int op_resolution;
extern bool sde_crtc_get_dimlayer_mode(struct drm_crtc_state *crtc_state);
static bool
_sde_encoder_setup_dither_for_onscreenfingerprint(struct sde_encoder_phys *phys,struct sde_hw_pingpong *hw_pp,
@@ -4055,11 +4058,20 @@ _sde_encoder_setup_dither_for_onscreenfingerprint(struct sde_encoder_phys *phys,
 return -EINVAL;

 memcpy(&dither, dither_cfg, len);

 if((!op_dither_enable && !op_dimlayer_bl_enable && op_resolution == 2 ) || op_resolution == 1){
	dither.c0_bitdepth = 8;
 dither.c1_bitdepth = 6;
	dither.c1_bitdepth = 8;
	dither.c2_bitdepth = 8;
	dither.c3_bitdepth = 8;
	dither.temporal_en = 1;
 }else {
	dither.c0_bitdepth = 6;
	dither.c1_bitdepth = 6;
	dither.c2_bitdepth = 6;
	dither.c3_bitdepth = 6;
	dither.temporal_en = 1;
 }

 phys->hw_pp->ops.setup_dither(hw_pp, &dither, len);