From 6b621fbf567373acdbc354fe5347e00658f8c4e0 Mon Sep 17 00:00:00 2001 From: Ryan Wendland Date: Thu, 5 Oct 2023 18:54:08 +1030 Subject: [PATCH 1/3] nxdk: Update submodule --- src/libs/nxdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/nxdk b/src/libs/nxdk index ccc9a56..13c20b6 160000 --- a/src/libs/nxdk +++ b/src/libs/nxdk @@ -1 +1 @@ -Subproject commit ccc9a565ca124a4dcc702267cef4f20ce23f616d +Subproject commit 13c20b635aaa703018a498c382ac3d14c1832484 From bc4d89c93db9389aab54f5150d55a6f5f5ee9380 Mon Sep 17 00:00:00 2001 From: Ryan Wendland Date: Thu, 5 Oct 2023 19:03:49 +1030 Subject: [PATCH 2/3] xgu: Update commands to GPU more frequently --- src/lvgl_drivers/video/xgu/lv_xgu_disp.c | 2 +- src/lvgl_drivers/video/xgu/lv_xgu_rect.c | 4 ++++ src/lvgl_drivers/video/xgu/lv_xgu_texture.c | 18 ++++++++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/lvgl_drivers/video/xgu/lv_xgu_disp.c b/src/lvgl_drivers/video/xgu/lv_xgu_disp.c index 688de4f..9306fa8 100644 --- a/src/lvgl_drivers/video/xgu/lv_xgu_disp.c +++ b/src/lvgl_drivers/video/xgu/lv_xgu_disp.c @@ -17,7 +17,6 @@ uint32_t *p; static void end_frame() { - pb_end(p); while (pb_finished()); } @@ -28,6 +27,7 @@ static void begin_frame() p = pb_begin(); p = xgu_set_color_clear_value(p, 0xff000000); p = xgu_clear_surface(p, XGU_CLEAR_Z | XGU_CLEAR_STENCIL | XGU_CLEAR_COLOR); + pb_end(p); } void lvgl_getlock(void); diff --git a/src/lvgl_drivers/video/xgu/lv_xgu_rect.c b/src/lvgl_drivers/video/xgu/lv_xgu_rect.c index c8d528d..35fd815 100644 --- a/src/lvgl_drivers/video/xgu/lv_xgu_rect.c +++ b/src/lvgl_drivers/video/xgu/lv_xgu_rect.c @@ -120,6 +120,8 @@ void xgu_draw_rect(lv_draw_ctx_t *draw_ctx, const lv_draw_rect_dsc_t *dsc, const return; } + p = pb_begin(); + if (xgu_ctx->xgu_data->combiner_mode != 0) { #include "lvgl_drivers/video/xgu/notexture.inl" @@ -174,6 +176,8 @@ void xgu_draw_rect(lv_draw_ctx_t *draw_ctx, const lv_draw_rect_dsc_t *dsc, const rect_draw_image(&draw_area, dsc); rect_draw_border(&draw_area, dsc); + + pb_end(p); } void xgu_draw_bg(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_rect_dsc_t *draw_dsc, const lv_area_t *src_area) diff --git a/src/lvgl_drivers/video/xgu/lv_xgu_texture.c b/src/lvgl_drivers/video/xgu/lv_xgu_texture.c index b106a3f..c3d1dfe 100644 --- a/src/lvgl_drivers/video/xgu/lv_xgu_texture.c +++ b/src/lvgl_drivers/video/xgu/lv_xgu_texture.c @@ -203,12 +203,6 @@ void xgu_draw_letter(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_label_dsc_t return; } - if (xgu_ctx->xgu_data->combiner_mode != 1) - { - #include "lvgl_drivers/video/xgu/texture.inl" - xgu_ctx->xgu_data->combiner_mode = 1; - } - lv_lru_get(xgu_ctx->xgu_data->texture_cache, &bmp, sizeof(bmp), (void **)&texture); if (texture == NULL) { @@ -229,12 +223,21 @@ void xgu_draw_letter(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_label_dsc_t } } + p = pb_begin(); + + if (xgu_ctx->xgu_data->combiner_mode != 1) + { + #include "lvgl_drivers/video/xgu/texture.inl" + xgu_ctx->xgu_data->combiner_mode = 1; + } + p = xgux_set_color4ub(p, dsc->color.ch.red, dsc->color.ch.green, dsc->color.ch.blue, dsc->opa); bind_texture(xgu_ctx, texture, (uint32_t)bmp, XGU_TEXTURE_FILTER_LINEAR); map_textured_rect(texture, &letter_area, &draw_area, 256.0f); + pb_end(p); } lv_res_t xgu_draw_img(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_img_dsc_t *dsc, @@ -297,6 +300,7 @@ void xgu_draw_img_decoded(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_img_dsc lv_color_t recolor = lv_color_make(255, 255, 255); + p = pb_begin(); // If we are about the draw 1 bit indexed image. Setup draw color froms src_buf; if (cf == LV_IMG_CF_INDEXED_1BIT) { @@ -381,6 +385,7 @@ void xgu_draw_img_decoded(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_img_dsc } if (texture == NULL) { + pb_end(p); return; } } @@ -399,4 +404,5 @@ void xgu_draw_img_decoded(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_img_dsc (dsc->antialias) ? XGU_TEXTURE_FILTER_LINEAR : XGU_TEXTURE_FILTER_NEAREST); map_textured_rect(texture, &src_area_transformed, &draw_area, (float)dsc->zoom); + pb_end(p); } From e9622ce3dc8981ab77293998c29f9e1de40ac47d Mon Sep 17 00:00:00 2001 From: Ryan Wendland Date: Thu, 5 Oct 2023 19:08:44 +1030 Subject: [PATCH 3/3] dash: Use xbox vblank event instead of delay --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index 3540689..f2bb9e2 100644 --- a/src/main.c +++ b/src/main.c @@ -145,12 +145,16 @@ int main(int argc, char* argv[]) { lvgl_getlock(); lv_task_handler(); lvgl_removelock(); + #ifdef NXDK + pb_wait_for_vbl(); + #else e = SDL_GetTicks(); t = e - s; if (t < LV_DISP_DEF_REFR_PERIOD) { SDL_Delay(LV_DISP_DEF_REFR_PERIOD - t); } + #endif } dash_printf(LEVEL_TRACE, "Quitting dash with quit event %d\n", lv_get_quit()); lv_port_disp_deinit();