Skip to contentSkip to conversation

Some textures are distorted with libdrm 2.4.18 in GTAVC&GTA3

Bug 26686 [email protected] 1 participant 7 messages Feb 22, 2010 – May 24, 2010 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

http://bugs.freedesktop.org/show_bug.cgi?id=26686

Ian Romanick <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         AssignedTo|dri-                        |[email protected]
                   |[email protected] |
Signature · 11 lines
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#2 lore raw
In reply to a message not in the archive

http://bugs.freedesktop.org/show_bug.cgi?id=26686

Chris Wilson <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         AssignedTo|[email protected]    |dri-
                   |                            |[email protected]

--- Comment #4 from Chris Wilson <[email protected]> 2010-02-22 02:09:34 PST --- Extremely unlikely to be a direct result of that commit.

Signature · 11 lines
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#3 lore raw
In reply to a message not in the archive

http://bugs.freedesktop.org/show_bug.cgi?id=26686

--- Comment #5 from Ruslan <[email protected]> 2010-02-22 07:17:22 PST --- I tried to comment out this line:

bo_gem->tiling_mode = set_tiling.tiling_mode;

and now things seem to work. I.e., this statement:

Quoted 2 lines

it overwrites the input arguments following an error in order to report the current tiling state of the buffer.

should be false (or, at least, not quite true). This is proved by the fact that if i undo this part of commit:

- if (ret != 0) {
- *tiling_mode = bo_gem->tiling_mode;
- return -errno;
- }

, i.e. leave 'if' statement in place (and uncomment saving of current tiling_mode), then things also work, because tiling_mode is not saved on error now. So, i can conclude that sometimes the kernel doesn't report current tiling state correctly on error.

Signature · 11 lines
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#4 lore raw
In reply to a message not in the archive

http://bugs.freedesktop.org/show_bug.cgi?id=26686

--- Comment #6 from Ruslan <[email protected]> 2010-02-22 08:10:42 PST --- I added perror() before 'return -errno;' to see what error doesn't report tiling mode, and got "Invalid argument", i.e. EINVAL. Then i found this in i915_gem_set_tiling() in the kernel:

if (!i915_tiling_ok(dev, args->stride, obj->size, args->tiling_mode)) {
        mutex_lock(&dev->struct_mutex);
        drm_gem_object_unreference(obj);
        mutex_unlock(&dev->struct_mutex);
        return -EINVAL;
}

As you can see, it doesn't change tiling_mode.

So, there should be a check for error after ioctl(), and tiling_mode shouldn't be considered current.

Signature · 11 lines
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#6 lore raw
In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=26686

Chris Wilson <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Chris Wilson <[email protected]> 2010-05-24 10:42:56 PDT --- commit fcf3e616eeeb289f96af1436d809f0a1a42bebb7

Author: Chris Wilson <[email protected]>
Date:   Mon May 24 18:35:41 2010 +0100

intel: Don't change tiling mode unless the kernel reports success.

Fixes:

Bug 26686 - Some textures are distorted with libdrm 2.4.18 in GTAVC&GTA3
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.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#7 lore raw
In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=26686

--- Comment #9 from Chris Wilson <[email protected]> 2010-05-24 10:44:27 PDT --- Ruslan, it would be invaluable if you could add an assert(ret == 0); and track down the source of the EINVAL.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.