OLD | NEW |
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 Loading... |
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) __NONNULL((1)); |
| 66 |
| 67 struct display_image { |
| 68 enum image_format format; |
| 69 void *pixels; |
| 70 uint width; |
| 71 uint height; |
| 72 int stride; // row length in pixels |
| 73 int rowbytes; // row length in bytes |
| 74 }; |
| 75 |
| 76 status_t display_present(struct display_image *image, uint starty, uint endy) |
| 77 __NONNULL((1)); |
| 78 |
| 79 struct display_framebuffer { |
| 80 enum display_format format; |
| 81 struct display_image image; |
55 // Update function | 82 // Update function |
56 void (*flush)(uint starty, uint endy); | 83 void (*flush)(uint starty, uint endy); |
57 }; | 84 }; |
58 | 85 |
59 status_t display_get_info(struct display_info *info); | 86 status_t display_get_framebuffer(struct display_framebuffer *fb) |
| 87 __NONNULL((1)); |
60 | 88 |
61 __END_CDECLS | 89 __END_CDECLS |
62 | 90 |
63 #endif | 91 #endif |
64 | |
OLD | NEW |