diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c')
| -rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 29 | 
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 8e396850513..51d9f9f1d7f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -538,8 +538,11 @@ static void vmw_apply_relocations(struct vmw_sw_context *sw_context)  		reloc = &sw_context->relocs[i];  		validate = &sw_context->val_bufs[reloc->index];  		bo = validate->bo; -		reloc->location->offset += bo->offset; -		reloc->location->gmrId = vmw_dmabuf_gmr(bo); +		if (bo->mem.mem_type == TTM_PL_VRAM) { +			reloc->location->offset += bo->offset; +			reloc->location->gmrId = SVGA_GMR_FRAMEBUFFER; +		} else +			reloc->location->gmrId = bo->mem.start;  	}  	vmw_free_relocations(sw_context);  } @@ -563,25 +566,14 @@ static int vmw_validate_single_buffer(struct vmw_private *dev_priv,  {  	int ret; -	if (vmw_dmabuf_gmr(bo) != SVGA_GMR_NULL) -		return 0; -  	/** -	 * Put BO in VRAM, only if there is space. +	 * Put BO in VRAM if there is space, otherwise as a GMR. +	 * If there is no space in VRAM and GMR ids are all used up, +	 * start evicting GMRs to make room. If the DMA buffer can't be +	 * used as a GMR, this will return -ENOMEM.  	 */ -	ret = ttm_bo_validate(bo, &vmw_vram_sys_placement, true, false, 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); +	ret = ttm_bo_validate(bo, &vmw_vram_gmr_placement, true, false, false);  	if (likely(ret == 0 || ret == -ERESTARTSYS))  		return ret; @@ -590,6 +582,7 @@ static int vmw_validate_single_buffer(struct vmw_private *dev_priv,  	 * previous contents.  	 */ +	DRM_INFO("Falling through to VRAM.\n");  	ret = ttm_bo_validate(bo, &vmw_vram_placement, true, false, false);  	return ret;  }  | 
