summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2011-03-26 15:39:24 +0800
committerChia-I Wu <olvaffe@gmail.com>2011-03-26 15:46:32 +0800
commit1e21885cde3bde872a8dee0350983424baedb719 (patch)
treed1c92103f00867fd1f088ca7d4e5083fc56a321c
parent7492794ef5bd7fde2b9d1b9be9cfb4d15924d6d0 (diff)
gralloc: improve radeon sync issue
-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 9159df6..5cd765b 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 1a1856a..74b35d0 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 334263e..5ff0136 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 2ed06f7..a6b4e30 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 176ea63..33ababc 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;