drm/vc4: Add a getparam to signal support for branches.
authorEric Anholt <eric@anholt.net>
Sat, 2 Jul 2016 21:14:27 +0000 (14:14 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 15 Jul 2016 22:19:51 +0000 (15:19 -0700)
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.

Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/vc4/vc4_drv.c
include/uapi/drm/vc4_drm.h

index 047d7a265ceb77094f501bece5f70abcae5a9202..9435894822d56f4f42bf0036e022b69865caf730 100644 (file)
@@ -76,6 +76,9 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
                args->value = V3D_READ(V3D_IDENT2);
                pm_runtime_put(&vc4->v3d->pdev->dev);
                break;
+       case DRM_VC4_PARAM_SUPPORTS_BRANCHES:
+               args->value = true;
+               break;
        default:
                DRM_DEBUG("Unknown parameter %d\n", args->param);
                return -EINVAL;
index 1143e954048d1f8192142361315531066c9ac9af..ad7edc3edf7ca1d653a0bc025a5eda6692b74370 100644 (file)
@@ -285,6 +285,7 @@ struct drm_vc4_get_hang_state {
 #define DRM_VC4_PARAM_V3D_IDENT0               0
 #define DRM_VC4_PARAM_V3D_IDENT1               1
 #define DRM_VC4_PARAM_V3D_IDENT2               2
+#define DRM_VC4_PARAM_SUPPORTS_BRANCHES                3
 
 struct drm_vc4_get_param {
        __u32 param;