Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179937
b: refs/heads/master
c: 8ba5152
h: refs/heads/master
i:
  179935: 7006a98
v: v3
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Jan 25, 2010
1 parent bdd2804 commit 5c061ca
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0eaddb28d3460f13102cd82cf58af875bfb1bd53
refs/heads/master: 8ba5152a3acd5914cade42a1c8c9dc58ad8d1a89
9 changes: 9 additions & 0 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ struct ttm_placement vmw_vram_placement = {
.busy_placement = &vram_placement_flags
};

struct ttm_placement vmw_vram_sys_placement = {
.fpfn = 0,
.lpfn = 0,
.num_placement = 1,
.placement = &vram_placement_flags,
.num_busy_placement = 1,
.busy_placement = &sys_placement_flags
};

struct ttm_placement vmw_vram_ne_placement = {
.fpfn = 0,
.lpfn = 0,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ extern int vmw_mmap(struct file *filp, struct vm_area_struct *vma);

extern struct ttm_placement vmw_vram_placement;
extern struct ttm_placement vmw_vram_ne_placement;
extern struct ttm_placement vmw_vram_sys_placement;
extern struct ttm_placement vmw_sys_placement;
extern struct ttm_bo_driver vmw_bo_driver;
extern int vmw_dma_quiescent(struct drm_device *dev);
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,32 @@ 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.
*/

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;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ int vmw_dmabuf_alloc_ioctl(struct drm_device *dev, void *data,
}

ret = vmw_dmabuf_init(dev_priv, &vmw_user_bo->dma, req->size,
&vmw_vram_placement, true,
&vmw_vram_sys_placement, true,
&vmw_user_dmabuf_destroy);
if (unlikely(ret != 0))
return ret;
Expand Down

0 comments on commit 5c061ca

Please sign in to comment.