aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_screen.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2016-06-27 11:50:17 -0700
committerChad Versace <[email protected]>2016-06-29 09:34:21 -0700
commita2ae888929bd0e36b3bdf8d789853440b5a23097 (patch)
treeecd4593a00ac308ff4f9437d5af5d2de9beb3499 /src/mesa/drivers/dri/i965/intel_screen.c
parent844e0bd946ea2708a45fef339deea054e55c4359 (diff)
i965: Use intel_get_param() more often
Replace some open-coded ioctls with intel_get_param(). This is just a cleanup. No change in behavior. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_screen.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index b693c45c0e5..f724a56dbd2 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1605,12 +1605,10 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
(ret != -1 || errno != EINVAL);
}
- struct drm_i915_getparam getparam;
- getparam.param = I915_PARAM_CMD_PARSER_VERSION;
- getparam.value = &intelScreen->cmd_parser_version;
- const int ret = drmIoctl(psp->fd, DRM_IOCTL_I915_GETPARAM, &getparam);
- if (ret == -1)
+ if (intel_get_param(intelScreen, I915_PARAM_CMD_PARSER_VERSION,
+ &intelScreen->cmd_parser_version) < 0) {
intelScreen->cmd_parser_version = 0;
+ }
/* Haswell requires command parser version 6 in order to write to the
* MI_MATH GPR registers, and version 7 in order to use
@@ -1630,12 +1628,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
intelScreen->program_id = 1;
if (intelScreen->devinfo->has_resource_streamer) {
- int val = -1;
- getparam.param = I915_PARAM_HAS_RESOURCE_STREAMER;
- getparam.value = &val;
-
- drmIoctl(psp->fd, DRM_IOCTL_I915_GETPARAM, &getparam);
- intelScreen->has_resource_streamer = val > 0;
+ intelScreen->has_resource_streamer =
+ intel_get_boolean(intelScreen, I915_PARAM_HAS_RESOURCE_STREAMER);
}
return (const __DRIconfig**) intel_screen_make_configs(psp);