freedreno: Enable GL_EXT_memory_object and GL_EXT_memory_object_fd
authorEduardo Lima Mitev <elima@igalia.com>
Tue, 7 Apr 2020 06:54:16 +0000 (08:54 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 Aug 2020 20:40:40 +0000 (20:40 +0000)
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>

src/freedreno/drm/freedreno_drmif.h
src/gallium/drivers/freedreno/freedreno_screen.c

index a14ab60cf7cc2e5a3268246863a49cce63afd295..15038475e7427afc7e8dd088d46921e0f35b2cdf 100644 (file)
@@ -94,6 +94,7 @@ enum fd_version {
        FD_VERSION_BO_IOVA = 3,            /* supports fd_bo_get/put_iova() */
        FD_VERSION_SOFTPIN = 4,            /* adds softpin, bo name, and dump flag */
        FD_VERSION_ROBUSTNESS = 5,         /* adds FD_NR_FAULTS and FD_PP_PGTABLE */
+       FD_VERSION_MEMORY_FD = 2,          /* supports shared memory objects */
 };
 enum fd_version fd_device_version(struct fd_device *dev);
 
index 0cd76f8dd50a34ccd08a84e5a13c094cbde138f4..9f0867ba83af6119a950515d9f70e9ee984b2d39 100644 (file)
@@ -453,6 +453,8 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return 10;
        case PIPE_CAP_UMA:
                return 1;
+       case PIPE_CAP_MEMOBJ:
+               return fd_device_version(screen->dev) >= FD_VERSION_MEMORY_FD;
        case PIPE_CAP_NATIVE_FENCE_FD:
                return fd_device_version(screen->dev) >= FD_VERSION_FENCE_FD;
        default: