summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-03-10 15:18:31 -0800
committerEric Anholt <[email protected]>2016-07-20 16:15:15 -0700
commit83b8ca58e12ee13c4d5cd51c30c0fd19bf4f8bd2 (patch)
tree2dc65d6a2e802bbdb303205a9a75e435c7eee934
parent16985eb308ea063025874eb1094269b9b3ed4656 (diff)
vc4: Detect and report kernel support for branching.
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index 5c17c55c938..f295ae05431 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -32,6 +32,8 @@
#include "util/u_format.h"
#include "util/ralloc.h"
+#include <xf86drm.h>
+#include "vc4_drm.h"
#include "vc4_screen.h"
#include "vc4_context.h"
#include "vc4_resource.h"
@@ -502,9 +504,17 @@ vc4_supports_branches(struct vc4_screen *screen)
{
#if USE_VC4_SIMULATOR
return true;
-#else
- return false;
#endif
+
+ struct drm_vc4_get_param p = {
+ .param = DRM_VC4_PARAM_SUPPORTS_BRANCHES,
+ };
+ int ret = drmIoctl(screen->fd, DRM_IOCTL_VC4_GET_PARAM, &p);
+
+ if (ret != 0)
+ return false;
+
+ return p.value;
}
struct pipe_screen *