Re: [PATCH 2/2] drm/panel: samsung-s6e3ha2: Use mipi_dsi_*_multi() functions
From: Doug Anderson
Date: Tue Dec 01 2026 - 22:01:22 EST
Hi,
On Mon, Nov 30, 2026 at 8:34 PM Hsieh Hung-En <hungen3108@xxxxxxxxx> wrote:
>
> Replace the deprecated MIPI DSI DCS helpers and the custom
> s6e3ha2_dcs_write(), s6e3ha2_dcs_write_seq_static(), and
> s6e3ha2_call_write_func() wrappers with the mipi_dsi_*_multi() helpers,
> as suggested in Documentation/gpu/todo.rst.
>
> Convert the static command helpers to void functions taking a
> struct mipi_dsi_multi_context pointer, keeping their original names and
> command sequences intact. Use mipi_dsi_usleep_range() in
> s6e3ha2_panel_init(), while keeping plain msleep(40) in
> s6e3ha2_disable() and clearing accum_err between commands so
> SET_DISPLAY_OFF is still attempted if ENTER_SLEEP_MODE fails.
>
> Split the DSI brightness write sequence out of s6e3ha2_set_brightness()
> into s6e3ha2_apply_brightness() so that s6e3ha2_enable() can share its
> own mipi_dsi_multi_context. This skips brightness writes if any earlier
> command in s6e3ha2_enable() failed and propagates the first error. The
> range and bl_dev->props.power checks remain in s6e3ha2_set_brightness()
> for backlight core callers; when called from s6e3ha2_enable(),
> brightness is already bounded by backlight core and props.power is set
> to BACKLIGHT_POWER_REDUCED in prepare() and disable(), so behavior is
> unchanged. Removing bl_dev from s6e3ha2_update_gamma() also drops the
> redundant self-assignment of bl_dev->props.brightness.
>
> The _multi() helpers now log failed DCS transfers automatically;
> s6e3ha2_panel_init(), s6e3ha2_enable(), and s6e3ha2_set_brightness()
> previously did not log errors, and s6e3ha2_disable() no longer needs
> manual dev_err() calls.
>
> Signed-off-by: Hsieh Hung-En <hungen3108@xxxxxxxxx>
> ---
>
> Notes:
> - Mechanically extracted all 29 static DCS command byte sequences
> from s6e3ha2_dcs_write_seq_static() before and
> mipi_dsi_dcs_write_seq_multi() after, verifying that every
> sequence and byte value matches identically.
> - Mechanically verified the call order in s6e3ha2_panel_init(),
> s6e3ha2_disable(), and s6e3ha2_enable(), and that
> s6e3ha2_apply_brightness() issues the exact same command
> sequence previously in s6e3ha2_set_brightness().
> - For the two non-static writes, s6e3ha2_update_gamma() and
> s6e3ha2_set_vint() keep the same payload computation and only
> switch to mipi_dsi_dcs_write_buffer_multi() and
> mipi_dsi_dcs_write_var_seq_multi().
>
> drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 289 ++++++++----------
> 1 file changed, 123 insertions(+), 166 deletions(-)
Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>