Skip to content

Commit e7834e9

Browse files
committed
driver: Ensure to call set_tear_on on CMD mode panels
The downstream msm-4.9 driver is unconditinally calling mdss_dsi_set_tear_on with command mode panels, replicate the same in the driver generator, but only add the call if it hasn't already been present in the commands, as is seen on some panels. When this doesn't get enabled then the panel doesn't generate any Tearing Effect output signal which is used by MDSS.
1 parent 9a2e915 commit e7834e9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

driver.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import simple
88
import wrap
99
from generator import Options, GpioFlag
10-
from panel import Panel, BacklightControl, CommandSequence, CompressionMode
10+
from panel import Panel, BacklightControl, CommandSequence, CompressionMode, Mode
1111

1212

1313
def generate_includes(p: Panel, options: Options) -> str:
@@ -158,6 +158,14 @@ def generate_commands(p: Panel, options: Options, cmd_name: str) -> str:
158158
if c.wait and c.wait > options.ignore_wait:
159159
s += f'\t{dsi_msleep(c.wait)};\n'
160160

161+
162+
if cmd_name == 'on' and p.mode == Mode.CMD_MODE:
163+
has_tear_on = any("set_tear_on" in c.generated for c in cmd.seq)
164+
if not has_tear_on:
165+
s += '''
166+
mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
167+
'''
168+
161169
s += '''
162170
return dsi_ctx.accum_err;
163171
}

0 commit comments

Comments
 (0)