summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a3305b0)
raw | patch | inline | side by side (parent: a3305b0)
author | Chris Wilson <chris@chris-wilson.co.uk> | |
Mon, 24 May 2010 17:35:41 +0000 (18:35 +0100) | ||
committer | Chris Wilson <chris@chris-wilson.co.uk> | |
Mon, 24 May 2010 17:38:29 +0000 (18:38 +0100) |
Fixes:
Bug 26686 - Some textures are distorted with libdrm 2.4.18 in GTAVC>A3
http://bugs.freedesktop.org/show_bug.cgi?id=26686
This bug continues to haunt me. The kernel SET_TILING ioctl is
inconsistent in its return values when reporting an error. If one of its
sanity checks fail, then the input values are left unchanged. If the
kernel later fails to change the tiling mode, then the input values are
modified to match the current tiling on the object. In short, userspace
cannot trust the return values upon error and so we must assume that
upon error our current tiling mode matches reality and not update.
Bug 26686 - Some textures are distorted with libdrm 2.4.18 in GTAVC>A3
http://bugs.freedesktop.org/show_bug.cgi?id=26686
This bug continues to haunt me. The kernel SET_TILING ioctl is
inconsistent in its return values when reporting an error. If one of its
sanity checks fail, then the input values are left unchanged. If the
kernel later fails to change the tiling mode, then the input values are
modified to match the current tiling on the object. In short, userspace
cannot trust the return values upon error and so we must assume that
upon error our current tiling mode matches reality and not update.
intel/intel_bufmgr_gem.c | patch | blob | history |
index 54c82d6240d75d657d5bfe2a47aacad3609f8286..b76fd7ed79bcbe3fc6e3bb46d12d281b44e4aa73 100644 (file)
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
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;
-
- drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem);
+ 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);
+ } else
+ ret = -errno;
*tiling_mode = bo_gem->tiling_mode;
- return ret == 0 ? 0 : -errno;
+ return ret;
}
static int