0450-drm-vc4-Fix-ioctl-permissions-for-render-nodes.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 590e54b9ca38b0700b1b61cdd414205cdc3eef8b Mon Sep 17 00:00:00 2001
  2. From: Herve Jourdain <herve.jourdain@neuf.fr>
  3. Date: Wed, 1 Jun 2016 02:24:46 +0800
  4. Subject: [PATCH] drm/vc4: Fix ioctl permissions for render nodes.
  5. Contrary to other flags to DRM_IOCTL_DEF_DRV(), which restrict usage,
  6. the flag for render node is an enabler (the IOCTL can't be used from
  7. render node if it's not present). So DRM_RENDER_ALLOW needs to be
  8. added to all the flags that were previously 0.
  9. Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
  10. Reviewed-by: Eric Anholt <eric@anholt.net>
  11. Fixes: 0cd3e2747662 ("drm/vc4: Add missing render node support")
  12. (cherry picked from commit b10c22e5f9902a329450c2027e9291b71e9f1602)
  13. ---
  14. drivers/gpu/drm/vc4/vc4_drv.c | 12 ++++++------
  15. 1 file changed, 6 insertions(+), 6 deletions(-)
  16. --- a/drivers/gpu/drm/vc4/vc4_drv.c
  17. +++ b/drivers/gpu/drm/vc4/vc4_drv.c
  18. @@ -88,12 +88,12 @@ static const struct file_operations vc4_
  19. };
  20. static const struct drm_ioctl_desc vc4_drm_ioctls[] = {
  21. - DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, 0),
  22. - DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, 0),
  23. - DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, 0),
  24. - DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, 0),
  25. - DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, 0),
  26. - DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, 0),
  27. + DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, DRM_RENDER_ALLOW),
  28. + DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, DRM_RENDER_ALLOW),
  29. + DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, DRM_RENDER_ALLOW),
  30. + DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, DRM_RENDER_ALLOW),
  31. + DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, DRM_RENDER_ALLOW),
  32. + DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, DRM_RENDER_ALLOW),
  33. DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl,
  34. DRM_ROOT_ONLY),
  35. };