@@ -1048,6 +1048,17 @@ static const struct vm_operations_struct vm_ops = {
.close = drm_gem_vm_close,
};
+static enum dma_buf_map_info msm_gem_map_info(struct drm_gem_object *obj)
+{
+ struct msm_gem_object *msm_obj = to_msm_bo(obj);
+
+ switch (msm_obj->flags & MSM_BO_CACHE_MASK) {
+ case MSM_BO_WC: return DMA_BUF_COHERENT_WC;
+ case MSM_BO_CACHED_COHERENT: return DMA_BUF_COHERENT_CACHED;
+ default: return DMA_BUF_MAP_INCOHERENT;
+ }
+}
+
static const struct drm_gem_object_funcs msm_gem_object_funcs = {
.free = msm_gem_free_object,
.pin = msm_gem_prime_pin,
@@ -1057,6 +1068,7 @@ static const struct drm_gem_object_funcs msm_gem_object_funcs = {
.vunmap = msm_gem_prime_vunmap,
.mmap = msm_gem_object_mmap,
.vm_ops = &vm_ops,
+ .map_info = msm_gem_map_info,
};
static int msm_gem_new_impl(struct drm_device *dev,