From db29afe66e49efc4f28016154ca46541fd640359 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 24 Aug 2011 14:07:06 +0800 Subject: 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. --- gralloc_drm_pipe.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'gralloc_drm_pipe.c') 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; } -- cgit v1.1