Userspace needs to know if it can create shaders that do branching. Otherwise, for backwards compatibility with old kernels it needs to lower if statements to conditional assignments.
Unified · Split
| @@ -76,6 +76,9 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, · 75 unmodified lines | ||
| 76 | 76 | args->value = V3D_READ(V3D_IDENT2); |
| 77 | 77 | pm_runtime_put(&vc4->v3d->pdev->dev); |
| 78 | 78 | break; |
| 79 | + case DRM_VC4_PARAM_SUPPORTS_BRANCHES: | |
| 80 | + args->value = true; | |
| 81 | + break; | |
| 79 | 82 | default: |
| 80 | 83 | DRM_DEBUG("Unknown parameter %d\n", args->param); |
| 81 | 84 | return -EINVAL; |
| @@ -285,6 +285,7 @@ struct drm_vc4_get_hang_state { · 284 unmodified lines | ||
| 285 | 285 | #define DRM_VC4_PARAM_V3D_IDENT0 0 |
| 286 | 286 | #define DRM_VC4_PARAM_V3D_IDENT1 1 |
| 287 | 287 | #define DRM_VC4_PARAM_V3D_IDENT2 2 |
| 288 | +#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3 | |
| 288 | 289 | |
| 289 | 290 | struct drm_vc4_get_param { |
| 290 | 291 | __u32 param; |