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

Unified Diff: include/dev/display.h

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 | « dev/virtio/gpu/virtio-gpu.c ('k') | include/lib/gfx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/dev/display.h
diff --git a/include/dev/display.h b/include/dev/display.h
index 451057374675ea8ab5e167910f36778195b8d6b5..6337d981cdef169acbb5211058f17043c37852ca 100644
--- a/include/dev/display.h
+++ b/include/dev/display.h
@@ -35,30 +35,57 @@ int display_enable(bool enable);
void display_pre_freq_change(void);
void display_post_freq_change(void);
-#define DISPLAY_FORMAT_NONE (-1)
-#define DISPLAY_FORMAT_RGB_565 (0)
-#define DISPLAY_FORMAT_RGB_332 (1)
-#define DISPLAY_FORMAT_RGB_2220 (2)
-#define DISPLAY_FORMAT_ARGB_8888 (3)
-#define DISPLAY_FORMAT_RGB_x888 (4)
-#define DISPLAY_FORMAT_RGB_x111 (5)
-#define DISPLAY_FORMAT_MONO_1 (6)
-#define DISPLAY_FORMAT_MONO_8 (7)
+enum display_format {
+ DISPLAY_FORMAT_UNKNOWN,
+ DISPLAY_FORMAT_MONO_1,
+ DISPLAY_FORMAT_RGB_111,
+ DISPLAY_FORMAT_RGB_565,
+ DISPLAY_FORMAT_RGB_x888,
+ DISPLAY_FORMAT_ARGB_8888,
+};
+
+enum image_format {
+ IMAGE_FORMAT_UNKNOWN,
+ IMAGE_FORMAT_MONO_1,
+ IMAGE_FORMAT_MONO_8,
+ IMAGE_FORMAT_RGB_x111,
+ IMAGE_FORMAT_RGB_332,
+ IMAGE_FORMAT_RGB_565,
+ IMAGE_FORMAT_RGB_2220,
+ IMAGE_FORMAT_RGB_x888,
+ IMAGE_FORMAT_ARGB_8888,
+};
struct display_info {
- void *framebuffer;
- int format;
+ enum display_format format;
uint width;
uint height;
- uint stride;
+};
+
+status_t display_get_info(struct display_info *info) __NONNULL((1));
+struct display_image {
+ enum image_format format;
+ void *pixels;
+ uint width;
+ uint height;
+ int stride; // row length in pixels
+ int rowbytes; // row length in bytes
+};
+
+status_t display_present(struct display_image *image, uint starty, uint endy)
+ __NONNULL((1));
+
+struct display_framebuffer {
+ enum display_format format;
+ struct display_image image;
// Update function
void (*flush)(uint starty, uint endy);
};
-status_t display_get_info(struct display_info *info);
+status_t display_get_framebuffer(struct display_framebuffer *fb)
+ __NONNULL((1));
__END_CDECLS
#endif
-
« no previous file with comments | « dev/virtio/gpu/virtio-gpu.c ('k') | include/lib/gfx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698