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

Commit 3fbfdd61 authored by jialongjhan's avatar jialongjhan
Browse files

Change LCM to command mode

Rootcause:
LCM module has a ram(HX83112"B"),
therefore it can enable command mode.
But LK is not suppor command mode.
So I need to reflash screen manually.
According to HW and Vendor said, it is helpful for power saving.

Howtofix:
Vendor said, the initial code is already command mode,
and it can support video and command mode.
if we choose command mode, Peripherals(LCM)'s timing is
unchangeable, so host need to cooperate it,
That's why I add delay timer in back light control function.
I want to cover fuzzy screen.

I also add a reflash screen function,
if bootlogo or menu or key has changed or triggered,
we will use it to reflash screen.

Panel mode of LCM drivers in lk and kernel have to consistent.

Because command mode needs TE pin to return information of receive.
if someone unplug LCM and using Vysor, its performance is slowly.
Therefore, I suggest user swap to video mode using adb commands
as below:

//1. goto fast boot mode
adb reboot bootloader

//2-1. choose video mode
fastboot oem select-display-panel truly_hx83112b_1080p_video

//2-2. choose command mode
fastboot oem select-display-panel djn_hx83112b_1080p_cmd

//3. check mode has changed then reboot
fastboot oem device-info
fastboot reboot

RiskArea:
LCM

Change-Id: I969bcd67d6029fd40eba6b29bcb1dbffa50a62e5
parent 17207ef9
Loading
Loading
Loading
Loading
+93 −0
Original line number Diff line number Diff line
/* Copyright (c) 2017, 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
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

&mdss_mdp {
	dsi_djn_hx83112b_1080p_cmd: qcom,mdss_dsi_djn_hx83112b_1080p_cmd {
		qcom,mdss-dsi-panel-name =
				"djn hx83112b 1080p cmd mode dsi panel";
        	//[Arima][8901][JialongJhan] enable LCM Command mode 20190403 Start
		qcom,mdss-dsi-panel-type = "dsi_cmd_mode";
		//[Arima][8901][JialongJhan] enable LCM Command mode 20190403 End
		qcom,mdss-dsi-panel-framerate = <60>;
		qcom,mdss-dsi-virtual-channel-id = <0>;
		qcom,mdss-dsi-stream = <0>;
		qcom,mdss-dsi-panel-width = <1080>;
		qcom,mdss-dsi-panel-height = <2160>;
		qcom,mdss-dsi-h-front-porch = <40>;
		qcom,mdss-dsi-h-back-porch = <12>;
		qcom,mdss-dsi-h-pulse-width = <4>;
		qcom,mdss-dsi-h-sync-skew = <0>;
		qcom,mdss-dsi-v-back-porch = <2>;
		qcom,mdss-dsi-v-front-porch = <32>;
		qcom,mdss-dsi-v-pulse-width = <2>;
		qcom,mdss-dsi-h-left-border = <0>;
		qcom,mdss-dsi-h-right-border = <0>;
		qcom,mdss-dsi-v-top-border = <0>;
		qcom,mdss-dsi-v-bottom-border = <0>;
		qcom,mdss-dsi-bpp = <24>;
		qcom,mdss-dsi-underflow-color = <0xff>;
		qcom,mdss-dsi-border-color = <0>;
		//[Arima][8901][JialongJhan] enable LCM Command mode 20190403 Start
		qcom,mdss-dsi-te-pin-select = <1>;
		qcom,mdss-dsi-te-dcs-command = <1>;
		qcom,mdss-dsi-te-check-enable;
		qcom,mdss-dsi-te-using-te-pin;
		//[Arima][8901][JialongJhan] enable LCM Command mode 20190403 End
		//Qcom
		qcom,mdss-tear-check-sync-init-val = <2160>;
		qcom,mdss-tear-check-sync-threshold-start = <4>;
		qcom,mdss-tear-check-sync-threshold-continue = <4>;
		qcom,mdss-tear-check-start-pos = <2160>;
		//Qcom
		qcom,mdss-dsi-h-sync-pulse = <0>;
		qcom,mdss-dsi-traffic-mode = "burst_mode";
		qcom,mdss-dsi-bllp-eof-power-mode;
		qcom,mdss-dsi-bllp-power-mode;
		qcom,mdss-dsi-lane-0-state;
		qcom,mdss-dsi-lane-1-state;
		qcom,mdss-dsi-lane-2-state;
		qcom,mdss-dsi-lane-3-state;
		//qcom,mdss-dsi-hfp-power-mode;
		//qcom,mdss-dsi-hbp-power-mode;
		qcom,mdss-dsi-hsa-power-mode;
		qcom,mdss-pan-physical-width-dimension=<65>;
		qcom,mdss-pan-physical-height-dimension=<128>;
		qcom,mdss-dsi-panel-timings = [e6 38 26 00 68 6e 2a
				3c 44 03 04 00];
		qcom,mdss-dsi-t-clk-post = <0x0d>;
		qcom,mdss-dsi-t-clk-pre = <0x2f>;
		qcom,mdss-dsi-bl-min-level = <1>;
		qcom,mdss-dsi-bl-max-level = <4095>;
		qcom,mdss-dsi-dma-trigger = "trigger_sw";
		qcom,mdss-dsi-mdp-trigger = "none";
		//[Arima][8901][Jialong]LCM initial code from IC firmware Start
		qcom,mdss-dsi-on-command = [
			05 01 00 00 78 00 02 11 00
			05 01 00 00 14 00 02 29 00
			39 01 00 00 00 00 03 51 00 00
			39 01 00 00 00 00 02 53 24];
		//[Arima][8901][Jialong]LCM initial code from IC firmware End
		qcom,mdss-dsi-off-command = [05 01 00 00 14 00 02 28 00
				 05 01 00 00 78 00 02 10 00];
		qcom,mdss-dsi-off-dstb-command = [
                                 39 01 00 00 00 00 04 B9 83 11 2A
				 39 01 00 00 00 00 02 BD 00
				 39 01 00 00 50 00 02 B1 09];
		qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
		qcom,mdss-dsi-off-command-state = "dsi_lp_mode";
		qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
		qcom,mdss-dsi-reset-sequence = <1 10>, <0 10>, <1 10>;
		qcom,mdss-dsi-tx-eot-append;
		qcom,mdss-dsi-lp11-init;
		qcom,mdss-dsi-post-init-delay = <1>;
	};
};
+23 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include "dsi-panel-inxnt51021-1200p-video.dtsi"
/*[Arima_8901][Jialong] lcm driver porting begin*/
#include "dsi-hx83112b-truly-1080p-video.dtsi"
#include "dsi-hx83112b-djn-1080p-cmd.dtsi"
/*[Arima_8901][Jialong] lcm driver porting end*/

&soc {
@@ -96,6 +97,28 @@
};
/*[Arima_8901][Jialong] lcm driver porting end*/

//[Arima][8901][JialongJhan] Command mode 20190516 Start
&dsi_djn_hx83112b_1080p_cmd {
	qcom,mdss-dsi-panel-timings-phy-v2 = [24 1e 08 09 05 03 04 a0
		24 1e 08 09 05 03 04 a0
		24 1e 08 09 05 03 04 a0
		24 1e 08 09 05 03 04 a0
		24 1a 08 09 05 03 04 a0];
	qcom,mdss-dsi-min-refresh-rate = <48>;
	qcom,mdss-dsi-max-refresh-rate = <60>;
	qcom,mdss-dsi-pan-enable-dynamic-fps;
	qcom,mdss-dsi-pan-fps-update = "dfps_immediate_porch_mode_vfp";
	//qcom,esd-check-enabled;
	//qcom,mdss-dsi-panel-status-check-mode = "reg_read";
	//qcom,mdss-dsi-panel-status-command = [06 01 00 01 00 00 01 0a];
	qcom,mdss-dsi-panel-status-command-state = "dsi_hs_mode";
	//qcom,mdss-dsi-panel-status-value = <0x9c>;
	//qcom,mdss-dsi-panel-on-check-value = <0x9c>;
	//qcom,mdss-dsi-panel-status-read-length = <1>;
	//qcom,mdss-dsi-panel-max-error-count = <3>;
};
//[Arima][8901][JialongJhan] Command mode 20190516 End

&dsi_truly_1080_vid {
	qcom,mdss-dsi-panel-timings-phy-v2 = [23 1e 08 09 05 03 04 a0
		23 1e 08 09 05 03 04 a0
+11 −1
Original line number Diff line number Diff line
@@ -143,7 +143,10 @@
/*[Arima_8901][Jialong] lcm driver porting begin*/
&mdss_dsi0 {
	#if 1
	qcom,dsi-pref-prim-pan = <&dsi_hx83112b_truly_1080p_video>;
	//[Arima][8901][JialongJhan] Command mode 20190516 Start
	qcom,dsi-pref-prim-pan = <&dsi_djn_hx83112b_1080p_cmd>;
	//qcom,dsi-pref-prim-pan = <&dsi_hx83112b_truly_1080p_video>;
	//[Arima][8901][JialongJhan] Command mode 20190516 End
	#else
	qcom,dsi-pref-prim-pan = <&dsi_truly_1080_vid>;
	#endif
@@ -179,6 +182,13 @@
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;
};

&dsi_djn_hx83112b_1080p_cmd {
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_dcs";
	qcom,mdss-dsi-bl-min-level = <1>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;
};
/*[Arima_8901][Jialong] lcm driver porting end*/

&dsi_truly_1080_vid {
+4 −0
Original line number Diff line number Diff line
@@ -864,6 +864,10 @@ static void mdss_dsi_panel_bl_ctrl(struct mdss_panel_data *pdata,
    }
    /*[Arima_8901][Jialongjhan] Expose display revision 20190326 end*/

    //[Arima][8901][JialongJhan] Command mode debug fuzzy screen 20190516 Start
    mdelay(1);
    //[Arima][8901][JialongJhan] Command mode debug fuzzy screen 20190516 End

	/*
	 * Some backlight controllers specify a minimum duty cycle
	 * for the backlight brightness. If the brightness is less