Skip to content

Conversation

duynguyenxa
Copy link
Member

This PR introduces support for D/AVE 2D (Dave2D) hardware acceleration in LVGL on Zephyr OS.
The integration allows LVGL’s rendering engine to utilize the Renesas D/AVE 2D GPU for improved graphics performance, enabling faster UI updates and smoother animations on supported hardware platforms (e.g., RA8D1, RA8P1).

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_renesas zephyrproject-rtos/hal_renesas@bc51c0b zephyrproject-rtos/hal_renesas#154 zephyrproject-rtos/hal_renesas#154/files
lvgl zephyrproject-rtos/lvgl@b03edc8 (zephyr_2025_06_11) zephyrproject-rtos/lvgl#67 zephyrproject-rtos/lvgl#67/files

Additional metadata changed:

Name URL Submodules West cmds module.yml Blobs
hal_renesas 1x 🆕

DNM label due to: 2 projects with PR revision, 1 project with metadata changes and 1 blob change

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-lvgl manifest-hal_renesas DNM (manifest) This PR should not be merged (controlled by action-manifest) Binary Blobs Added labels Oct 8, 2025
@duynguyenxa duynguyenxa force-pushed the renesas_drw_driver_support branch 2 times, most recently from c5f52c9 to 198bda1 Compare October 8, 2025 06:50
@uLipe
Copy link
Member

uLipe commented Oct 8, 2025

Thank you for bringing this one @duynguyenxa, I was about to ask you about the progress on this.

@duynguyenxa duynguyenxa force-pushed the renesas_drw_driver_support branch from 2212a8d to 7c3cf66 Compare October 8, 2025 12:42
Copy link
Contributor

@JarmouniA JarmouniA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartben kartben requested a review from Copilot October 8, 2025 19:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces D/AVE 2D hardware acceleration support for LVGL on Renesas RA devices (RA8D1, RA8P1), enabling GPU-accelerated graphics rendering for improved UI performance. The integration includes driver implementation, device tree bindings, board configurations, and demo updates.

Key Changes

  • Adds Renesas DRW (D/AVE 2D) driver with interrupt handling and memory management
  • Updates module revisions to pull in LVGL dave2d support and Renesas HAL changes
  • Configures board support and display timing optimizations for RA8D1/RA8P1 platforms

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
west.yml Updates module revisions for hal_renesas and lvgl to pull in dave2d support
drivers/misc/renesas_drw/ New DRW driver implementation with interrupt handling and memory allocation
dts/bindings/misc/renesas,ra-drw.yaml Device tree binding for DRW hardware
dts/arm/renesas/ra/ra8/ Device tree node definitions for DRW on RA8D1/RA8P1 SoCs
boards/renesas/ Board-specific DRW enablement and interrupt configuration
modules/lvgl/Kconfig LVGL configuration for dave2d draw engine support
samples/modules/lvgl/demos/ Demo configuration updates for widgets and performance monitoring

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@faxe1008
Copy link
Contributor

The overall driver looks good now, although I am missing the hardware to test it. Also the pending issue around the LVGL fork sync needs to be addressed first I guess.

config RENESAS_RA_DRW
bool "Renesas RA DRW Driver"
depends on DT_HAS_RENESAS_RA_DRW_ENABLED
select USE_RA_FSP_DRW if SOC_FAMILY_RENESAS_RA
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check redundant? It is already passed by DT_HAS_RENESAS_RA_DRW_ENABLED.

Suggested change
select USE_RA_FSP_DRW if SOC_FAMILY_RENESAS_RA
select USE_RA_FSP_DRW

Comment on lines 76 to 80
uint32_t int_status;
IRQn_Type irq = R_FSP_CurrentIrqGet();
/* Read D/AVE 2D interrupt status */
int_status = R_DRW->STATUS;
/* Get current IRQ number */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better for readability

Suggested change
uint32_t int_status;
IRQn_Type irq = R_FSP_CurrentIrqGet();
/* Read D/AVE 2D interrupt status */
int_status = R_DRW->STATUS;
/* Get current IRQ number */
uint32_t int_status = R_DRW->STATUS; /* Read D/AVE 2D interrupt status */
IRQn_Type irq = R_FSP_CurrentIrqGet(); /* Get current IRQ number */

Comment on lines 99 to 120
#define DRW_INIT(inst) \
static int drw_renesas_ra_configure_func_##inst(void) \
{ \
R_ICU->IELSR[DT_INST_IRQ_BY_NAME(inst, drw, irq)] = ELC_EVENT_DRW_INT; \
IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, drw, irq), \
DT_INST_IRQ_BY_NAME(inst, drw, priority), drw_zephyr_irq_handler, \
DEVICE_DT_INST_GET(inst), 0); \
irq_enable(DT_INST_IRQ_BY_NAME(inst, drw, irq)); \
return 0; \
} \
static int renesas_drw_init_##inst(const struct device *dev) \
{ \
ARG_UNUSED(dev); \
return drw_renesas_ra_configure_func_##inst(); \
} \
DEVICE_DT_INST_DEFINE(inst, renesas_drw_init_##inst, NULL, NULL, NULL, POST_KERNEL, \
CONFIG_RENESAS_DRW_INIT_PRIORITY, NULL);

DT_INST_FOREACH_STATUS_OKAY(DRW_INIT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use the SYS_INIT, due to this is a singleton instance driver

Comment on lines 85 to 94
d1_device_flex *p_context = (d1_device_flex *)R_FSP_IsrContextGet(irq);

if (p_context->dlist_indirect_enable &&
(NULL != (uint32_t *)*(p_context->pp_dlist_indirect_start))) {
R_DRW->DLISTSTART = *(p_context->pp_dlist_indirect_start);
p_context->pp_dlist_indirect_start++;
} else {
k_sem_give(&d1_queryirq_sem);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better for readability

Suggested change
d1_device_flex *p_context = (d1_device_flex *)R_FSP_IsrContextGet(irq);
if (p_context->dlist_indirect_enable &&
(NULL != (uint32_t *)*(p_context->pp_dlist_indirect_start))) {
R_DRW->DLISTSTART = *(p_context->pp_dlist_indirect_start);
p_context->pp_dlist_indirect_start++;
} else {
k_sem_give(&d1_queryirq_sem);
}
}
d1_device_flex *p_d1_handle = (d1_device_flex *)R_FSP_IsrContextGet(irq);
if (p_d1_handle != NULL) {
uint32_t **pp_dlist_indirect_start = (uint32_t **)p_d1_handle->pp_dlist_indirect_start;
if (p_d1_handle->dlist_indirect_enable && *pp_dlist_indirect_start != NULL) {
R_DRW->DLISTSTART = *pp_dlist_indirect_start;
p_d1_handle->pp_dlist_indirect_start++;
} else {
k_sem_give(&d1_queryirq_sem);
}
}
}

Comment on lines 38 to 39
R_DRW->IRQCTL = DRW_PRV_IRQCTL_ALLIRQ_CLEAR_AND_DLISTIRQ_ENABLE;
R_FSP_IsrContextSet((IRQn_Type)VECTOR_NUMBER_DRW_INT, handle);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base on the d1_shutdownirq_intern, I think we should move the irq_enable(VECTOR_NUMBER_DRW_INT); from init function to here.
Beside that, maybe you'd like to swap the call order?

Suggested change
R_DRW->IRQCTL = DRW_PRV_IRQCTL_ALLIRQ_CLEAR_AND_DLISTIRQ_ENABLE;
R_FSP_IsrContextSet((IRQn_Type)VECTOR_NUMBER_DRW_INT, handle);
R_FSP_IsrContextSet((IRQn_Type)VECTOR_NUMBER_DRW_INT, handle);
irq_enable(VECTOR_NUMBER_DRW_INT);
R_DRW->IRQCTL = DRW_PRV_IRQCTL_ALLIRQ_CLEAR_AND_DLISTIRQ_ENABLE;

uLipe
uLipe previously approved these changes Oct 14, 2025
Copy link
Member

@uLipe uLipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! It will simplify a lot the Weather Demo from Renesas under Zephyr.

DEVICE_DT_INST_DEFINE(inst, renesas_drw_init_##inst, NULL, NULL, NULL, POST_KERNEL, \
CONFIG_RENESAS_DRW_INIT_PRIORITY, NULL);

DT_INST_FOREACH_STATUS_OKAY(DRW_INIT)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DT_INST and its foreach version is also responsible to manage the allocation of the driver instance and runtime data, there are examples on how to instantiate singleton devices ( check the video input subsystems) but I'd rather to leave this as is because the runtime result will be the same of using a cusom singleton initialization flow.

@thenguyenyf thenguyenyf added this to the v4.3.0 milestone Oct 15, 2025
This commit update commit ID for Renesas hal and lvgl
module to support dave2d library

Signed-off-by: Duy Nguyen <[email protected]>
First commit to add support for Renesas RA drw driver

Signed-off-by: Duy Nguyen <[email protected]>
Add DRW nodes to r7fa8d1xh.dtsi and r7ka8p1kflcac.dtsi

Signed-off-by: Duy Nguyen <[email protected]>
Add support for drw driver on ek_ra8p1 and ek_ra8d1

Signed-off-by: Duy Nguyen <[email protected]>
Adjust GLCDC panel timing parameters for
rtklcdpar1s00001be display shield

Signed-off-by: Duy Nguyen <[email protected]>
Add extra configs in sample.yaml to LVGL demos for Renesas
EK-RA8P1 and EK-RA8D1 boards.

Add new overlay file for EK-RA8P1 to adjust flash
partitions.

Signed-off-by: Duy Nguyen <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards/SoCs area: Devicetree Bindings area: LVGL Light and Versatile Graphics Library Support area: Samples Samples area: Shields Shields (add-on boards) Binary Blobs Added DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-hal_renesas manifest-lvgl platform: Renesas RA Renesas Electronics Corporation, RA platform: Renesas Renesas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants