* <wallbraker@gmail.com> Chia-I Wu <olv@lunarg.com>
*/
+#include <xf86drm.h>
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_format.h"
screen->default_throttle_frames = throttle_ret->val.val_int;
}
+#ifdef DRM_CAP_PRIME /* Old libdrm? */
if (dmabuf_ret && dmabuf_ret->val.val_bool) {
- dri2ImageExtension.base.version = 7;
- dri2ImageExtension.createImageFromFds = dri2_from_fds;
+ uint64_t cap;
+
+ if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, &cap) == 0 &&
+ (cap & DRM_PRIME_CAP_IMPORT)) {
+
+ dri2ImageExtension.base.version = 7;
+ dri2ImageExtension.createImageFromFds = dri2_from_fds;
+ }
}
+#endif /* DRM_CAP_PRIME */
sPriv->extensions = dri_screen_extensions;
.val.val_int = 2,
};
-/* Technically this requires kernel support that is not yet
- * widespread.
- *
- * We could check for support in create_screen and return the correct
- * value, but for now just return true in all cases.
- */
static const struct drm_conf_ret share_fd_ret = {
.type = DRM_CONF_BOOL,
.val.val_int = true,