aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/drm
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2020-05-17 16:16:43 -0700
committerMarge Bot <[email protected]>2020-05-18 19:00:47 +0000
commita6184eae3123840b1ff3d78e24454610e3013013 (patch)
tree836289b7bc3b9a9d39acd3e15aafa597c35cfcd5 /src/freedreno/drm
parent106c2a65dbd6b523a1a68f8b0e913294edc7bbd6 (diff)
freedreno/drm: handle ancient kernels
Older kernels did not support `MSM_INFO_GET_IOVA`. But this is only required for (a) clover (ie. `fd_set_global_binding()`) and drm paths that are limited to newer kernels. So move the location of the assert to fix new userspace on old kernels. Fixes: c9e8df61dc8 ("freedreno: Initialize the bo's iova at creation time.") Signed-off-by: Rob Clark <[email protected]> Tested-by: Ilia Mirkin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5081>
Diffstat (limited to 'src/freedreno/drm')
-rw-r--r--src/freedreno/drm/freedreno_bo.c2
-rw-r--r--src/freedreno/drm/msm_bo.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/freedreno/drm/freedreno_bo.c b/src/freedreno/drm/freedreno_bo.c
index a4218cd8ffb..b6d5cdd9bec 100644
--- a/src/freedreno/drm/freedreno_bo.c
+++ b/src/freedreno/drm/freedreno_bo.c
@@ -236,6 +236,8 @@ fd_bo_mark_for_dump(struct fd_bo *bo)
uint64_t fd_bo_get_iova(struct fd_bo *bo)
{
+ /* ancient kernels did not support this */
+ assert(bo->iova != 0);
return bo->iova;
}
diff --git a/src/freedreno/drm/msm_bo.c b/src/freedreno/drm/msm_bo.c
index da2609903c1..7253a8cc7bd 100644
--- a/src/freedreno/drm/msm_bo.c
+++ b/src/freedreno/drm/msm_bo.c
@@ -112,7 +112,8 @@ static uint64_t msm_bo_iova(struct fd_bo *bo)
int ret;
ret = drmCommandWriteRead(bo->dev->fd, DRM_MSM_GEM_INFO, &req, sizeof(req));
- debug_assert(ret == 0);
+ if (ret)
+ return 0;
return req.value;
}