diff options
author | Rob Clark <robdclark@chromium.org> | 2022-05-02 19:29:08 +0200 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2022-05-07 18:56:42 +0200 |
commit | 4a257ca694015f8c10aeb27bc4b32282d136b7d0 (patch) | |
tree | ff5741087e29a410444142b2ba0d0c75687c6dfa /drivers/gpu | |
parent | drm/msm/dsi: pll_7nm: remove unsupported dividers for DSI pixel clock (diff) | |
download | linux-4a257ca694015f8c10aeb27bc4b32282d136b7d0.tar.xz linux-4a257ca694015f8c10aeb27bc4b32282d136b7d0.zip |
drm/msm: Limit command submission when no IOMMU
Running the GPU without an IOMMU is not really a supported (or sane)
configuration. Yet it can be useful during SoC bringup (ie. if the
iommu driver doesn't work yet).
Lets limit it to users who already have /dev/mem access, to avoid the
chance that a user accidentially configures kernel without IOMMU
support.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220502172908.3569799-1-robdclark@gmail.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem_submit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 23b68bc945f6..9cd8c8708990 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -734,6 +734,11 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, if (args->pad) return -EINVAL; + if (unlikely(!ctx->aspace) && !capable(CAP_SYS_RAWIO)) { + DRM_ERROR_RATELIMITED("IOMMU support or CAP_SYS_RAWIO required!\n"); + return -EPERM; + } + /* for now, we just have 3d pipe.. eventually this would need to * be more clever to dispatch to appropriate gpu module: */ |