Merge tag 'drm-misc-next-2020-10-27' of git://anongit.freedesktop.org/drm/drm-misc...
[sfrench/cifs-2.6.git] / drivers / dma-buf / heaps / heap-helpers.c
index d0696cf937af3476578bac4a10464e8948720545..fcf4ce3e2cbb5eba326b9ce669b697e03b8ae004 100644 (file)
@@ -235,7 +235,7 @@ static int dma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
        return 0;
 }
 
-static void *dma_heap_dma_buf_vmap(struct dma_buf *dmabuf)
+static int dma_heap_dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
 {
        struct heap_helper_buffer *buffer = dmabuf->priv;
        void *vaddr;
@@ -244,10 +244,14 @@ static void *dma_heap_dma_buf_vmap(struct dma_buf *dmabuf)
        vaddr = dma_heap_buffer_vmap_get(buffer);
        mutex_unlock(&buffer->lock);
 
-       return vaddr;
+       if (!vaddr)
+               return -ENOMEM;
+       dma_buf_map_set_vaddr(map, vaddr);
+
+       return 0;
 }
 
-static void dma_heap_dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)
+static void dma_heap_dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
 {
        struct heap_helper_buffer *buffer = dmabuf->priv;