Bug 61197 - [SNB Bisected] kwin_gles screen corruption
Summary: [SNB Bisected] kwin_gles screen corruption
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 9.1
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
: 61600 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-20 22:39 UTC by wojtek
Modified: 2013-03-25 21:08 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
kwin_gles corruption screenshot (222.32 KB, image/png)
2013-02-20 22:39 UTC, wojtek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wojtek 2013-02-20 22:39:24 UTC
Created attachment 75213 [details]
kwin_gles corruption screenshot

Using kwin_gles causes screen corruption. 
Corruption occurs with mesa-9.1_rc2 (with 9.1_rc1 too).
Everything is OK with mesa 9.0.2


system details:

intel(R) Core(TM) i5-2520M CPU @ 2.50GHz 
kernel-3.8 
xf86-video-intel-2.21.3 (SNA)
libdrm-2.4.42
kwin-4.10.0

Bug report in kde bugzilla:
https://bugs.kde.org/show_bug.cgi?id=315513
Comment 1 wojtek 2013-02-23 09:53:25 UTC
bug still exists in mesa-9.1 final
Comment 2 Andrea Scarpino 2013-03-12 13:52:23 UTC
*** Bug 61600 has been marked as a duplicate of this bug. ***
Comment 3 Erich Seifert 2013-03-12 14:16:48 UTC
I'm experiencing the same problems after upgrading my Gentoo system from 9.0.1 to mesa 9.1.

system details:

Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz
Mobile 4 Series Chipset Integrated Graphics Controller / GMA 4500MHD ("i915" kernel driver)
Kernel 3.8.2
xf86-video-intel 2.21.3
libdrm 2.4.42
kwin 4.10.1
Comment 4 wojtek 2013-03-13 16:15:04 UTC
git bisect bad
60894edeef973e86a73067276f658b72f84271b6 is the first bad commit
commit 60894edeef973e86a73067276f658b72f84271b6
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Jan 10 15:11:28 2013 -0800

    intel: Make intel_region's pitch be bytes instead of pixels.

    We almost never want a stride in pixels -- if you're doing anything with
    a stride, you're specifying an offset or incrementing a pointer, and in
    both cases you had to multiply by cpp to get the bytes value you wanted.
    But worse, on the way to creating a region from a new tiled BO, we
    divided by cpp to get pitch in pixels, and for an RGB32 buffer (an
    upcoming change) the pitch wouldn't divide exactly, and we'd end up with
    a wrong stride in our region.

    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

:040000 040000 20cab1a9079778d75f58a105ae054602117380fd d3c03362f04930e826564ea656b5d511652e6249 M      src
Comment 5 Eric Anholt 2013-03-14 08:05:16 UTC
Does it work on Mesa master?  I bet it needs:

commit e062a4187d8ea518a39c913ae7562cf1d8ac3205
Author: Tapani Pälli <tapani.palli@intel.com>
Date:   Mon Jan 28 08:53:56 2013 +0200

    intel: Fix regression in intel_create_image_from_name stride handling
Comment 6 Stefano Avallone 2013-03-14 11:04:13 UTC
I also experienced the same screen corruption on my Ivybridge desktop under mesa 9.1.

Today, I compiled mesa from Anholt's fs-varying-uniform branch (to test a proposed solution for an Ivybridge-specific issue, see bug #61554), which includes the commit suggested by Eric.

kwin_gles now works fine, the corruption is gone.

Shouldn't the mentioned commit be a candidate for mesa 9.1 branch?
Comment 7 wojtek 2013-03-14 11:06:42 UTC
it works on SandyBridge too
Comment 8 wojtek 2013-03-14 11:10:05 UTC
(In reply to comment #5)
> Does it work on Mesa master?  I bet it needs:
> 
> commit e062a4187d8ea518a39c913ae7562cf1d8ac3205
> Author: Tapani Pälli <tapani.palli@intel.com>
> Date:   Mon Jan 28 08:53:56 2013 +0200
> 
>     intel: Fix regression in intel_create_image_from_name stride handling

Yes. It works on SNB
Comment 9 Erich Seifert 2013-03-14 11:26:48 UTC
I added the patch of commit e062a4187d8ea518a39c913ae7562cf1d8ac3205 to regular mesa 9.1 and it's working now.
Comment 10 wojtek 2013-03-25 13:20:18 UTC
> Does it work on Mesa master?  I bet it needs:
> 
> commit e062a4187d8ea518a39c913ae7562cf1d8ac3205
> Author: Tapani Pälli <tapani.palli@intel.com>
> Date:   Mon Jan 28 08:53:56 2013 +0200
> 
>     intel: Fix regression in intel_create_image_from_name stride handling

Is there any chance to backport commit to mesa-9.1 branch?
Comment 11 Ian Romanick 2013-03-25 21:08:21 UTC
Picked as:

commit a31c9c3fa9e969c52754269240131ea66b7db50e
Author: Tapani Pälli <tapani.palli@intel.com>
Date:   Mon Jan 28 08:53:56 2013 +0200

    intel: Fix regression in intel_create_image_from_name stride handling
    
    Strangely, the DRIimage interface we have passes the pitch in pixels
    instead of bytes, which anholt missed in the change to using bytes for
    region pitch.
    
    Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61197
    (cherry picked from commit e062a4187d8ea518a39c913ae7562cf1d8ac3205)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.