i915_gem_object_flush_map(obj);
i915_gem_object_unpin_map(obj);
- i915_gem_object_lock(obj);
- err = i915_gem_object_set_to_gtt_domain(obj, false);
- i915_gem_object_unlock(obj);
- if (err)
- goto err;
-
vma = i915_vma_instance(obj, vma->vm, NULL);
if (IS_ERR(vma)) {
err = PTR_ERR(vma);
if (err)
goto err_obj;
- i915_gem_object_lock(obj);
- err = i915_gem_object_set_to_wc_domain(obj, true);
- i915_gem_object_unlock(obj);
- if (err)
- goto err_obj;
-
return vma;
err_obj:
static int guc_log_map(struct intel_guc_log *log)
{
void *vaddr;
- int ret;
lockdep_assert_held(&log->relay.lock);
if (!log->vma)
return -ENODEV;
- i915_gem_object_lock(log->vma->obj);
- ret = i915_gem_object_set_to_wc_domain(log->vma->obj, true);
- i915_gem_object_unlock(log->vma->obj);
- if (ret)
- return ret;
-
/*
* Create a WC (Uncached for read) vmalloc mapping of log
* buffer pages, so that we can directly get the data
* (up-to-date) from memory.
*/
vaddr = i915_gem_object_pin_map(log->vma->obj, I915_MAP_WC);
- if (IS_ERR(vaddr)) {
- DRM_ERROR("Couldn't map log buffer pages %d\n", ret);
+ if (IS_ERR(vaddr))
return PTR_ERR(vaddr);
- }
log->relay.buf_addr = vaddr;
if (ret)
goto out_free;
- i915_gem_object_lock(overlay->reg_bo);
- ret = i915_gem_object_set_to_gtt_domain(overlay->reg_bo, true);
- i915_gem_object_unlock(overlay->reg_bo);
- if (ret)
- goto out_reg_bo;
-
memset_io(overlay->regs, 0, sizeof(struct overlay_registers));
update_polyphase_filter(overlay->regs);
update_reg_attrs(overlay, overlay->regs);
DRM_INFO("Initialized overlay support.\n");
return;
-out_reg_bo:
- i915_gem_object_put(overlay->reg_bo);
out_free:
kfree(overlay);
}