0479-drm-vc4-Add-a-getparam-to-signal-support-for-branche.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 79c9521559f8c8249bf1062353bfd3b710d939c4 Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Sat, 2 Jul 2016 14:14:27 -0700
  4. Subject: [PATCH] drm/vc4: Add a getparam to signal support for branches.
  5. Userspace needs to know if it can create shaders that do branching.
  6. Otherwise, for backwards compatibility with old kernels it needs to
  7. lower if statements to conditional assignments.
  8. Signed-off-by: Eric Anholt <eric@anholt.net>
  9. (cherry picked from commit 7363cee5b467c31dc3af2ac98df0634bb8bbc668)
  10. ---
  11. drivers/gpu/drm/vc4/vc4_drv.c | 3 +++
  12. include/uapi/drm/vc4_drm.h | 1 +
  13. 2 files changed, 4 insertions(+)
  14. --- a/drivers/gpu/drm/vc4/vc4_drv.c
  15. +++ b/drivers/gpu/drm/vc4/vc4_drv.c
  16. @@ -97,6 +97,9 @@ static int vc4_get_param_ioctl(struct dr
  17. args->value = V3D_READ(V3D_IDENT2);
  18. pm_runtime_put(&vc4->v3d->pdev->dev);
  19. break;
  20. + case DRM_VC4_PARAM_SUPPORTS_BRANCHES:
  21. + args->value = true;
  22. + break;
  23. default:
  24. DRM_DEBUG("Unknown parameter %d\n", args->param);
  25. return -EINVAL;
  26. --- a/include/uapi/drm/vc4_drm.h
  27. +++ b/include/uapi/drm/vc4_drm.h
  28. @@ -285,6 +285,7 @@ struct drm_vc4_get_hang_state {
  29. #define DRM_VC4_PARAM_V3D_IDENT0 0
  30. #define DRM_VC4_PARAM_V3D_IDENT1 1
  31. #define DRM_VC4_PARAM_V3D_IDENT2 2
  32. +#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3
  33. struct drm_vc4_get_param {
  34. __u32 param;