Bug 47765

Summary: Corrupt rendering to a window between 57 and 63 pixels high
Product: Mesa Reporter: Tvrtko Ursulin <tvrtko.ursulin>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Screenshot showing corrupted mesa-demos/tri rendering
use linear aligned
Fix pixmap.height < 64 case
Fix pixmap.height < 64 case

Description Tvrtko Ursulin 2012-03-23 05:50:12 UTC
We are seeing render corruption when rendering a texture to a window between 57 and 63 pixels high. glViewport being set to window dimensions.

Texture vertices do not seem to matter. If I render to the full viewport, or to a subset of a viewport, always the whole viewport gets corrupt (so including the area outside texture vertices).

Texture size does not seem to matter.

Rendering is done with glDrawArray GL_TRIANGLE_FAN and the destination window is RGBA.

Environment:

00:01.0 VGA compatible controller: ATI Technologies Inc AMD Radeon HD 6310 GraphicsATI

Kernel 3.3.0 + 0001-drm-radeon-add-support-for-evergreen-ni-tiling-infor.patch

It does not happen without this patch - so it is probably tiling related.

xorg-drivers-ati, mesa and libdrm from yesterday's git. Last one is in fact a bit older, but I applied a single interesting patch (9b3ad51ae5fd9654df8ef75de845a519015150bb) by hand to make it up to date.
Comment 1 Jerome Glisse 2012-03-23 07:49:55 UTC
Does any of the mesa demo reproduce the bug ?
Comment 2 Tvrtko Ursulin 2012-03-23 08:22:20 UTC
(In reply to comment #1)
> Does any of the mesa demo reproduce the bug ?

/usr/lib64/mesa/tri shows it if you resize the window right.
Comment 3 Tvrtko Ursulin 2012-03-23 08:28:01 UTC
Created attachment 58939 [details]
Screenshot showing corrupted mesa-demos/tri rendering
Comment 4 Jerome Glisse 2012-03-27 09:30:15 UTC
Please attach patch corresponding to 9b3ad51ae5fd9654df8ef75de845a519015150bb
Comment 5 Jerome Glisse 2012-03-27 11:49:06 UTC
Created attachment 59126 [details] [review]
use linear aligned

Does this patch against ddx help ?
Comment 6 Tvrtko Ursulin 2012-03-28 01:17:21 UTC
(In reply to comment #5)
> Created attachment 59126 [details] [review] [review]
> use linear aligned
> 
> Does this patch against ddx help ?

No, still the same corruption.
Comment 8 Tvrtko Ursulin 2012-04-04 06:57:36 UTC
(In reply to comment #7)
> Does this patch help?
> http://people.freedesktop.org/~agd5f/0001-drm-radeon-kms-Fixup-backendmap-on-6xx-9xx.patch

Unfortunately not, still the same behaviour.
Comment 9 Jerome Glisse 2012-04-04 14:13:45 UTC
Created attachment 59494 [details] [review]
Fix pixmap.height < 64 case

This should fix your issue (patch against ddx xf86-video-ati)
Comment 10 Andy Furniss 2012-04-04 15:14:53 UTC
(In reply to comment #9)
> Created attachment 59494 [details] [review] [review]
> Fix pixmap.height < 64 case
> 
> This should fix your issue (patch against ddx xf86-video-ati)

Doesn't help on my rv790 - I am testing just this patch not the kernel one.

FWIW I only see this when swapbufferswait is off, looks like most/any mesa demo will show it.
Comment 11 Jerome Glisse 2012-04-04 15:43:39 UTC
Created attachment 59495 [details] [review]
Fix pixmap.height < 64 case

Sorry attached wrong patch, ignore previous patch
Comment 12 Andy Furniss 2012-04-04 16:08:37 UTC
(In reply to comment #11)
> Created attachment 59495 [details] [review] [review]
> Fix pixmap.height < 64 case
> 
> Sorry attached wrong patch, ignore previous patch

This one works for me.
Comment 13 Tvrtko Ursulin 2012-04-05 01:03:46 UTC
(In reply to comment #11)
> Created attachment 59495 [details] [review] [review]
> Fix pixmap.height < 64 case
> 
> Sorry attached wrong patch, ignore previous patch

Works lovely, thank you!

Interestingly we were on a similar track here trying to force something similar but in libdrm. But I am not surprised since I cannot say I picked up what component does what (kernel, libdrm, mesa, ddx) in the few weeks I've been in this code.
Comment 14 Jerome Glisse 2012-04-05 13:37:55 UTC
Closing pushed

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.