if (!buf)
return NULL;
-
+ pipe_reference_init(&buf->base.reference, 1);
buf->bo = drm_intel_bo_gem_create_from_name(idws->gem, name, handle);
+ buf->base.size = buf->bo->size;
+ buf->base.sws = &idws->base;
buf->flinked = TRUE;
buf->flink = handle;
+
if (!buf->bo)
goto err;
drm_intel_bufmgr_gem_enable_reuse(idws->gem);
idws->dump_cmd = debug_get_bool_option("I965_DUMP_CMD", FALSE);
+ idws->send_cmd = debug_get_bool_option("I965_SEND_CMD", FALSE);
return brw_create_screen(&idws->base, deviceID);
}
goto err;
buf->base.size = size;
+ buf->base.sws = sws;
*bo_out = &buf->base;
return PIPE_OK;
read = I915_GEM_DOMAIN_INSTRUCTION;
write = I915_GEM_DOMAIN_INSTRUCTION;
break;
+ case BRW_USAGE_BLIT_DEST:
+ read = I915_GEM_DOMAIN_RENDER;
+ write = I915_GEM_DOMAIN_RENDER;
+ break;
+ case BRW_USAGE_BLIT_SOURCE:
+ read = 0;
+ write = I915_GEM_DOMAIN_RENDER;
+ break;
case BRW_USAGE_RENDER_TARGET:
read = I915_GEM_DOMAIN_RENDER;
write = 0;
unsigned bytes_used)
{
struct i965_libdrm_buffer *buf = i965_libdrm_buffer(buffer);
+ struct i965_libdrm_winsys *idws = i965_libdrm_winsys(buffer->sws);
int ret;
- ret = dri_bo_exec(buf->bo, bytes_used, NULL, 0, 0);
- if (ret)
- return PIPE_ERROR;
+ if (idws->send_cmd) {
+ ret = dri_bo_exec(buf->bo, bytes_used, NULL, 0, 0);
+ if (ret)
+ return PIPE_ERROR;
+ }
return PIPE_OK;
}