drm/mipi-dsi: Introduce mipi_dsi_*_write_seq_multi()
authorDouglas Anderson <dianders@chromium.org>
Tue, 14 May 2024 17:20:55 +0000 (10:20 -0700)
committerNeil Armstrong <neil.armstrong@linaro.org>
Wed, 15 May 2024 20:59:13 +0000 (22:59 +0200)
commit966e397e4f6032b73438f8d775756541513e7daf
tree9fd539f701f750600033c00ac291bf03e530b52b
parent3b724909a380fddb44dfa0072fc459c698a52658
drm/mipi-dsi: Introduce mipi_dsi_*_write_seq_multi()

The current mipi_dsi_*_write_seq() macros are non-intutitive because
they contain a hidden "return" statement that will return out of the
_caller_ of the macro. Let's mark them as deprecated and instead
introduce some new macros that are more intuitive.

These new macros are less optimal when an error occurs but should
behave more optimally when there is no error. Specifically these new
macros cause smaller code to get generated and the code size savings
(less to fetch from RAM, less cache space used, less RAM used) are
important. Since the error case isn't something we need to optimize
for and these new macros are easier to understand and more flexible,
they should be used.

After converting to use these new functions, one example shows some
nice savings while also being easier to understand.

$ scripts/bloat-o-meter \
  ...after/panel-novatek-nt36672e.ko \
  ...ctx/panel-novatek-nt36672e.ko
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-988 (-988)
Function                                     old     new   delta
nt36672e_1080x2408_60hz_init                6236    5248    -988
Total: Before=10651, After=9663, chg -9.28%

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20240514102056.v5.5.Ie94246c30fe95101e0e26dd5f96e976dbeb8f242@changeid
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240514102056.v5.5.Ie94246c30fe95101e0e26dd5f96e976dbeb8f242@changeid
Documentation/gpu/todo.rst
drivers/gpu/drm/drm_mipi_dsi.c
include/drm/drm_mipi_dsi.h