-
-
Save tiagovignatti/d8fc18e86d1e63545cb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c | |
index e868db6..8b87c86 100644 | |
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c | |
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c | |
@@ -228,6 +228,15 @@ static int i915_gem_begin_cpu_access(struct dma_buf *dma_buf, size_t start, size | |
return ret; | |
} | |
+static void i915_gem_end_cpu_access(struct dma_buf *dma_buf, size_t start, size_t length, enum dma_data_direction direction) | |
+{ | |
+ struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); | |
+ bool write = (direction == DMA_BIDIRECTIONAL || direction == DMA_TO_DEVICE); | |
+ | |
+ if (i915_gem_object_set_to_gtt_domain(obj, write)) | |
+ DRM_ERROR("failed to set bo into the GTT\n"); | |
+} | |
+ | |
static const struct dma_buf_ops i915_dmabuf_ops = { | |
.map_dma_buf = i915_gem_map_dma_buf, | |
.unmap_dma_buf = i915_gem_unmap_dma_buf, | |
@@ -240,6 +249,7 @@ static const struct dma_buf_ops i915_dmabuf_ops = { | |
.vmap = i915_gem_dmabuf_vmap, | |
.vunmap = i915_gem_dmabuf_vunmap, | |
.begin_cpu_access = i915_gem_begin_cpu_access, | |
+ .end_cpu_access = i915_gem_end_cpu_access, | |
}; | |
struct dma_buf *i915_gem_prime_export(struct drm_device *dev, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment