drm: Make the prime vmap/vunmap hooks optional.
Some drivers leave these unimplemented, so don't make them have unimplemented stubs. Signed-off-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20180424004610.4637-2-eric@anholt.net Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
9f99963a43
commit
d34deab907
|
@ -409,7 +409,10 @@ void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf)
|
||||||
struct drm_gem_object *obj = dma_buf->priv;
|
struct drm_gem_object *obj = dma_buf->priv;
|
||||||
struct drm_device *dev = obj->dev;
|
struct drm_device *dev = obj->dev;
|
||||||
|
|
||||||
|
if (dev->driver->gem_prime_vmap)
|
||||||
return dev->driver->gem_prime_vmap(obj);
|
return dev->driver->gem_prime_vmap(obj);
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_gem_dmabuf_vmap);
|
EXPORT_SYMBOL(drm_gem_dmabuf_vmap);
|
||||||
|
|
||||||
|
@ -426,6 +429,7 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr)
|
||||||
struct drm_gem_object *obj = dma_buf->priv;
|
struct drm_gem_object *obj = dma_buf->priv;
|
||||||
struct drm_device *dev = obj->dev;
|
struct drm_device *dev = obj->dev;
|
||||||
|
|
||||||
|
if (dev->driver->gem_prime_vunmap)
|
||||||
dev->driver->gem_prime_vunmap(obj, vaddr);
|
dev->driver->gem_prime_vunmap(obj, vaddr);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_gem_dmabuf_vunmap);
|
EXPORT_SYMBOL(drm_gem_dmabuf_vunmap);
|
||||||
|
|
Loading…
Reference in New Issue