-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[RFC] drivers: mipi_dbi: add support for mipi_dbi_configure_te #81246
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
[RFC] drivers: mipi_dbi: add support for mipi_dbi_configure_te #81246
Conversation
846a4ad to
2c0edc7
Compare
Many MIPI DBI displays support a "tearing effect" signal, which can be configured to signal each v-sync or h-sync interval. This signal can be used by the MIPI DBI controller to synchronize writes with the controller, and avoid tearing effects on the screen (which occur when the write pointer from the MCU overlaps with the panel's read pointer in the display controller's graphics RAM). Add the `mipi_dbi_configure_te` API, which allows display controllers to configure MIPI DBI controller to wait for a TE edge before streaming display data. Allow the tearing enable parameters to be configured via devicetree settings, since these will vary based on the MIPI DBI controller and display controller in use. Signed-off-by: Daniel DeGrasse <[email protected]>
2c0edc7 to
cdd3793
Compare
include/zephyr/drivers/mipi_dbi.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some controllers also support TE source (DSI link or External pin). How would you propose to configure this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an example I could look at? Not sure I follow here. Do you mean that the MIPI controller supports selecting the TE source between an on chip DSI peripheral and external pin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out- one thing to note, this is a DSI controller, not a DBI controller- so it wouldn't fit within the MIPI DBI API itself.
Looking at this more, I do think we'd need something like this within the MIPI DSI API though- it looks like DSI controllers can either signal TE via a dedicated GPIO pin, or via a D-PHY trigger event on the DSI bus itself.
|
Sure, but probably not within the next couple of days, due to short deadlines. Remind me again in a couple of days if I forget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused here; the way this if statement is written, if every single frame is frame_incomplete = false, then the te_sync will only be active every other write call. Is that intended?
I feel like the else should be removed, and the if (!desc->frame_incomplete) should be an independent separate block that gets always executed regardless of the previous if block.
Feel free to correct my thoughts if I'm mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think you are right here. We always want the next call after one with frame_incomplete = false to trigger a TE wait. I'll update this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Add support for the mipi_dbi_configure_te API within the NXP LCDIC peripheral. Also, remove a redundant code patch in the write_command function that was previously used to determine when the display driver was writing to graphics RAM, as these writes should now be performed using the mipi_dbi_write_display API. Signed-off-by: Daniel DeGrasse <[email protected]>
Use the mipi_dbi_configure_te API within the st7796s display driver. If the MIPI DBI controller supports the tearing enable signal, then configure the ST7796S to output the TE line signal. Signed-off-by: Daniel DeGrasse <[email protected]>
Configure the TE signal for the rw_rw612_bga board when using the lcd_par_s035 shield. This signal should be handled on the rising edge in the default configuration, since the display writes from the MCU are faster than the panel reads data. Signed-off-by: Daniel DeGrasse <[email protected]>
cdd3793 to
7ab4386
Compare
|
Looks good to me so far, although I didn't put the time into checking all the registers. But the general code doesn't seem wrong to me. |
|
Can't approve my own PR, reassigning to @dleach02 as this touches NXP drivers |
|
@danieldegrasse did you confirm with an osci that this is working properly? |
I have not with latest push (as I no longer have access to the hardware), but yes I have verified the TE signal delays as expected with a signal analyzer using the LVGL sample. That didn't expose the bug you caught because LVGL will only set |

Many MIPI DBI displays support a "tearing effect" signal, which can be
configured to signal each v-sync or h-sync interval. This signal can be
used by the MIPI DBI controller to synchronize writes with the
controller, and avoid tearing effects on the screen (which occur when
the write pointer from the MCU overlaps with the panel's read pointer in
the display controller's graphics RAM).
Add the
mipi_dbi_configure_teAPI, which allows display controllers toconfigure MIPI DBI controller to wait for a TE edge before streaming
display data. Allow the tearing enable parameters to be configured via
devicetree settings, since these will vary based on the MIPI DBI
controller and display controller in use.
For an example of how this signal can be used, see the write diagrams within the ST7796S datasheet (section 10.8.3):
Depends on #81245 for some fixes to the LCDIC driverTodo:
frdm_mcxn947withlcd_par_s035_8080shieldrd_rw612_bgawithadafruit_2_8_tft_touch_v2shield