summaryrefslogtreecommitdiff
path: root/src/sna/kgem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-05-30 13:51:07 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-05-30 13:51:07 +0100
commit3a64ba0895035f6567e9a15357396b06c0f2d6dd (patch)
treed3abf8ad356f8bdaeda3ab8598c012a4ebf79e8f /src/sna/kgem.c
parent47e2db0ba8ae3fbcdf58cba26c58ec0932b4c90b (diff)
sna: Convert remaining drmCommands to drmIoctl
This helps to silence valgrind Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r--src/sna/kgem.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 828df037..15261b6c 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -568,6 +568,11 @@ static bool semaphores_enabled(void)
return detected;
}
+static bool __kgem_throttle(struct kgem *kgem)
+{
+ return drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_THROTTLE, NULL) == -EIO;
+}
+
void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
{
struct drm_i915_gem_get_aperture aperture;
@@ -579,7 +584,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
kgem->fd = fd;
kgem->gen = gen;
- kgem->wedged = drmCommandNone(kgem->fd, DRM_I915_GEM_THROTTLE) == -EIO;
+ kgem->wedged = __kgem_throttle(kgem);
kgem->wedged |= DBG_NO_HW;
kgem->batch_size = ARRAY_SIZE(kgem->batch);
@@ -1864,7 +1869,7 @@ void _kgem_submit(struct kgem *kgem)
DRM_IOCTL_I915_GEM_EXECBUFFER2,
&execbuf);
while (ret == -1 && errno == EBUSY && retry--) {
- drmCommandNone(kgem->fd, DRM_I915_GEM_THROTTLE);
+ __kgem_throttle(kgem);
ret = drmIoctl(kgem->fd,
DRM_IOCTL_I915_GEM_EXECBUFFER2,
&execbuf);
@@ -1954,8 +1959,7 @@ void kgem_throttle(struct kgem *kgem)
{
static int warned;
- kgem->wedged |= drmCommandNone(kgem->fd, DRM_I915_GEM_THROTTLE) == -EIO;
-
+ kgem->wedged |= __kgem_throttle(kgem);
if (kgem->wedged && !warned) {
struct sna *sna = container_of(kgem, struct sna, kgem);
xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,