summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-01-30 06:38:08 +0300
committerDave Airlie <airlied@redhat.com>2010-02-01 04:29:59 +0300
commit5ffdb658f605cbc420944e7c7eeec9fbb8a73772 (patch)
tree9f091b311f1c434f506d4c34ce373346a77d895b /drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
parentc188660f6dbb0df9febe1b841a16c66c28353c15 (diff)
downloadlinux-5ffdb658f605cbc420944e7c7eeec9fbb8a73772.tar.xz
drm/vmwgfx: Don't send bad flags to the host
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_resource.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_resource.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index e01db120efff..c7efbd47ab84 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -35,6 +35,11 @@
#define VMW_RES_SURFACE ttm_driver_type1
#define VMW_RES_STREAM ttm_driver_type2
+/* XXX: This isn't a real hardware flag, but just a hack for kernel to
+ * know about primary surfaces. Find a better way to accomplish this.
+ */
+#define SVGA3D_SURFACE_HINT_SCANOUT (1 << 9)
+
struct vmw_user_context {
struct ttm_base_object base;
struct vmw_resource res;
@@ -599,8 +604,17 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
if (unlikely(ret != 0))
goto out_err1;
+ if (srf->flags & SVGA3D_SURFACE_HINT_SCANOUT) {
+ /* we should not send this flag down to hardware since
+ * its not a official one
+ */
+ srf->flags &= ~SVGA3D_SURFACE_HINT_SCANOUT;
+ srf->scanout = true;
+ } else {
+ srf->scanout = false;
+ }
- if (srf->flags & (1 << 9) &&
+ if (srf->scanout &&
srf->num_sizes == 1 &&
srf->sizes[0].width == 64 &&
srf->sizes[0].height == 64 &&