fix(vg_lite): workaround vg_lite_blit_rect offset x/y hardware bug (#9522)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
VIFEX
2026-01-06 22:40:32 +08:00
committed by GitHub
parent eb86444ec9
commit 7bf13855e7
5 changed files with 38 additions and 3 deletions
+5
View File
@@ -502,6 +502,11 @@ menu "LVGL configuration"
default n default n
depends on LV_USE_DRAW_VG_LITE depends on LV_USE_DRAW_VG_LITE
config LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET
bool "Disable blit rectangular offset to resolve certain hardware errors."
default n
depends on LV_USE_DRAW_VG_LITE
config LV_VG_LITE_PATH_DUMP_MAX_LEN config LV_VG_LITE_PATH_DUMP_MAX_LEN
int "Maximum path dump print length (in points)" int "Maximum path dump print length (in points)"
default 1000 default 1000
+3
View File
@@ -328,6 +328,9 @@
/** Remove VLC_OP_CLOSE path instruction (Workaround for NXP) **/ /** Remove VLC_OP_CLOSE path instruction (Workaround for NXP) **/
#define LV_VG_LITE_DISABLE_VLC_OP_CLOSE 0 #define LV_VG_LITE_DISABLE_VLC_OP_CLOSE 0
/** Disable blit rectangular offset to resolve certain hardware errors. */
#define LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET 0
/** Disable linear gradient extension for some older versions of drivers. */ /** Disable linear gradient extension for some older versions of drivers. */
#define LV_VG_LITE_DISABLE_LINEAR_GRADIENT_EXT 0 #define LV_VG_LITE_DISABLE_LINEAR_GRADIENT_EXT 0
+14 -3
View File
@@ -321,11 +321,22 @@ static void draw_letter_bitmap(lv_draw_task_t * t, const lv_draw_glyph_dsc_t * d
const vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true); const vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true);
const int32_t clip_offset_x = clip_area.x1 - image_area.x1;
const int32_t clip_offset_y = clip_area.y1 - image_area.y1;
/* If rotation is not required, blit directly */ /* If rotation is not required, blit directly */
if(!dsc->rotation) { if(!dsc->rotation
#if LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET
/**
* For some hardware, the rect.x/y parameters of vg_lite_blit_rect do not work correctly,
* so the fallback is to vg_lite_draw_pattern for processing.
*/
&& (clip_offset_x == 0 && clip_offset_y == 0)
#endif
) {
vg_lite_rectangle_t rect = { vg_lite_rectangle_t rect = {
.x = clip_area.x1 - image_area.x1, .x = clip_offset_x,
.y = clip_area.y1 - image_area.y1, .y = clip_offset_y,
.width = lv_area_get_width(&clip_area), .width = lv_area_get_width(&clip_area),
.height = lv_area_get_height(&clip_area) .height = lv_area_get_height(&clip_area)
}; };
+9
View File
@@ -931,6 +931,15 @@
#endif #endif
#endif #endif
/** Disable blit rectangular offset to resolve certain hardware errors. */
#ifndef LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET
#ifdef CONFIG_LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET
#define LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET CONFIG_LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET
#else
#define LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET 0
#endif
#endif
/** Disable linear gradient extension for some older versions of drivers. */ /** Disable linear gradient extension for some older versions of drivers. */
#ifndef LV_VG_LITE_DISABLE_LINEAR_GRADIENT_EXT #ifndef LV_VG_LITE_DISABLE_LINEAR_GRADIENT_EXT
#ifdef CONFIG_LV_VG_LITE_DISABLE_LINEAR_GRADIENT_EXT #ifdef CONFIG_LV_VG_LITE_DISABLE_LINEAR_GRADIENT_EXT
+7
View File
@@ -41,4 +41,11 @@
The rendering engine needs to support 3x3 matrix transformations.*/ The rendering engine needs to support 3x3 matrix transformations.*/
#define LV_DRAW_TRANSFORM_USE_MATRIX 1 #define LV_DRAW_TRANSFORM_USE_MATRIX 1
/* Used to test coverage of different configuration combinations */
#ifdef NON_AMD64_BUILD
#define LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET 1
#else
#define LV_VG_LITE_DISABLE_BLIT_RECT_OFFSET 0
#endif
#endif /* LV_TEST_CONF_VG_LITE_H */ #endif /* LV_TEST_CONF_VG_LITE_H */