Commits

Anonymous committed 4daf48a

minui: graphics: add interface for framebuffer blank/unblank

Change-Id: I5c3ee61cbf6fadae50f10b9f2e73caceaa5048a7
Signed-off-by: Dima Zavin <dima@android.com>

  • Participants
  • Parent commits 3c7f00e

Comments (0)

Files changed (2)

File minui/graphics.c

  * limitations under the License.
  */
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <unistd.h>
 
 {
     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");
+}

File minui/minui.h

 #ifndef _MINUI_H_
 #define _MINUI_H_
 
+#include <stdbool.h>
+
 typedef void* gr_surface;
 typedef unsigned short gr_pixel;
 
 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);