drm/etnaviv: Expose our reservation object when exporting a dmabuf.
authorEric Anholt <eric@anholt.net>
Tue, 11 Apr 2017 01:44:13 +0000 (18:44 -0700)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 5 May 2017 15:14:27 +0000 (17:14 +0200)
Without this, polling on the dma-buf (and presumably other devices
synchronizing against our rendering) would return immediately, even
while the BO was busy.

Signed-off-by: Eric Anholt <eric@anholt.net>
Cc: stable@vger.kernel.org
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@armlinux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: etnaviv@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_drv.c
drivers/gpu/drm/etnaviv/etnaviv_drv.h
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c

index 5255278dde5603a6f13587b1276c0cbc8adc908d..91e17aeee1da5ffff6530451e866b8bc9b3f01b0 100644 (file)
@@ -495,6 +495,7 @@ static struct drm_driver etnaviv_drm_driver = {
        .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
        .gem_prime_export   = drm_gem_prime_export,
        .gem_prime_import   = drm_gem_prime_import,
+       .gem_prime_res_obj  = etnaviv_gem_prime_res_obj,
        .gem_prime_pin      = etnaviv_gem_prime_pin,
        .gem_prime_unpin    = etnaviv_gem_prime_unpin,
        .gem_prime_get_sg_table = etnaviv_gem_prime_get_sg_table,
index e41f38667c1c858a6f28d69d692e72160850c48a..058389f93b697a9136549c728e01ed62c6978af1 100644 (file)
@@ -80,6 +80,7 @@ void *etnaviv_gem_prime_vmap(struct drm_gem_object *obj);
 void etnaviv_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
 int etnaviv_gem_prime_mmap(struct drm_gem_object *obj,
                           struct vm_area_struct *vma);
+struct reservation_object *etnaviv_gem_prime_res_obj(struct drm_gem_object *obj);
 struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
        struct dma_buf_attachment *attach, struct sg_table *sg);
 int etnaviv_gem_prime_pin(struct drm_gem_object *obj);
index 62b47972a52e6e71ddd066f3a61c0bef3c4ad46f..abed6f781281d30b0444784bbb6f77ba1e233d31 100644 (file)
@@ -150,3 +150,10 @@ fail:
 
        return ERR_PTR(ret);
 }
+
+struct reservation_object *etnaviv_gem_prime_res_obj(struct drm_gem_object *obj)
+{
+       struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj);
+
+       return etnaviv_obj->resv;
+}