aboutsummaryrefslogtreecommitdiffstats
path: root/minui
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2011-08-30 11:59:20 -0700
committerDima Zavin <dima@android.com>2011-08-30 11:59:20 -0700
commit4daf48a10bcba1fa92b8b3564504b90807c72274 (patch)
tree897de0abb508786dad7bc9f711712dc2a6a5069e /minui
parent3c7f00ede67113e0de6da214caa6c99ce8eab95c (diff)
downloadbootable_recovery-4daf48a10bcba1fa92b8b3564504b90807c72274.zip
bootable_recovery-4daf48a10bcba1fa92b8b3564504b90807c72274.tar.gz
bootable_recovery-4daf48a10bcba1fa92b8b3564504b90807c72274.tar.bz2
minui: graphics: add interface for framebuffer blank/unblank
Change-Id: I5c3ee61cbf6fadae50f10b9f2e73caceaa5048a7 Signed-off-by: Dima Zavin <dima@android.com>
Diffstat (limited to 'minui')
-rw-r--r--minui/graphics.c10
-rw-r--r--minui/minui.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/minui/graphics.c b/minui/graphics.c
index 57ca810..fa8e510 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -364,3 +365,12 @@ gr_pixel *gr_fb_data(void)
{
return (unsigned short *) gr_mem_surface.data;
}
+
+void gr_fb_blank(bool blank)
+{
+ int ret;
+
+ ret = ioctl(gr_fb_fd, FBIOBLANK, blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK);
+ if (ret < 0)
+ perror("ioctl(): blank");
+}
diff --git a/minui/minui.h b/minui/minui.h
index 5496b09..2284a33 100644
--- a/minui/minui.h
+++ b/minui/minui.h
@@ -17,6 +17,8 @@
#ifndef _MINUI_H_
#define _MINUI_H_
+#include <stdbool.h>
+
typedef void* gr_surface;
typedef unsigned short gr_pixel;
@@ -27,6 +29,7 @@ int gr_fb_width(void);
int gr_fb_height(void);
gr_pixel *gr_fb_data(void);
void gr_flip(void);
+void gr_fb_blank(bool blank);
void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
void gr_fill(int x, int y, int w, int h);