aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-03-13 21:32:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-13 21:32:16 -0700
commitc60f7d5a8e7c639de5d9dfe07e1e91d302d506e4 (patch)
treec1d12d4963768232f3489f7dc5a6626ddd3d5fde /drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
parentMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux (diff)
parentMerge tag 'ttm-fixes-3.14-2014-03-12' of git://people.freedesktop.org/~thomash/linux into drm-fixes (diff)
downloadlinux-dev-c60f7d5a8e7c639de5d9dfe07e1e91d302d506e4.tar.xz
linux-dev-c60f7d5a8e7c639de5d9dfe07e1e91d302d506e4.zip
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Pretty minor set of fixes for radeon, ttm and vmwgfx. The ttm ones are a regression and an oops seen on server chipsets" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/vmwgfx: Fix a surface reference corner-case in legacy emulation mode drm/radeon/cik: properly set compute ring status on disable drm/radeon/cik: stop the sdma engines in the enable() function drm/radeon/cik: properly set sdma ring status on disable drm/radeon: fix runpm disabling on non-PX harder drm/ttm: don't oops if no invalidate_caches() drm/ttm: Work around performance regression with VM_PFNMAP
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_surface.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_surface.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 82468d902915..e7af580ab977 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -830,6 +830,24 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
if (unlikely(ret != 0))
goto out_unlock;
+ /*
+ * A gb-aware client referencing a shared surface will
+ * expect a backup buffer to be present.
+ */
+ if (dev_priv->has_mob && req->shareable) {
+ uint32_t backup_handle;
+
+ ret = vmw_user_dmabuf_alloc(dev_priv, tfile,
+ res->backup_size,
+ true,
+ &backup_handle,
+ &res->backup);
+ if (unlikely(ret != 0)) {
+ vmw_resource_unreference(&res);
+ goto out_unlock;
+ }
+ }
+
tmp = vmw_resource_reference(&srf->res);
ret = ttm_prime_object_init(tfile, res->backup_size, &user_srf->prime,
req->shareable, VMW_RES_SURFACE,