gallium needs to know if the kernel is new enough to support explicit
fencing, dynamically grown ringbuffers, etc.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
{
return dev->fd;
}
+
+enum fd_version fd_device_version(struct fd_device *dev)
+{
+ return dev->version;
+}
void fd_device_del(struct fd_device *dev);
int fd_device_fd(struct fd_device *dev);
+enum fd_version {
+ FD_VERSION_MADVISE = 1, /* kernel supports madvise */
+ FD_VERSION_UNLIMITED_CMDS = 1, /* submits w/ >4 cmd buffers (growable ringbuffer) */
+};
+enum fd_version fd_device_version(struct fd_device *dev);
/* pipe functions:
*/
struct fd_device {
int fd;
- int version;
+ enum fd_version version;
atomic_t refcnt;
/* tables to keep track of bo's, to avoid "evil-twin" fd_bo objects:
int ret;
/* older kernels do not support this: */
- if (bo->dev->version < 1)
+ if (bo->dev->version < FD_VERSION_MADVISE)
return willneed;
ret = drmCommandWriteRead(bo->dev->fd, DRM_MSM_GEM_MADVISE, &req, sizeof(req));