Bug 91499

Summary: [i915 sna] small Pixmaps rendered incorrectly
Product: xorg Reporter: Omar Sandoval <freedesktop>
Component: Driver/intelAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Reproducer program
none
Appearance of the reproducer in UXA mode
none
Appearance of the reproducer in SNA mode
none
Another UXA example
none
Another SNA example
none
Another UXA example none

Description Omar Sandoval 2015-07-29 03:52:09 UTC
Created attachment 117434 [details]
Reproducer program

Hi,

I'm running into a weird rendering issue on my Lenovo ThinkPad X1 Carbon 3rd gen. Small (8x8) Pixmaps created with XCreateBitmapFromData() or XReadBitmapFile() are corrupted in SNA mode, but not in UXA mode and not on my older X1 Carbon 1st gen.

uname -m: x86_64
xf86-video-intel version: checked with 2.99.917 and latest git master (4f0a58c9db)
xserver version: 1.17.2
kernel version: 4.1.2-2-ARCH
Linux distro: Arch
Machine: Lenovo ThinkPad X1 Carbon 3rd gen

I'm attaching a few screenshots and a simple reproducer.
Comment 1 Omar Sandoval 2015-07-29 03:52:56 UTC
Created attachment 117435 [details]
Appearance of the reproducer in UXA mode
Comment 2 Omar Sandoval 2015-07-29 03:53:33 UTC
Created attachment 117436 [details]
Appearance of the reproducer in SNA mode
Comment 3 Omar Sandoval 2015-07-29 03:54:30 UTC
Created attachment 117437 [details]
Another UXA example

Here's a screenshot of the original application I ran into this with as it should look.
Comment 4 Omar Sandoval 2015-07-29 03:55:12 UTC
Created attachment 117438 [details]
Another SNA example

Here's the corresponding application in SNA.
Comment 5 Omar Sandoval 2015-07-29 03:55:57 UTC
Created attachment 117439 [details]
Another UXA example

Oops, that's a PNG, not plaintext.
Comment 6 Chris Wilson 2015-07-29 08:46:53 UTC
Thanks for the bug report and test case!

commit 4246c63347290390a2104739c719f5ff6a05a0e2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 29 09:42:26 2015 +0100

    sna: Fix off by one in constructing XCopyPlane on bdw
    
    Broadwell expanded all the relocations and we needed to adjust our
    command construction to match. I missed offsetting the XY_SRC_COPY_IMM
    used for XCopyPlane resulting in garbage for small copies on Broadwell.
    
    Reported-by: Omar Sandoval
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91499
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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.