Bug 89720

Summary: DRI PRIME offloading corrupts image in fullscreen with DRI3
Product: xorg Reporter: Adam Honse <calcprogrammer1>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Don't attempt to flip to a pixmap from a different screen
none
Xorg.0.log with change applied
none
Don't flip between BOs with different tiling parameters none

Description Adam Honse 2015-03-22 22:07:31 UTC
I have been running Oibaf's driver PPA and Sarnex's DRI3 testing PPA for the past few months, mainly to be able to play Windows games on Wine with Gallium-Nine support.

My system is an AMD A8-3870K APU (6550D integrated GPU) with a discrete Radeon HD 5870 2GB card as well.  The display (a 1080p TV) is connected via VGA to the integrated port on the motherboard.  I use the 5870 for gaming with DRI_PRIME=1.

I had been using EXA acceleration, kernels 3.19 and 4.0, and MATE desktop with no compositing just fine.  Offloading worked correctly for OpenGL and D3D9 alike.

With the recent changes to DRI3, I now am having graphical corruption when using PRIME to offload a fullscreen window.  It only affects fullscreen programs, windowed programs offload just fine.  I have tried both glamor and exa acceleration methods but the issue persists on both.  Corruption takes the form of blocky tiles which appear out of order and constant flickering.  If I use the integrated GPU both windowed and fullscreen programs work just fine.

I will upload a short video of the issue to demonstrate it.
Comment 1 Michel Dänzer 2015-03-25 07:34:54 UTC
Created attachment 114611 [details] [review]
Don't attempt to flip to a pixmap from a different screen

Does this patch fix the problem?

If not, please attach the full /var/log/Xorg.0.log file.
Comment 2 Adam Honse 2015-03-29 16:57:54 UTC
What package is this patch for?
Comment 3 Michel Dänzer 2015-03-30 01:13:07 UTC
(In reply to Adam Honse from comment #2)
> What package is this patch for?

xf86-video-ati, the one this bug report is assigned to.
Comment 4 Adam Honse 2015-03-30 22:12:50 UTC
It does not appear to fix the problem.

I will attach Xorg.0.log.
Comment 5 Adam Honse 2015-03-30 22:13:24 UTC
Created attachment 114738 [details]
Xorg.0.log with change applied
Comment 6 Adam Honse 2015-03-30 22:44:29 UTC
If I force that function to always return FALSE then the corruption goes away.
Comment 7 Michel Dänzer 2015-03-31 04:13:48 UTC
Created attachment 114742 [details] [review]
Don't flip between BOs with different tiling parameters

Does this patch help?
Comment 8 Adam Honse 2015-04-02 01:22:28 UTC
That patch did the trick, it's working great now!  I tested the same open source games I had the issue on before - OpenArena, SuperTuxKart, and Minetest as well as Skyrim running with Gallium Nine.  All of them seem to be working fine with PRIME now.
Comment 9 Michel Dänzer 2015-04-03 02:05:57 UTC
commit 5921ba4ca705a0d919515626088f3948cc4848c1
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Tue Mar 31 15:14:52 2015 +0900

    present: Don't flip between BOs with different tiling parameters
    
    The kernel driver doesn't handle that correctly yet.
    
    Fixes or at least avoids issues with OpenGL fullscreen apps with DRI3
    enabled and using PRIME or with (2D) tiling disabled.

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.