summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--freedreno/freedreno_device.c5
-rw-r--r--freedreno/freedreno_drmif.h5
-rw-r--r--freedreno/freedreno_priv.h2
-rw-r--r--freedreno/msm/msm_bo.c2
4 files changed, 12 insertions, 2 deletions
diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c
index 3da5c7c1..b99bce2f 100644
--- a/freedreno/freedreno_device.c
+++ b/freedreno/freedreno_device.c
@@ -140,3 +140,8 @@ int fd_device_fd(struct fd_device *dev)
{
return dev->fd;
}
+
+enum fd_version fd_device_version(struct fd_device *dev)
+{
+ return dev->version;
+}
diff --git a/freedreno/freedreno_drmif.h b/freedreno/freedreno_drmif.h
index 15ae0756..af5e1dac 100644
--- a/freedreno/freedreno_drmif.h
+++ b/freedreno/freedreno_drmif.h
@@ -89,6 +89,11 @@ struct fd_device * fd_device_ref(struct fd_device *dev);
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:
*/
diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h
index f3ddd77d..5e8f03d4 100644
--- a/freedreno/freedreno_priv.h
+++ b/freedreno/freedreno_priv.h
@@ -83,7 +83,7 @@ struct fd_bo_cache {
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:
diff --git a/freedreno/msm/msm_bo.c b/freedreno/msm/msm_bo.c
index cfaec827..72471df6 100644
--- a/freedreno/msm/msm_bo.c
+++ b/freedreno/msm/msm_bo.c
@@ -98,7 +98,7 @@ static int msm_bo_madvise(struct fd_bo *bo, int willneed)
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));