summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gralloc/gralloc_gem_intel.c2
-rw-r--r--src/gralloc/gralloc_gem_pipe.c1
-rw-r--r--src/gralloc/gralloc_gem_radeon.c9
-rw-r--r--src/gralloc/gralloc_kms.c10
-rw-r--r--src/gralloc/gralloc_mod.h1
5 files changed, 20 insertions, 3 deletions
diff --git a/src/gralloc/gralloc_gem_intel.c b/src/gralloc/gralloc_gem_intel.c
index 9159df68c5..5cd765b562 100644
--- a/src/gralloc/gralloc_gem_intel.c
+++ b/src/gralloc/gralloc_gem_intel.c
@@ -27,6 +27,8 @@ drm_gem_intel_init_features(struct drm_module_t *drm)
else
drm->mode_page_flip = 0;
+ drm->mode_page_flip_blocking = 0;
+
if (drm->resources) {
int pipe;
diff --git a/src/gralloc/gralloc_gem_pipe.c b/src/gralloc/gralloc_gem_pipe.c
index 1a1856a53b..74b35d0537 100644
--- a/src/gralloc/gralloc_gem_pipe.c
+++ b/src/gralloc/gralloc_gem_pipe.c
@@ -30,6 +30,7 @@ drm_gem_pipe_init_features(struct drm_module_t *drm)
{
drm->mode_dirty_fb = 0;
drm->mode_page_flip = 0;
+ drm->mode_page_flip_blocking = 0;
if (strcmp(driver_descriptor.driver_name, "vmwgfx") == 0)
drm->mode_dirty_fb = 1;
diff --git a/src/gralloc/gralloc_gem_radeon.c b/src/gralloc/gralloc_gem_radeon.c
index 334263ee2f..5ff0136c8e 100644
--- a/src/gralloc/gralloc_gem_radeon.c
+++ b/src/gralloc/gralloc_gem_radeon.c
@@ -26,6 +26,11 @@
* Dave Airlie <airlied@redhat.com>
*/
+/*
+ * XXX This driver assumes evergreen. It works, but is slow and has sync
+ * issues.
+ */
+
#define LOG_TAG "GRALLOC-RADEON"
#include <cutils/log.h>
@@ -191,8 +196,8 @@ static void
drm_gem_radeon_init_features(struct drm_module_t *drm)
{
drm->mode_dirty_fb = 0;
- /* XXX there are synchronization issues */
- drm->mode_page_flip = 0;
+ drm->mode_page_flip = 1;
+ drm->mode_page_flip_blocking = 1;
drm->swap_interval = 1;
drm->vblank_secondary = 0;
}
diff --git a/src/gralloc/gralloc_kms.c b/src/gralloc/gralloc_kms.c
index 2ed06f7701..a6b4e30052 100644
--- a/src/gralloc/gralloc_kms.c
+++ b/src/gralloc/gralloc_kms.c
@@ -85,8 +85,16 @@ drm_kms_page_flip(struct drm_module_t *drm, struct drm_bo_t *bo)
}
}
- if (ret)
+ if (ret) {
LOGE("failed to perform page flip");
+ }
+ else if (drm->mode_page_flip_blocking) {
+ /*
+ * TODO page flip with DRM_MODE_PAGE_FLIP_EVENT instead of waiting for
+ * next vblank
+ */
+ drm_kms_wait_vblank(drm, 1);
+ }
return ret;
}
diff --git a/src/gralloc/gralloc_mod.h b/src/gralloc/gralloc_mod.h
index 176ea63727..33ababcb35 100644
--- a/src/gralloc/gralloc_mod.h
+++ b/src/gralloc/gralloc_mod.h
@@ -30,6 +30,7 @@ struct drm_module_t {
void *gem;
int mode_dirty_fb;
int mode_page_flip;
+ int mode_page_flip_blocking; /* page flip should block */
int swap_interval;
int vblank_secondary;