Skip to content

Commit b324e6c

Browse files
Revert "drivers: display: elcdif: Modify interrupt enablement"
This reverts commit 2068976. We must keep the frame completion interrupt disabled until we send a new frame to the eLCDIF, as the frame completion interrupt fires at each vertical blank interval. If we keep it enabled, then the semaphore we use to indicate the frame has been loaded by the eLCDIF will be posted to when we do not have a frame queued, and calls to `display_write` will return before the eLCDIF has actually loaded the new framebuffer. Fixes #80590 Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 022c8ee commit b324e6c

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

drivers/display/Kconfig.mcux_elcdif

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,6 @@ config MCUX_ELCDIF_PXP
5454
display_write is called with a framebuffer equal in size to the
5555
display.
5656

57-
config MCUX_ELCDIF_LP
58-
bool "ELCDIF low power"
59-
help
60-
This option, when enabled, will enable CUR_FRAME_DONE_IRQ at the display
61-
write function and disable it at the interruption handler for each new frame.
62-
Disabling the interrupt when no new frame needs to be sent gives the CPU the
63-
possibility to enter low-power mode, thus saving energy.
64-
This option, when disabled, CUR_FRAME_DONE_IRQ will be enabled only
65-
once at initialization. This option should be disabled when the application's
66-
frame rate is close to the display's refresh rate to avoid introducing
67-
additional latency caused by frequently enabling and disabling CUR_FRAME_DONE_IRQ.
68-
6957
if MCUX_ELCDIF_PXP
7058

7159
choice MCUX_ELCDIF_PXP_ROTATE_DIRECTION

drivers/display/display_mcux_elcdif.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,8 @@ static int mcux_elcdif_write(const struct device *dev, const uint16_t x, const u
214214
/* Update index of active framebuffer */
215215
dev_data->next_idx = (dev_data->next_idx + 1) % CONFIG_MCUX_ELCDIF_FB_NUM;
216216
#endif
217-
218-
if (IS_ENABLED(CONFIG_MCUX_ELCDIF_LP)) {
219-
ELCDIF_EnableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable);
220-
}
217+
/* Enable frame buffer completion interrupt */
218+
ELCDIF_EnableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable);
221219
/* Wait for frame send to complete */
222220
k_sem_take(&dev_data->sem, K_FOREVER);
223221
return ret;
@@ -310,11 +308,10 @@ static void mcux_elcdif_isr(const struct device *dev)
310308
status = ELCDIF_GetInterruptStatus(config->base);
311309
ELCDIF_ClearInterruptStatus(config->base, status);
312310
if (config->base->CUR_BUF == ((uint32_t)dev_data->active_fb)) {
313-
if (IS_ENABLED(CONFIG_MCUX_ELCDIF_LP)) {
314-
/* Disable frame completion interrupt if Low power mode is activated*/
315-
ELCDIF_DisableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable);
316-
}
317-
/* Post to sem to notify that frame display is complete.*/
311+
/* Disable frame completion interrupt, post to
312+
* sem to notify that frame send is complete.
313+
*/
314+
ELCDIF_DisableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable);
318315
k_sem_give(&dev_data->sem);
319316
}
320317
}
@@ -352,9 +349,6 @@ static int mcux_elcdif_init(const struct device *dev)
352349
dev_data->active_fb = dev_data->fb[0];
353350

354351
ELCDIF_RgbModeInit(config->base, &dev_data->rgb_mode);
355-
if (!IS_ENABLED(CONFIG_MCUX_ELCDIF_LP)) {
356-
ELCDIF_EnableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable);
357-
}
358352
ELCDIF_RgbModeStart(config->base);
359353

360354
return 0;

0 commit comments

Comments
 (0)