display: st7789v: implement runtime display orientation#105973
display: st7789v: implement runtime display orientation#105973ArchitAnant wants to merge 1 commit intozephyrproject-rtos:mainfrom
Conversation
|
|
Needs a rebase following #107278 |
Currently, the st7789v driver hardcodes the display orientation to DISPLAY_ORIENTATION_NORMAL and returns -ENOTSUP when a runtime orientation change is requested. This patch implements the set_orientation() callback by dynamically configuring the MY, MX, and MV bits in the MADCTL (0x36) register based on the requested rotation. To ensure color correctness, the base MADCTL configuration is preserved from the device tree configuration config->mdac while only the orientation bits are masked and overwritten. Additionally, the get_capabilities() callback is updated to correctly report the current orientation state and swap the reported X and Y resolutions when the display is in a portrait-to-landscape rotation (90 or 270 degrees). Signed-off-by: Archit Anant <architanant5@gmail.com>
e163284 to
279b913
Compare
|
JarmouniA
left a comment
There was a problem hiding this comment.
Please provide photo(s) or video of testing with sample/drivers/display.
@JarmouniA As I don't possess the hardware, I won't be able to test it on a physical display. However, I have verified the bitmasking logic for the MADCTL register against the ST7789V datasheet and the Linux Kernel implementation to ensure the rotation bits are correct. The build completes cleanly as shown below:
|




Currently, the st7789v driver hardcodes the display orientation to DISPLAY_ORIENTATION_NORMAL and returns -ENOTSUP when a runtime orientation change is requested.
This patch implements the set_orientation() callback by dynamically configuring the MY, MX, and MV bits in the MADCTL (0x36) register based on the requested rotation.
To ensure color correctness, the base MADCTL configuration is preserved from the device tree configuration config->mdac while only the orientation bits are masked and overwritten.
Additionally, the get_capabilities() callback is updated to correctly report the current orientation state and swap the reported X and Y resolutions when the display is in a portrait-to-landscape rotation (90 or 270 degrees).