drm/panel: use mipi_dsi_dcs_write_buffer where possible
A few of the new panels create a local macro wrapping around mipi_dsi_dcs_write. At the same time, they don't really care about the command/payload split. mipi_dsi_dcs_write does a kmalloc/memcpy/kfree for payload > 7 bytes. Avoid that all together by using the _buffer function. Aside: panel-xinpeng-xpp055c272.c calls its wrapper "generic" although it should be "dcs". But that for another day/patch. Cc: Heiko Stuebner <heiko@sntech.de> Cc: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200505160329.2976059-2-emil.l.velikov@gmail.com
This commit is contained in:
parent
e192fba23e
commit
1a5c4fe91d
|
@ -52,9 +52,9 @@ static inline struct kd35t133 *panel_to_kd35t133(struct drm_panel *panel)
|
|||
}
|
||||
|
||||
#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \
|
||||
static const u8 d[] = { seq }; \
|
||||
static const u8 b[] = { cmd, seq }; \
|
||||
int ret; \
|
||||
ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \
|
||||
ret = mipi_dsi_dcs_write_buffer(dsi, b, ARRAY_SIZE(b)); \
|
||||
if (ret < 0) \
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
|
|
@ -246,9 +246,9 @@ struct ltk050h3146w *panel_to_ltk050h3146w(struct drm_panel *panel)
|
|||
}
|
||||
|
||||
#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \
|
||||
static const u8 d[] = { seq }; \
|
||||
static const u8 b[] = { cmd, seq }; \
|
||||
int ret; \
|
||||
ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \
|
||||
ret = mipi_dsi_dcs_write_buffer(dsi, b, ARRAY_SIZE(b)); \
|
||||
if (ret < 0) \
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
|
|
@ -62,9 +62,9 @@ static inline struct xpp055c272 *panel_to_xpp055c272(struct drm_panel *panel)
|
|||
}
|
||||
|
||||
#define dsi_generic_write_seq(dsi, cmd, seq...) do { \
|
||||
static const u8 d[] = { seq }; \
|
||||
static const u8 b[] = { cmd, seq }; \
|
||||
int ret; \
|
||||
ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \
|
||||
ret = mipi_dsi_dcs_write_buffer(dsi, b, ARRAY_SIZE(b)); \
|
||||
if (ret < 0) \
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
|
Loading…
Reference in New Issue