fix(nxp/vglite): fix stride calculation (#6613)

Signed-off-by: Cristian Stoica <cristianmarian.stoica@nxp.com>
Signed-off-by: Nicușor Cîțu <nicusor.citu@nxp.com>
Signed-off-by: Neo Xu
Signed-off-by: Cristian Stoica
Signed-off-by: Cosmin-Daniel Radu <cosmin.radu_1@nxp.com>
Co-authored-by: Nicușor Cîțu <nicusor.citu@nxp.com>
Co-authored-by: Cosmin-Daniel Radu <cosmin.radu_1@nxp.com>
This commit is contained in:
cristian-stoica
2024-08-02 07:17:42 +03:00
committed by GitHub
parent d7b93dd3f1
commit 89f2ff6701
8 changed files with 20 additions and 70 deletions

View File

@@ -577,7 +577,8 @@ static uint32_t width_to_stride(uint32_t w, lv_color_format_t color_format)
uint32_t width_byte;
width_byte = w * lv_color_format_get_bpp(color_format);
width_byte = (width_byte + 7) >> 3; /*Round up*/
return (width_byte + LV_DRAW_BUF_STRIDE_ALIGN - 1) & ~(LV_DRAW_BUF_STRIDE_ALIGN - 1);
return LV_ROUND_UP(width_byte, LV_DRAW_BUF_STRIDE_ALIGN);
}
static void * draw_buf_malloc(const lv_draw_buf_handlers_t * handlers, size_t size_bytes,