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

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: update other targets 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
Index: include/dev/display.h
diff --git a/include/dev/display.h b/include/dev/display.h
index 451057374675ea8ab5e167910f36778195b8d6b5..0892bf05a60b1b665280208ebf6f0ddd727cd450 100644
--- a/include/dev/display.h
+++ b/include/dev/display.h
@@ -35,30 +35,54 @@ 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);
gkalsi 2016/03/09 21:13:37 Might be worth also suffixing this with __NONNULL(
cdotstout 2016/03/09 22:48:00 Done.
+
+struct display_image {
+ enum image_format format;
+ void *pixels;
+ uint width;
+ uint height;
+ int rowbytes;
travisg1 2016/03/09 22:40:11 is rowbytes in bytes or pixels? It gets passed to
+};
+
+status_t display_present(struct display_image *image, uint starty, uint endy);
gkalsi 2016/03/09 21:13:37 ditto from above
cdotstout 2016/03/09 22:48:00 Done.
+
+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);
gkalsi 2016/03/09 21:13:37 ditto from above
cdotstout 2016/03/09 22:48:00 Done.
__END_CDECLS
#endif
-

Powered by Google App Engine
This is Rietveld 408576698