Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: target/stm32746g-eval2/lcd.c

Issue 1777783003: [display] Refactor to avoid implicit framebuffer allocation. (Closed) Base URL: https://github.com/littlekernel/lk.git@master
Patch Set: fix stride confusion Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « target/qemu-m4/m4display.c ('k') | target/stm32f746g-disco/lcd.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: target/stm32746g-eval2/lcd.c
diff --git a/target/stm32746g-eval2/lcd.c b/target/stm32746g-eval2/lcd.c
index 41e08afea99f80f5cf1474ada8e060bfa55723ca..ea61b396067094482ab9e80a86865726275b241e 100644
--- a/target/stm32746g-eval2/lcd.c
+++ b/target/stm32746g-eval2/lcd.c
@@ -54,7 +54,6 @@
#include <target.h>
#include <compiler.h>
#include <string.h>
-#include <lib/gfx.h>
#include <dev/gpio.h>
#include <dev/display.h>
#include <arch/ops.h>
@@ -389,14 +388,37 @@ uint8_t BSP_LCD_Init(void)
}
/* LK display api here */
-status_t display_get_info(struct display_info *info)
+status_t display_get_framebuffer(struct display_framebuffer *fb)
{
- info->framebuffer = (void *)hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress;
+ fb->image.pixels = (void *)hLtdcEval.LayerCfg[ActiveLayer].FBStartAdress;
if (hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888) {
- info->format = GFX_FORMAT_ARGB_8888;
+ fb->format = DISPLAY_FORMAT_ARGB_8888;
+ fb->image.format = IMAGE_FORMAT_ARGB_8888;
+ fb->image.rowbytes = BSP_LCD_GetXSize() * 4;
} else if (hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) {
- info->format = GFX_FORMAT_RGB_565;
+ fb->format = DISPLAY_FORMAT_RGB_565;
+ fb->image.format = IMAGE_FORMAT_RGB_565;
+ fb->image.rowbytes = BSP_LCD_GetXSize() * 2;
+ } else {
+ panic("unhandled pixel format\n");
+ return ERR_NOT_FOUND;
+ }
+
+ fb->image.width = BSP_LCD_GetXSize();
+ fb->image.height = BSP_LCD_GetYSize();
+ fb->image.stride = BSP_LCD_GetXSize();
+ fb->flush = NULL;
+
+ return NO_ERROR;
+}
+
+status_t display_get_info(struct display_info *info)
+{
+ if (hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888) {
+ info->format = DISPLAY_FORMAT_ARGB_8888;
+ } else if (hLtdcEval.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) {
+ info->format = DISPLAY_FORMAT_RGB_565;
} else {
panic("unhandled pixel format\n");
return ERR_NOT_FOUND;
@@ -404,9 +426,6 @@ status_t display_get_info(struct display_info *info)
info->width = BSP_LCD_GetXSize();
info->height = BSP_LCD_GetYSize();
- info->stride = BSP_LCD_GetXSize();
- info->flush = NULL;
return NO_ERROR;
}
-
« no previous file with comments | « target/qemu-m4/m4display.c ('k') | target/stm32f746g-disco/lcd.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698