feat(pxp) Add option to use PXP only for rotation without creating PXP draw unit.
Signed-off-by: Cosmin-Daniel Radu <cosmin.radu_1@nxp.com>
This commit is contained in:
committed by
Gabor Kiss-Vamosi
parent
a109608806
commit
892d97ccc1
12
Kconfig
12
Kconfig
@@ -372,8 +372,18 @@ menu "LVGL configuration"
|
||||
depends on LV_USE_DRAW_VGLITE
|
||||
default n
|
||||
|
||||
config LV_USE_PXP
|
||||
bool "Use NXP's PXP on iMX RTxxx platforms"
|
||||
default n
|
||||
|
||||
config LV_USE_DRAW_PXP
|
||||
bool "Use NXP's PXP on iMX RTxxx platforms"
|
||||
bool "Use PXP for drawing"
|
||||
depends on LV_USE_PXP
|
||||
default y
|
||||
|
||||
config LV_USE_ROTATE_PXP
|
||||
bool "Use PXP to rotate display"
|
||||
depends on LV_USE_PXP
|
||||
default n
|
||||
|
||||
config LV_USE_PXP_DRAW_THREAD
|
||||
|
||||
@@ -214,10 +214,16 @@
|
||||
#endif
|
||||
|
||||
/* Use NXP's PXP on iMX RTxxx platforms. */
|
||||
#define LV_USE_DRAW_PXP 0
|
||||
#define LV_USE_PXP 0
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_OS
|
||||
#if LV_USE_PXP
|
||||
/* Use PXP for drawing.*/
|
||||
#define LV_USE_DRAW_PXP 1
|
||||
|
||||
/* Use PXP to rotate display.*/
|
||||
#define LV_USE_ROTATE_PXP 0
|
||||
|
||||
#if LV_USE_DRAW_PXP && LV_USE_OS
|
||||
/* Use additional draw thread for PXP processing.*/
|
||||
#define LV_USE_PXP_DRAW_THREAD 1
|
||||
#endif
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "lv_draw_pxp.h"
|
||||
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP
|
||||
#include "../../lv_draw_buf_private.h"
|
||||
#include "lv_pxp_cfg.h"
|
||||
@@ -109,3 +110,4 @@ static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t *
|
||||
}
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
#include "lv_draw_pxp.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "lv_pxp_cfg.h"
|
||||
#include "lv_pxp_utils.h"
|
||||
|
||||
@@ -82,6 +83,9 @@ static void _pxp_execute_drawing(lv_draw_pxp_unit_t * u);
|
||||
|
||||
void lv_draw_pxp_init(void)
|
||||
{
|
||||
lv_pxp_init();
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
lv_draw_buf_pxp_init_handlers();
|
||||
|
||||
lv_draw_pxp_unit_t * draw_pxp_unit = lv_draw_create_unit(sizeof(lv_draw_pxp_unit_t));
|
||||
@@ -89,11 +93,10 @@ void lv_draw_pxp_init(void)
|
||||
draw_pxp_unit->base_unit.dispatch_cb = _pxp_dispatch;
|
||||
draw_pxp_unit->base_unit.delete_cb = _pxp_delete;
|
||||
|
||||
lv_pxp_init();
|
||||
|
||||
#if LV_USE_PXP_DRAW_THREAD
|
||||
lv_thread_init(&draw_pxp_unit->thread, LV_THREAD_PRIO_HIGH, _pxp_render_thread_cb, 2 * 1024, draw_pxp_unit);
|
||||
#endif
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
}
|
||||
|
||||
void lv_draw_pxp_deinit(void)
|
||||
@@ -159,7 +162,7 @@ void lv_draw_pxp_rotate(const void * src_buf, void * dest_buf, int32_t src_width
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
static inline bool _pxp_src_cf_supported(lv_color_format_t cf)
|
||||
{
|
||||
bool is_cf_supported = false;
|
||||
@@ -484,5 +487,6 @@ static void _pxp_render_thread_cb(void * ptr)
|
||||
LV_LOG_INFO("Exit PXP draw thread.");
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -22,7 +22,8 @@ extern "C" {
|
||||
|
||||
#include "../../../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "../../sw/lv_draw_sw_private.h"
|
||||
#include "../../../misc/lv_area_private.h"
|
||||
|
||||
@@ -40,8 +41,6 @@ typedef lv_draw_sw_unit_t lv_draw_pxp_unit_t;
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
void lv_draw_buf_pxp_init_handlers(void);
|
||||
|
||||
void lv_draw_pxp_init(void);
|
||||
|
||||
void lv_draw_pxp_deinit(void);
|
||||
@@ -50,6 +49,9 @@ void lv_draw_pxp_rotate(const void * src_buf, void * dest_buf, int32_t src_width
|
||||
int32_t src_stride, int32_t dest_stride, lv_display_rotation_t rotation,
|
||||
lv_color_format_t cf);
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
void lv_draw_buf_pxp_init_handlers(void);
|
||||
|
||||
void lv_draw_pxp_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc,
|
||||
const lv_area_t * coords);
|
||||
|
||||
@@ -63,6 +65,8 @@ void lv_draw_pxp_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * d
|
||||
* MACROS
|
||||
**********************/
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "lv_draw_pxp.h"
|
||||
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP
|
||||
#include "lv_pxp_cfg.h"
|
||||
#include "lv_pxp_utils.h"
|
||||
@@ -145,3 +146,4 @@ static void _pxp_fill(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t d
|
||||
}
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "lv_draw_pxp.h"
|
||||
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP
|
||||
#include "lv_pxp_cfg.h"
|
||||
#include "lv_pxp_utils.h"
|
||||
@@ -363,3 +364,4 @@ static void _pxp_blit(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t d
|
||||
}
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "lv_draw_pxp.h"
|
||||
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP
|
||||
|
||||
#include "../../../stdlib/lv_string.h"
|
||||
@@ -154,3 +155,4 @@ void lv_draw_pxp_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * d
|
||||
}
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
#include "lv_pxp_cfg.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "lv_pxp_osa.h"
|
||||
|
||||
/*********************
|
||||
@@ -88,4 +89,5 @@ void lv_pxp_wait(void)
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -22,7 +22,8 @@ extern "C" {
|
||||
|
||||
#include "../../../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "fsl_cache.h"
|
||||
#include "fsl_pxp.h"
|
||||
|
||||
@@ -93,7 +94,8 @@ void lv_pxp_wait(void);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
#include "lv_pxp_osa.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "lv_pxp_utils.h"
|
||||
#include "../../../misc/lv_log.h"
|
||||
#include "../../../osal/lv_os.h"
|
||||
@@ -183,4 +184,5 @@ static void _pxp_wait(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -22,7 +22,8 @@ extern "C" {
|
||||
|
||||
#include "../../../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "lv_pxp_cfg.h"
|
||||
|
||||
/*********************
|
||||
@@ -51,7 +52,8 @@ pxp_cfg_t * pxp_get_default_cfg(void);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
#include "lv_pxp_utils.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -89,6 +90,7 @@ pxp_as_pixel_format_t pxp_get_as_px_format(lv_color_format_t cf)
|
||||
return as_px_format;
|
||||
}
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
pxp_ps_pixel_format_t pxp_get_ps_px_format(lv_color_format_t cf)
|
||||
{
|
||||
pxp_ps_pixel_format_t ps_px_format = kPXP_PsPixelFormatRGB565;
|
||||
@@ -143,3 +145,5 @@ bool pxp_buf_aligned(const void * buf, uint32_t stride)
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
@@ -21,7 +21,8 @@ extern "C" {
|
||||
*********************/
|
||||
#include "../../../lv_conf_internal.h"
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "fsl_pxp.h"
|
||||
#include "../../../misc/lv_color.h"
|
||||
|
||||
@@ -59,6 +60,7 @@ pxp_output_pixel_format_t pxp_get_out_px_format(lv_color_format_t cf);
|
||||
|
||||
pxp_as_pixel_format_t pxp_get_as_px_format(lv_color_format_t cf);
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
pxp_ps_pixel_format_t pxp_get_ps_px_format(lv_color_format_t cf);
|
||||
|
||||
bool pxp_buf_aligned(const void * buf, uint32_t stride);
|
||||
@@ -72,6 +74,8 @@ bool pxp_buf_aligned(const void * buf, uint32_t stride);
|
||||
**********************/
|
||||
|
||||
#endif /*LV_USE_DRAW_PXP*/
|
||||
#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/
|
||||
#endif /*LV_USE_PXP*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
|
||||
@@ -629,16 +629,38 @@
|
||||
#endif
|
||||
|
||||
/* Use NXP's PXP on iMX RTxxx platforms. */
|
||||
#ifndef LV_USE_DRAW_PXP
|
||||
#ifdef CONFIG_LV_USE_DRAW_PXP
|
||||
#define LV_USE_DRAW_PXP CONFIG_LV_USE_DRAW_PXP
|
||||
#ifndef LV_USE_PXP
|
||||
#ifdef CONFIG_LV_USE_PXP
|
||||
#define LV_USE_PXP CONFIG_LV_USE_PXP
|
||||
#else
|
||||
#define LV_USE_DRAW_PXP 0
|
||||
#define LV_USE_PXP 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_OS
|
||||
#if LV_USE_PXP
|
||||
/* Use PXP for drawing.*/
|
||||
#ifndef LV_USE_DRAW_PXP
|
||||
#ifdef LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_DRAW_PXP
|
||||
#define LV_USE_DRAW_PXP CONFIG_LV_USE_DRAW_PXP
|
||||
#else
|
||||
#define LV_USE_DRAW_PXP 0
|
||||
#endif
|
||||
#else
|
||||
#define LV_USE_DRAW_PXP 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Use PXP to rotate display.*/
|
||||
#ifndef LV_USE_ROTATE_PXP
|
||||
#ifdef CONFIG_LV_USE_ROTATE_PXP
|
||||
#define LV_USE_ROTATE_PXP CONFIG_LV_USE_ROTATE_PXP
|
||||
#else
|
||||
#define LV_USE_ROTATE_PXP 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LV_USE_DRAW_PXP && LV_USE_OS
|
||||
/* Use additional draw thread for PXP processing.*/
|
||||
#ifndef LV_USE_PXP_DRAW_THREAD
|
||||
#ifdef LV_KCONFIG_PRESENT
|
||||
|
||||
@@ -43,8 +43,10 @@
|
||||
#if LV_USE_DRAW_VGLITE
|
||||
#include "draw/nxp/vglite/lv_draw_vglite.h"
|
||||
#endif
|
||||
#if LV_USE_DRAW_PXP
|
||||
#include "draw/nxp/pxp/lv_draw_pxp.h"
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
#include "draw/nxp/pxp/lv_draw_pxp.h"
|
||||
#endif
|
||||
#endif
|
||||
#if LV_USE_DRAW_DAVE2D
|
||||
#include "draw/renesas/dave2d/lv_draw_dave2d.h"
|
||||
@@ -198,9 +200,11 @@ void lv_init(void)
|
||||
lv_draw_vglite_init();
|
||||
#endif
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
lv_draw_pxp_init();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LV_USE_DRAW_DAVE2D
|
||||
lv_draw_dave2d_init();
|
||||
@@ -385,9 +389,11 @@ void lv_deinit(void)
|
||||
|
||||
lv_obj_style_deinit();
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
#if LV_USE_PXP
|
||||
#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP
|
||||
lv_draw_pxp_deinit();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LV_USE_DRAW_VGLITE
|
||||
lv_draw_vglite_deinit();
|
||||
|
||||
Reference in New Issue
Block a user