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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008-2010 Travis Geiselbrecht 2 * Copyright (c) 2008-2010 Travis Geiselbrecht
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining 4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files 5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction, 6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge, 7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software, 8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so, 9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions: 10 * subject to the following conditions:
(...skipping 17 matching lines...) Expand all
28 #include <inttypes.h> 28 #include <inttypes.h>
29 #include <compiler.h> 29 #include <compiler.h>
30 30
31 __BEGIN_CDECLS 31 __BEGIN_CDECLS
32 32
33 int display_init(void *framebuffer); 33 int display_init(void *framebuffer);
34 int display_enable(bool enable); 34 int display_enable(bool enable);
35 void display_pre_freq_change(void); 35 void display_pre_freq_change(void);
36 void display_post_freq_change(void); 36 void display_post_freq_change(void);
37 37
38 #define DISPLAY_FORMAT_NONE (-1) 38 enum display_format {
39 #define DISPLAY_FORMAT_RGB_565 (0) 39 DISPLAY_FORMAT_UNKNOWN,
40 #define DISPLAY_FORMAT_RGB_332 (1) 40 DISPLAY_FORMAT_MONO_1,
41 #define DISPLAY_FORMAT_RGB_2220 (2) 41 DISPLAY_FORMAT_RGB_111,
42 #define DISPLAY_FORMAT_ARGB_8888 (3) 42 DISPLAY_FORMAT_RGB_565,
43 #define DISPLAY_FORMAT_RGB_x888 (4) 43 DISPLAY_FORMAT_RGB_x888,
44 #define DISPLAY_FORMAT_RGB_x111 (5) 44 DISPLAY_FORMAT_ARGB_8888,
45 #define DISPLAY_FORMAT_MONO_1 (6) 45 };
46 #define DISPLAY_FORMAT_MONO_8 (7) 46
47 enum image_format {
48 IMAGE_FORMAT_UNKNOWN,
49 IMAGE_FORMAT_MONO_1,
50 IMAGE_FORMAT_MONO_8,
51 IMAGE_FORMAT_RGB_x111,
52 IMAGE_FORMAT_RGB_332,
53 IMAGE_FORMAT_RGB_565,
54 IMAGE_FORMAT_RGB_2220,
55 IMAGE_FORMAT_RGB_x888,
56 IMAGE_FORMAT_ARGB_8888,
57 };
47 58
48 struct display_info { 59 struct display_info {
49 void *framebuffer; 60 enum display_format format;
50 int format;
51 uint width; 61 uint width;
52 uint height; 62 uint height;
53 uint stride; 63 };
54 64
65 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.
66
67 struct display_image {
68 enum image_format format;
69 void *pixels;
70 uint width;
71 uint height;
72 int rowbytes;
travisg1 2016/03/09 22:40:11 is rowbytes in bytes or pixels? It gets passed to
73 };
74
75 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.
76
77 struct display_framebuffer {
78 enum display_format format;
79 struct display_image image;
55 // Update function 80 // Update function
56 void (*flush)(uint starty, uint endy); 81 void (*flush)(uint starty, uint endy);
57 }; 82 };
58 83
59 status_t display_get_info(struct display_info *info); 84 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.
60 85
61 __END_CDECLS 86 __END_CDECLS
62 87
63 #endif 88 #endif
64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698