aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark2016-06-01 13:35:44 -0500
committerRob Clark2016-07-20 18:42:21 -0500
commit904f1361ae11d53ee4d0cf297d38f4c243ee8d69 (patch)
treeea27244f8f77c4a66b95c2b33da26699840c9adb /freedreno
parentfe07584e050db55d0e41ed52c0c42f5e8ae84315 (diff)
downloadexternal-libgbm-904f1361ae11d53ee4d0cf297d38f4c243ee8d69.tar.gz
external-libgbm-904f1361ae11d53ee4d0cf297d38f4c243ee8d69.tar.xz
external-libgbm-904f1361ae11d53ee4d0cf297d38f4c243ee8d69.zip
freedreno: expose kernel driver version
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>
Diffstat (limited to 'freedreno')
-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)
140{ 140{
141 return dev->fd; 141 return dev->fd;
142} 142}
143
144enum fd_version fd_device_version(struct fd_device *dev)
145{
146 return dev->version;
147}
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);
89void fd_device_del(struct fd_device *dev); 89void fd_device_del(struct fd_device *dev);
90int fd_device_fd(struct fd_device *dev); 90int fd_device_fd(struct fd_device *dev);
91 91
92enum fd_version {
93 FD_VERSION_MADVISE = 1, /* kernel supports madvise */
94 FD_VERSION_UNLIMITED_CMDS = 1, /* submits w/ >4 cmd buffers (growable ringbuffer) */
95};
96enum fd_version fd_device_version(struct fd_device *dev);
92 97
93/* pipe functions: 98/* pipe functions:
94 */ 99 */
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 {
83 83
84struct fd_device { 84struct fd_device {
85 int fd; 85 int fd;
86 int version; 86 enum fd_version version;
87 atomic_t refcnt; 87 atomic_t refcnt;
88 88
89 /* tables to keep track of bo's, to avoid "evil-twin" fd_bo objects: 89 /* 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)
98 int ret; 98 int ret;
99 99
100 /* older kernels do not support this: */ 100 /* older kernels do not support this: */
101 if (bo->dev->version < 1) 101 if (bo->dev->version < FD_VERSION_MADVISE)
102 return willneed; 102 return willneed;
103 103
104 ret = drmCommandWriteRead(bo->dev->fd, DRM_MSM_GEM_MADVISE, &req, sizeof(req)); 104 ret = drmCommandWriteRead(bo->dev->fd, DRM_MSM_GEM_MADVISE, &req, sizeof(req));