summaryrefslogtreecommitdiff
path: root/lib/libdrm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-04-25 14:35:50 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-04-25 14:35:50 +0000
commit126d89fc189a07e1f0decb19a36e1eec2efaad41 (patch)
tree467842ecb6041918008d63db78e2df27a837e944 /lib/libdrm
parent56359c44fa5de4b482dc33e01e969560d92980ee (diff)
*sigh* ioctls do not copyout when they return an error. DRM developers
need to learn this. When set_tiling fails, keep tiling type at the type we already had, do NOT use the parameters that we passed to the ioctl. Noticed when i botched a kernel diff (locally) so that that ioctl failed more often. ok matthieu@
Diffstat (limited to 'lib/libdrm')
-rw-r--r--lib/libdrm/intel/intel_bufmgr_gem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libdrm/intel/intel_bufmgr_gem.c b/lib/libdrm/intel/intel_bufmgr_gem.c
index 61dc5aedd..50420d512 100644
--- a/lib/libdrm/intel/intel_bufmgr_gem.c
+++ b/lib/libdrm/intel/intel_bufmgr_gem.c
@@ -1422,8 +1422,10 @@ drm_intel_gem_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
DRM_IOCTL_I915_GEM_SET_TILING,
&set_tiling);
} while (ret == -1 && errno == EINTR);
- bo_gem->tiling_mode = set_tiling.tiling_mode;
- bo_gem->swizzle_mode = set_tiling.swizzle_mode;
+ if (ret == 0) {
+ bo_gem->tiling_mode = set_tiling.tiling_mode;
+ bo_gem->swizzle_mode = set_tiling.swizzle_mode;
+ }
drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem);