Commit graph

2,227 commits

Author SHA1 Message Date
houdz1
eb4eb54d41 dsi_panel: Add support the state of the touch screen
Touch have a feature named "single tap".
    1. When the feature enbled, we can not power down panel,
        and keep rest signal high.
    2. When the feature disabled, the touch state is  0, Instead,
        the touch state is 1.
    3. Touch driver will call set() function to set the touch state,
        And panel driver will call check() function to check  state.

Change-Id: I034909007678ae940769ec8e350518185cc5fad3
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1784647
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: litong <litong20@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:49 +08:00
houdz1
1339782e2c Revert "(CR) dsi: pushing display notifications"
This reverts commit 2da822bf859e4c166c09706f62292a657273104e.
From Kernel-5.4, Send panel_notify at msm_atomic.c.
So do not add this old notify method.
Mot-CRs-fixed: (CR)

Change-Id: I16778dc0a404b1ab20e59bc73a40d32385bdc01b
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1783211
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:49 +08:00
shuoyan
692f073552 msm/dsi: add backlight debug log when panel is off
There have few cases which no brightnes when panel on.
Add more backlight logs to debug this issue.

Change-Id: I2c25f15f1617f894ecb84efc7c15340cbfc89ad5
Reviewed-on: https://gerrit.mot.com/1783198
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Shuo Yan <shuoyan@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:49 +08:00
daiss1
ea3e3a4d0c msm/dsi:Modify judgment conditions,add judgments hbm2.
HBM 1 and HBM2 are assigned as HBM on.
When HBM is off, the value is HBM off.

Change-Id: Iacf17b60725dfe1d2cc2f7206063b81e2e7e98aa
Reviewed-on: https://gerrit.mot.com/1783197
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:49 +08:00
zhanggb
e2b72b2548 dsi: fix motUtil mipi read error
MIPI_DSI_MSG_READ in msg.flags caused dsi panel detect error. Thus
motUtil mipi read block somewhere. Remove it.

Change-Id: I41efade780574893408190bf43b626fbf3b97856
Reviewed-on: https://gerrit.mot.com/1783186
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:49 +08:00
shuoyan
e63a7de99a disp:msm:dsi:add support to config dsi PHY Driver Strength
Hardware team required to set ordered DSI driver strength for
different DSI PHY.

Add support to config DSI PHY driver strength from DTSI config.

Change-Id: I60c5ee335c897d3f20dde42114798c15576cf32e
Reviewed-on: https://gerrit.mot.com/1783170
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
26fc3c214a dsi_panel: fix out-of-bounds issue
PROPAGATED_from (CR)

Before make the read operation, malloc the space of rx_buf.
To avoid the out-of-bounds  issue.

Change-Id: If5debbae4957845bf6bd35f9f81eaca79faa54e5
Reviewed-on: https://gerrit.mot.com/1782951
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
4a042b2f3f sde: limit the backlight minimum brightness as bl_min_level
PROPAGATED_from (CR)

High-precision brightness will set the brightness level from bl_min_level to
bl_max_level. If we enable 12bit brightness, in fact, the hardware will not
tolerate very low brightness, these levels cause the backlight unstable.

So we have to define the minimum brightness by 'qcom,mdss-dsi-bl-min-level'
that the driver does not set the backlight level below that.

Change-Id: Ifa20a92388c6dab20cf5550868f3f3685815936f
Reviewed-on: https://gerrit.mot.com/1782945
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
07544a623a dsi_display: add bl logs for panel resume and suspend
PROPAGATED_from (CR)

add bl logs for panel resume and suspend.
That we can check some "no display" issue.

Change-Id: I9ecbe59a3ce8931e81edb2f54aa66499995a9a7e
Reviewed-on: https://gerrit.mot.com/1782943
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
shuoyan
07b3e66569 drm/msm: Support Moto Panel param for dual panels
PROPAGATED from (CR)

Panel is black when HBM trigger.
The reason is CLI HBM commond set send to Primary Display.
Fix MOT`s panel param so it can support dual panels

Change-Id: Iaa4a0c974740571347a810d2517adcb830cb7795
Reviewed-on: https://gerrit.mot.com/1782933
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
shuoyan
1fd102ea73 disp: msm: prevent ESD recovery till all panel dead
PROPAGATED from (CR)

Device reboot when CLI panel dead
Quality team hopes Device still alive when one panel dead.

Modify the ESD recovery policy that reboot all when all
display dead.

Change-Id: I78ca19de9723c00416ea43457b6750b7a765c08f
Reviewed-on: https://gerrit.mot.com/1782924
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
daiss1
3b2c72bc4a msm/dsi: add hbm debug log
Modify:
add backlight and hbm debug log

Change-Id: Ia7fe154887ad152984ccf451729b7615eee8e63f
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1782235
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
e65d196c2a Display PanelMode: Add CABC control
Add CABC control interface for video mode panel. This interface is
also used by sde connector property.
port of : 09a47b9fa

Change-Id: Id3170799333bc7852c1b92895bd016fda13d580c
Reviewed-on: https://gerrit.mot.com/1782225
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
b6d3acff9c fixup! (CR): disp: msm:: reset the param value to the default value
This code is pick from the project with Android-p,
But there is a code error when make propagation from the previous project.
We must reset the param after panel enabled every time.

Mot-CRs-fixed: (CR)

Signed-off-by: houdz1 <houdz1@motorola.com>
Change-Id: I164c5bd1dcb89bfcf07627eb2455db0fc9d184b6
Reviewed-on: https://gerrit.mot.com/1782141
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
3d950a806b dsi_panel: remove the unused file
This file is included from 534dfd90e.
This is a unused file.So remove it.

Change-Id: I50b1c12a515808379c7edc18d6f6b360eaccef05
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1782130
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
5cec1a05fc drm: mipi: Disable the MIPI DSI commands 0x2E and 0x3E
For the Secure UI feature, the display feature, which allows host to
read-back its internal memory buffer, should be disable. The MIPI DSI
command 0x2E (read_memory_start) and 0x3E (read_memory_continue) will
be disable.

For the kernel-4.19, this is changed at drm_mipi_dsi.c.
https://gerrit.mot.com/#/c/1444417.
For the kernel-5.4 and android-R, it is not a better way to modify common
code of drm. So we move this changes to msm/dsi/dsi_ctrl.c

Change-Id: Ib41ef05902267fe6b996b46b4e3182824d961295
Signed-off-by: houdz1 <houdz1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1780712
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
daiss1
d2c3fc0118 fixup! (CR): disp: msm: Support "te_chk_reg_rd" for panel's ESD
Change-Id: I3e47e7b56dbb3ea94b12b962d944966284ae0e4d
Reviewed-on: https://gerrit.mot.com/1729480
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Submit-Approved: Jira Key
Tested-by: Jira Key
Reviewed-by: Qiang Nie <nieqiang@motorola.com>
2023-05-06 10:01:48 +08:00
nieqiang
02e876c533 msm: modify dsi_display_status_check_te,fix rebase error
Fix rebase error
Modify dsi_display_status_check_te

Change-Id: I18a7418f7f827557eb1473e1c7cbf5ea32e102d7
Signed-off-by: nieqiang <nieqiang@motorola.com>
Reviewed-on: https://gerrit.mot.com/1728082
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Submit-Approved: Jira Key
Tested-by: Jira Key
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
2023-05-06 10:01:48 +08:00
daiss1
4e28bf8e23 disp: msm: Correct DSC 1.1 Rate control for Max val
Correct the DSC 1.1 Rate control for Max QP values for each ratio type
in dsi_dsc_ratio_type

Change-Id: I75092e1a40213be80c74292e8c20cd332d582910
Signed-off-by: daiss1 <daiss1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1720143
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
zhanggb
940f8ce404 Kernel: read panel supplier from device tree
Moto hardware revision need panel supplier info. Add code to read
panel supplier from dtsi file.

Change-Id: I7deb8a9b78c790f80459d3780d65a57699a35fee
Reviewed-on: https://gerrit.mot.com/1540967
Reviewed-on: https://gerrit.mot.com/1697643
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
f12b293d60 drm/msm/dsi-staging: add default brightness property
Add a new property to specify the default brightness level that would
set for usecases where no explicit brightness level is configured.
Mot-CRs-fixed: (CR)

Change-Id: Iecc6f4e0b5b9fbda5d8bf97efa7d4de4dbbd5570
Signed-off-by: houdz1 <houdz1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1697641
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
0c89b9e3de msm/dsi: set brightness at maximum if enabling LCD HBM
For LCD panel, set brightness at maximum while entering HBM and keep it
same afterwards whatever user space brightness. Previous user space
brightness is restored while exiting HBM. This change ensures LCD and
OLED HBM behavior consistent.

Change-Id: I9c3c319b6288239914092af9c0b9bfd59412fa07
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697640
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
063b3082b6 dsi_panel: Check the return status of the touch screen
Touch have a feature named "single tap".
1. When the feature enbled, we can not power down panel,
    and keep rest signal high.
2. When the feature disabled, the retrun value is s 0,
    Instead, the retrun value is 1.

Change-Id: Ib4530ebcd3132d60588dbe92ab23d0737983b6b4
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1499390
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1697638
2023-05-06 10:01:48 +08:00
houdz1
78cc98525c drm/panel_param: optimize the code
1.Different projects have different features.
For example: there are not "ACL" feature for lcd panel.
So some feature cmd parse is failed.
We only release the struct dsi_panel_cmd_set when parse failed.
2.Must get "panel_hbm_fod" first, then parse param property.

Change-Id: I82d5a96b715683168ae0a609664624128cdb170e
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697637
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
haojl2
a26bfb7b99 msm: dsi_panel: refresh rate config option
TP:
Need to enforce CONFIG_DRM_DYNAMIC_REFRESH_RATE option within techpak
for racer.

Change-Id: I05b9749a138407d9eb627040f65d7e29588b226f
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1475865
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
(cherry picked from commit cc607d64e1fbd02e008672485d18da1563c72c91)
Reviewed-on: https://gerrit.mot.com/1697634
2023-05-06 10:01:48 +08:00
amarenr
b3a144132e Ensure to initialise the index variable.
After enabling CONFIG_INIT_STACK_ALL=Y, kernel crash is observed.
[    5.602434] Call trace:
[    5.602436]  dsi_display_bind+0xbec/0xeb0
[    5.602441]  component_bind_all+0x13c/0x298
[    5.602443]  msm_drm_bind+0x154/0x8f8
[    5.602446]  try_to_bring_up_master+0x220/0x290
[    5.602449]  component_add+0xc0/0x1a8
[    5.602453]  dp_display_probe+0x31c/0x428
[    5.602456]  platform_drv_probe+0x80/0xb8
[    5.602459]  really_probe+0x4c0/0x6a8
[    5.602461]  driver_probe_device+0x74/0x148
[    5.602464]  __driver_attach+0x120/0x1d8
[    5.602466]  bus_for_each_dev+0x8c/0xd8
[    5.602469]  driver_attach+0x2c/0x38
[    5.602471]  bus_add_driver+0x144/0x268
[    5.602474]  driver_register+0x78/0x110
[    5.602476]  __platform_driver_register+0x4c/0x58
[    5.602481]  dp_display_init+0x20/0x58
[    5.602484]  do_one_initcall+0x204/0x410
[    5.602488]  kernel_init_freeable+0x46c/0x538
[    5.602492]  kernel_init+0x18/0x298
[    5.602495]  ret_from_fork+0x10/0x1c
[    5.602497] Code: 9136e129 52801002 9b2826e8 91003500 (b900091f)
[    5.602501] ---[ end trace 3dfb83852f204db5 ]---
[    5.603216] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

This patch shall avoid crash by ensuring to select
the default display type as primary.

Change-Id: Id70ffafae48214e7514e9bc303909c3294c79ecd
Reviewed-on: https://gerrit.mot.com/1540832
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1697632
2023-05-06 10:01:48 +08:00
Bang Nguyen
d93b18f00e disp: msm: Fixing motUtil tool for ACL feature
- Mot's panel param feature is working with sending single MIPI DSI
command, but it doesn't work correct with sending more than one MIPI
DSI commands
- Enable ACL support to enable or disable ACL feature with the MotUtil
tool. This tool is designed to validate the MOT display DRM Framework.

Change-Id: I211818d9c2b2c8a736f4dfc1768c78357383c531
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697631
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Bang Nguyen
1060f5f6e5 disp: msm: Parsing and store panel's 0xDA register info
Since ALS sensor's Firmware needs to keep track the PWM duty cycle of
each panels' version, therefore the panels' register 0xDA will be used
to identify the PWM duty cycle programmed in each panels' version.
The new /sys/class/drm/card0-DSI1/panelRegDA sysfs will be created,
and it will show the panel's 0XDA reg information.

Change-Id: I997fb15040102b784eeb0a7318239bda4f59ac4b
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697630
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Konstantin Makariev
3c206994ac msm: dsi_panel: refresh rate config option
Make refresh rate change notification configurable through
CONFIG_DRM_DYNANMIC_REFRESH_RATE defconfig option.

Change-Id: If0a9161979f8797143b9911ea2371ba0bda01e69
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697628
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Bang Nguyen
f80746408c disp: msm: Support "te_chk_reg_rd" for panel's ESD
Support the panel's ESD "te_chk_reg_rd" detection and recovery which
will run every 8s to check the TE signal and power_mode for ESD
detection. If ESD detection doesn't see the TE signal or receive an
expected power_mode value, then the display driver will trigger ESD
recovery. If the ESD detection and recovery run 5 consecutive times
but can not retrieve the TE signal or/and expected power_mode, then
the display driver will call BUG() to reboot the phone.

Change-Id: Id9a161cad624746823fcbe144b050d1dbdde18cf
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697626
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Konstantin Makariev
3138d03a75 dsi: pushing display notifications
Pushing display notifications when it is turning on and off, so
registered listener can become aware of it state.

Change-Id: I5ae139d5a9099a86d94f54f7495ddf12659c98ba
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697625
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Bang Nguyen
17b4f7ee6d disp: msm: Restore old backlight setting after exitting HBM
The backlight and HBM are using the same command 0x51. The backlight
ranger will be from 0x000 to 0x640 while HBM on will be at 0xfff and
HBM off will be at 0x640. This is why the display driver should
restore the last backlight setting after exiting the HBM mode.

Change-Id: Icd29cd25e5eb4936369dfefb513e62076f994482
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697623
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Konstantin Makariev
1d87f2a40c disp: msm: add display frequency change notification
Added notifier to inform registered consumers about display changing
frequency.

Change-Id: Ibc2de44c680e5499282c9b0c96d3a03e4f019f8a
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697620
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Bang Nguyen
6ff2674c42 disp: msm: implement xxx-hbm-is-51cmd dts entry
Add qcom,mdss-dsi-panel-hbm-is-51cmd to panel's dts to indicate
that the HBM command is using the same backlight command 0x51 command.
Therefore when the HBM is on, then the backlight level will be saved
and backlight command will be ignored. When the HBM is off then stored
backlight level will be set

Port from 9bafa67

Change-Id: I58082c5555a4afbebebd2c1d9e8568c787143d2d
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Signed-off-by: daiss1 <daiss1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1697612
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
bbf4ba0698 disp: msm:: disable Elvss dim of HBM for smd panel
Sending the panel_hbm_dim_off command during the panel enable

Port from: a5b269d7

Change-Id: I4f8136152a74fdcbd8cfb4d9f964ed268aa5eb9a
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697599
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
5c202c9614 disp: msm:: reset the param value to the default value
During the panel is enable, we reset the value of the panel register
with default setting.

Change-Id: Idf30593736e66386581b729ae28023035cded122
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697597
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
houdz1
84265334e2 disp: msm: support for HBM_FOD mode
FOD: Fingerprint of display.

For tianma panel, there are two hbm mode.
1. hbm
2. hbm for FOD(hbm_fod);
But for SMD panel ,there is only one HBM mode.

Port from 9701d728f

Change-Id: Icc09d39502a9549bfba7cd47efca2993a2716110
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697595
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Bang Nguyen
3c7f510343 disp: msm: fix checking returned value of xx_cmd_transfer
Change the checking returned value of dsi_ctrl_cmd_transfer(), because
if this is a read command then it will return the number byte of
reading when reading succeed. If this is a write command, then it
will return "none-zero" for failure.

Change-Id: I088af5da728dc758470377253b8d4e16d1222c1b
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697593
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:48 +08:00
Bang Nguyen
e2e955e81c disp: msm: Correct the panel's LP11_INIT
QCOM has panel's LP11_INIT implementation, but it doesn't meet MOT's
panel spec.

Here is QCOM's implementaion:
- Init the DSI PHY, Turn on panel's POWER, Toggle Reset, and sending
  MIPI commands

Here is MOT's LP11_INIT panel spec:
- Init the DSI PHY ( MIPI lines in LP00), Turn on panel POWER,
  Bring MIPI lines to LP11, Toggle Reset, Sending MIPI commands

Port from: f78d13a

Change-Id: Ia5f7f5be683615ec1811f550dec1967335c9816d
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697591
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
ade79873ca disp: msm: Register for reboot_notifier
Since implementing the factory_kill feature, then the msm_drv needs
to register for reboot_notifier to shut down the display accordingly.

Port from 7445d2d.

Change-Id: I8b6d48205ba819f0d36ad7218852241baa33f014
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697588
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
shuoyan
1245a50c12 disp: msm: Support ACL when setting panel param
Support ACL when setting panel param, so user-mode can control
the enable/disable of ACL property.

Port form 9f9c112

Change-Id: I6db8673f88fb9fbc85e98f15af654b03706e586f
Signed-off-by: shuoyan <shuoyan@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697583
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
shuoyan
05b1f38038 disp: msm: Enable "val" to control HBM property
Enable "val" to update HBM property, so user-mode can control
the enable/disable of HBM property through connector property.

Port form 4ec72b4

Change-Id: Ieed101ff0bab707ebf2dabc7e533564bf60cbc90
Signed-off-by: shuoyan <shuoyan@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697582
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
d17eecb2ac disp: msm: dsi: Reducing logging in dsi_panel.c
Reducing unnecessary logging in dsi_panel.c file.

Port from: 7a44c5e

Change-Id: Ib8ffd31ed8d35d322de41b3061441bb46a48c7f3
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697577
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
942f7d4bcf disp: msm: dsi: Add print info for DSI_CTRL
Add the DSI_CTRL index to indicate which DSI_CTRL is enable.

Port from: 9a63078

Change-Id: I8af0de72ccc0a4152d53db9efd29255ddfa129e8
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697575
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
02d285a728 disp: msm : Add the ACL panel param feature
Add the ACL panel param feature which will be controlled
from the user-space

Port from: 6db5516a8

Change-Id: Ib286fbcbb7e1517bd6390d1338d157f371ce680f
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697573
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
22e8e5a919 disp: msm: Populate the passing panel's info from BL.
BL (bootloader/EUFI) will read the panel information such as panel's
ID and it will pass this information and panel's name in the devtree.
The display driver will populate these information and store in the
sysFS

Port from: 8908f4c

Change-Id: I3e212b48ceb02b52bbb2026d4c37ea8542d9622e
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697472
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
15fe7a6142 disp: msm: Set panel enable_status during probing
Set the panel's enable_status when the panel's cont_splash_enable
feature is set.

This dsi_display_enable_status() API will provide the panels
information such as the panel_name, probe information
and panels's enable/disable information to the touch driver.

Port from: fbc31d9a7

Change-Id: Idba46c92b950965351de9d951e6067d241090b77
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697469
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Konstantin Makariev
eef9a42827 disp: msm: Add panel name to enable status API
Adding a name to DSI panel enable status API

Port from: f41f8deae

Change-Id: Ibde9b1582454275c7491422b0101c78ba507c7b4
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697410
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
5cdb58b738 disp: msm: Report panel's probe status
Panel API need to report probe status in order for consumer to
determine panel's presence

Port from : 75d097728

Change-Id: I8252c0e0865780e0b0dbe5252dc663981fc16ba3
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1697408
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2023-05-06 10:01:47 +08:00
Bang Nguyen
89c4956f4c disp: msm: provide API to query for panel enable state
This dsi_display_is_panel_enable(int panel_index) API will take in
panel_index equal 0 for Primary and 1 for Seconday display. It will
return TRUE if the panel is ON or FALSE when it's OFF

Port from: b5f053287

Change-Id: I06ec806c9878a9eaa2b1c08b84968102e258bda3
Signed-off-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-on: https://gerrit.mot.com/1412835
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1697406
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
2023-05-06 10:01:47 +08:00