summaryrefslogtreecommitdiffstats
path: root/gralloc_drm_pipe.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2011-08-24 14:07:06 +0800
committerChia-I Wu <olvaffe@gmail.com>2011-08-24 14:52:40 +0800
commitdb29afe66e49efc4f28016154ca46541fd640359 (patch)
tree9032f4a3403eb39acc588aa550be0c8a1a2df028 /gralloc_drm_pipe.c
parent64591d8f71b902b32d07122e91a1e1a3129dab61 (diff)
downloadexternal_drm_gralloc-db29afe66e49efc4f28016154ca46541fd640359.zip
external_drm_gralloc-db29afe66e49efc4f28016154ca46541fd640359.tar.gz
external_drm_gralloc-db29afe66e49efc4f28016154ca46541fd640359.tar.bz2
vmwgfx: assorted fixes
Based on trial and error, we know - drm_kms_wait_for_post() hangs the VM - drmModeDirtyFB() should be called whenever the front buffer changes - drmModePageFlip() is not supported They might not be entirely correct, but fixing them makes drm_gralloc work.
Diffstat (limited to 'gralloc_drm_pipe.c')
-rw-r--r--gralloc_drm_pipe.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gralloc_drm_pipe.c b/gralloc_drm_pipe.c
index ff07c0f..2b39815 100644
--- a/gralloc_drm_pipe.c
+++ b/gralloc_drm_pipe.c
@@ -346,8 +346,14 @@ static void pipe_init_kms_features(struct gralloc_drm_drv_t *drv, struct gralloc
break;
}
- drm->mode_dirty_fb = (strcmp(pm->driver, "vmwgfx") == 0);
- drm->swap_mode = DRM_SWAP_FLIP;
+ if (strcmp(pm->driver, "vmwgfx") == 0) {
+ drm->mode_quirk_vmwgfx = 1;
+ drm->swap_mode = DRM_SWAP_COPY;
+ }
+ else {
+ drm->mode_quirk_vmwgfx = 0;
+ drm->swap_mode = DRM_SWAP_FLIP;
+ }
drm->mode_sync_flip = 1;
drm->swap_interval = 1;
drm->vblank_secondary = 0;
@@ -373,6 +379,7 @@ static void pipe_destroy(struct gralloc_drm_drv_t *drv)
#include "r600/r600_public.h"
/* for vmwgfx */
#include "svga/drm/svga_drm_public.h"
+#include "svga/svga_winsys.h"
#include "svga/svga_public.h"
/* for debug */
#include "target-helpers/inline_debug_helper.h"
@@ -463,6 +470,12 @@ static int pipe_get_pci_id(struct pipe_manager *pm,
*device = 0;
err = 0;
}
+ else if (strcmp(name, "vmwgfx") == 0) {
+ *vendor = 0x15ad;
+ /* assume SVGA II */
+ *device = 0x0405;
+ err = 0;
+ }
else {
err = -EINVAL;
}