diff options
author | Tony Lindgren <tony@atomide.com> | 2010-02-10 18:18:13 -0800 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-02-10 18:18:13 -0800 |
commit | 0482e3c6f704d25b6a4e3c940caeeacece4e6d74 (patch) | |
tree | a8506b9b15ed9a31c2171fc7b461ef52453307b0 /drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |
parent | 9ba874506b7b3883d78b8cad61eba39c4bb09885 (diff) | |
parent | a6c7fdd29350a74ba5f76809436de9c3d6763009 (diff) | |
download | kernel-crypto-0482e3c6f704d25b6a4e3c940caeeacece4e6d74.tar.gz kernel-crypto-0482e3c6f704d25b6a4e3c940caeeacece4e6d74.tar.xz kernel-crypto-0482e3c6f704d25b6a4e3c940caeeacece4e6d74.zip |
Merge branch 'omap-fixes-for-linus' into omap-for-linus
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 2e92da56740..d69caf92ffe 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -490,10 +490,29 @@ static int vmw_validate_single_buffer(struct vmw_private *dev_priv, if (vmw_dmabuf_gmr(bo) != SVGA_GMR_NULL) return 0; + /** + * Put BO in VRAM, only if there is space. + */ + + ret = ttm_bo_validate(bo, &vmw_vram_sys_placement, true, false); + if (unlikely(ret == -ERESTARTSYS)) + return ret; + + /** + * Otherwise, set it up as GMR. + */ + + if (vmw_dmabuf_gmr(bo) != SVGA_GMR_NULL) + return 0; + ret = vmw_gmr_bind(dev_priv, bo); if (likely(ret == 0 || ret == -ERESTARTSYS)) return ret; + /** + * If that failed, try VRAM again, this time evicting + * previous contents. + */ ret = ttm_bo_validate(bo, &vmw_vram_placement, true, false); return ret; |