drivers: display: Added support for restricted update.

Added support for restricted updating of monochrome
displays.

Signed-off-by: Rohit Gujarathi <gujju.rohit@gmail.com>
This commit is contained in:
Rohit Gujarathi 2020-08-27 22:51:11 +05:30 committed by Carles Cufí
commit f023df581f
2 changed files with 14 additions and 6 deletions

View file

@ -63,6 +63,10 @@ enum display_screen_info {
* Screen has two alternating ram buffers
*/
SCREEN_INFO_DOUBLE_BUFFER = BIT(3),
/**
* Screen has x alignment constrained to width.
*/
SCREEN_INFO_X_ALIGNMENT_WIDTH = BIT(4),
};
/**
@ -98,7 +102,6 @@ enum display_orientation {
*
* @var enum display_orientation display_capabilities::current_orientation
* Current display orientation
*
*/
struct display_capabilities {
uint16_t x_resolution;

View file

@ -85,11 +85,16 @@ void lvgl_rounder_cb_mono(struct _disp_drv_t *disp_drv,
display_get_capabilities(display_dev, &cap);
if (cap.screen_info & SCREEN_INFO_MONO_VTILED) {
area->y1 &= ~0x7;
area->y2 |= 0x7;
if (cap.screen_info & SCREEN_INFO_X_ALIGNMENT_WIDTH) {
area->x1 = 0;
area->x2 = cap.x_resolution - 1;
} else {
area->x1 &= ~0x7;
area->x2 |= 0x7;
if (cap.screen_info & SCREEN_INFO_MONO_VTILED) {
area->y1 &= ~0x7;
area->y2 |= 0x7;
} else {
area->x1 &= ~0x7;
area->x2 |= 0x7;
}
}
}