Commit 1985f999 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz Committed by Thomas Hellstrom

drm/vmwgfx: Invalidate surface on non-readback unbind

Fixes error messages in vmware.log
Signed-off-by: default avatarJakob Bornecrantz <jakob@vmware.com>
Reviewed-by: default avatarMichael Banack <banackm@vmware.com>
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
parent 96b43626
...@@ -1043,15 +1043,19 @@ static int vmw_gb_surface_unbind(struct vmw_resource *res, ...@@ -1043,15 +1043,19 @@ static int vmw_gb_surface_unbind(struct vmw_resource *res,
} *cmd1; } *cmd1;
struct { struct {
SVGA3dCmdHeader header; SVGA3dCmdHeader header;
SVGA3dCmdBindGBSurface body; SVGA3dCmdInvalidateGBSurface body;
} *cmd2; } *cmd2;
struct {
SVGA3dCmdHeader header;
SVGA3dCmdBindGBSurface body;
} *cmd3;
uint32_t submit_size; uint32_t submit_size;
uint8_t *cmd; uint8_t *cmd;
BUG_ON(bo->mem.mem_type != VMW_PL_MOB); BUG_ON(bo->mem.mem_type != VMW_PL_MOB);
submit_size = sizeof(*cmd2) + (readback ? sizeof(*cmd1) : 0); submit_size = sizeof(*cmd3) + (readback ? sizeof(*cmd1) : sizeof(*cmd2));
cmd = vmw_fifo_reserve(dev_priv, submit_size); cmd = vmw_fifo_reserve(dev_priv, submit_size);
if (unlikely(cmd == NULL)) { if (unlikely(cmd == NULL)) {
DRM_ERROR("Failed reserving FIFO space for surface " DRM_ERROR("Failed reserving FIFO space for surface "
...@@ -1059,18 +1063,24 @@ static int vmw_gb_surface_unbind(struct vmw_resource *res, ...@@ -1059,18 +1063,24 @@ static int vmw_gb_surface_unbind(struct vmw_resource *res,
return -ENOMEM; return -ENOMEM;
} }
cmd2 = (void *) cmd;
if (readback) { if (readback) {
cmd1 = (void *) cmd; cmd1 = (void *) cmd;
cmd1->header.id = SVGA_3D_CMD_READBACK_GB_SURFACE; cmd1->header.id = SVGA_3D_CMD_READBACK_GB_SURFACE;
cmd1->header.size = sizeof(cmd1->body); cmd1->header.size = sizeof(cmd1->body);
cmd1->body.sid = res->id; cmd1->body.sid = res->id;
cmd2 = (void *) &cmd1[1]; cmd3 = (void *) &cmd1[1];
} else {
cmd2 = (void *) cmd;
cmd2->header.id = SVGA_3D_CMD_INVALIDATE_GB_SURFACE;
cmd2->header.size = sizeof(cmd2->body);
cmd2->body.sid = res->id;
cmd3 = (void *) &cmd2[1];
} }
cmd2->header.id = SVGA_3D_CMD_BIND_GB_SURFACE;
cmd2->header.size = sizeof(cmd2->body); cmd3->header.id = SVGA_3D_CMD_BIND_GB_SURFACE;
cmd2->body.sid = res->id; cmd3->header.size = sizeof(cmd3->body);
cmd2->body.mobid = SVGA3D_INVALID_ID; cmd3->body.sid = res->id;
cmd3->body.mobid = SVGA3D_INVALID_ID;
vmw_fifo_commit(dev_priv, submit_size); vmw_fifo_commit(dev_priv, submit_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment