gralloc960: Update to the r9p0 gralloc release
This is necessary in order to support r9p0 libGLES_mali.so binaries.
NOTE: This unfortunately drops recent changes like v4.12+ ION abi
compatibility, which will need to be re-implemented and re-added.
NOTE: This change requires both kernel changes for the r9p0 driver
as well as binariy r9p0 libGLES_mali.so libraries. Don't merge until
those are all lined up to land.
Change-Id: I6c7fdf7585edea08196d1a323db3ec0629883311
Signed-off-by: John Stultz <john.stultz@linaro.org>
diff --git a/gralloc960/gralloc_vsync_s3cfb.cpp b/gralloc960/gralloc_vsync_s3cfb.cpp
index 5740ea9..434e685 100644
--- a/gralloc960/gralloc_vsync_s3cfb.cpp
+++ b/gralloc960/gralloc_vsync_s3cfb.cpp
@@ -22,38 +22,52 @@
#include <sys/ioctl.h>
#include <errno.h>
-#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
-#define S3CFB_SET_VSYNC_INT _IOW('F', 206, unsigned int)
+#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
+#define S3CFB_SET_VSYNC_INT _IOW('F', 206, unsigned int)
int gralloc_vsync_enable(framebuffer_device_t *dev)
{
- private_module_t* m = reinterpret_cast<private_module_t*>(dev->common.module);
+ private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module);
int interrupt = 1;
- if(ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0) return -errno;
+
+ if (ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
+ {
+ return -errno;
+ }
+
return 0;
}
int gralloc_vsync_disable(framebuffer_device_t *dev)
{
- private_module_t* m = reinterpret_cast<private_module_t*>(dev->common.module);
+ private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module);
int interrupt = 0;
- if(ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0) return -errno;
+
+ if (ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
+ {
+ return -errno;
+ }
+
return 0;
}
int gralloc_wait_for_vsync(framebuffer_device_t *dev)
{
- private_module_t* m = reinterpret_cast<private_module_t*>(dev->common.module);
- if ( m->swapInterval )
+ private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module);
+
+ if (m->swapInterval)
{
int crtc = 0;
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_BEGIN_WAIT);
- if(ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, &crtc) < 0)
+
+ if (ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, &crtc) < 0)
{
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
return -errno;
}
+
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
}
+
return 0;
}