Skip to content

drivers: display: st: allow-ltdc-callback-override #91750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

markussmST
Copy link
Contributor

Allow overriding the LTDC callback for manual handling or extension In some cases, the default handling may not be desired, for example triggering handling of the next frame/block once the transfer has passed a certain line.

@avolmat-st
Copy link

Hi @markussmST,
could you detail a bit more why the current handling of the LTDC handler cannot fit with your usage ?
I am trying to understand if we need to have the whole isr function as a weak or simply allow to call a weak function from within the current isr in order to extend the handling done by the current handler.
The current driver buffer handling is done considering that the isr handler would behave as written within the driver so I am wondering if there is a way to

  1. ensuring that the driver will still behave as expected
  2. add further handling within the isr handler if necessary

@markussmST
Copy link
Contributor Author

Hi @markussmST, could you detail a bit more why the current handling of the LTDC handler cannot fit with your usage ? I am trying to understand if we need to have the whole isr function as a weak or simply allow to call a weak function from within the current isr in order to extend the handling done by the current handler. The current driver buffer handling is done considering that the isr handler would behave as written within the driver so I am wondering if there is a way to

  1. ensuring that the driver will still behave as expected
  2. add further handling within the isr handler if necessary

I was considering that solution as well, with the addition of a return from that function to determine if the existing code should be executed.
One reason for wanting to capture the callback and not execute the buffer swap in my case is that the line interrupt is being set mulitple times per frame to determine the actual active display area in order to maximize the rendering time to include the porches. This could also be used for single buffering to start rendering the next frame up to a certain point once the transfer has passed.

@@ -84,7 +84,7 @@ struct display_stm32_ltdc_config {
const struct device *display_controller;
};

static void stm32_ltdc_global_isr(const struct device *dev)
void __weak stm32_ltdc_global_isr(const struct device *dev)
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes would need stm32_ltdc_global_isr() to be declared in a header file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, I don't know how this ever worked in my testing. I've added a .h file included in the driver.

@markussmST markussmST force-pushed the allow-ltdc-callback-override branch from 9b958fb to cc3fe73 Compare June 18, 2025 11:08
Allow overriding the LTDC callback for manual handling or extension
In some cases, the default handling may not be desired, for example
triggering handling of the next frame/block once the transfer has passed
a certain line.

Signed-off-by: Mathias Markussen <mathias.markussen@st.com>
@markussmST markussmST force-pushed the allow-ltdc-callback-override branch from cc3fe73 to ee22fff Compare June 18, 2025 11:45
Copy link

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

Successfully merging this pull request may close these issues.

4 participants