diff options
author | Eric Anholt <eric@anholt.net> | 2018-04-23 17:46:08 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2018-04-30 10:42:03 -0700 |
commit | d34deab907605a81eec83afe006fad2e5b4673b4 (patch) | |
tree | 80e5dd7af44bcc44215d2481b3d3e845561898e7 /drivers | |
parent | 9f99963a43b735160052debbef3d99ad344db61d (diff) | |
download | linux-d34deab907605a81eec83afe006fad2e5b4673b4.tar.bz2 |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/drm_prime.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index caf675e3e692..397b46b33739 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -409,7 +409,10 @@ void *drm_gem_dmabuf_vmap(struct dma_buf *dma_buf) struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; - return dev->driver->gem_prime_vmap(obj); + if (dev->driver->gem_prime_vmap) + return dev->driver->gem_prime_vmap(obj); + else + return NULL; } EXPORT_SYMBOL(drm_gem_dmabuf_vmap); @@ -426,7 +429,8 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) struct drm_gem_object *obj = dma_buf->priv; struct drm_device *dev = obj->dev; - dev->driver->gem_prime_vunmap(obj, vaddr); + if (dev->driver->gem_prime_vunmap) + dev->driver->gem_prime_vunmap(obj, vaddr); } EXPORT_SYMBOL(drm_gem_dmabuf_vunmap); |