Bug 68402 - Some elements are only rendered in top-left area
Summary: Some elements are only rendered in top-left area
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/nouveau (show other bugs)
Version: git
Hardware: All Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-21 20:49 UTC by Ján Mlynek
Modified: 2013-09-02 15:42 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
dmesg log (52.75 KB, text/plain)
2013-08-21 20:49 UTC, Ján Mlynek
Details
screenshot (1.32 MB, image/png)
2013-08-21 20:51 UTC, Ján Mlynek
Details

Description Ján Mlynek 2013-08-21 20:49:17 UTC
Created attachment 84412 [details]
dmesg log

Ubuntu 13.04 64-bit (affects both x86 and x86_64)
Kernel - from nouveau/linux-2.6 repo - HEAD is 3b56bba6abaa70d629fccdcf8490e087ea3a1ab4
X.Org X Server 1.13.4
Mesa version e6013e4bee7ebff6b7bd2f3b95eb16e8949e228c
Family: NVC0
Chipset: GF116 (NVCF) (GTX 550 Ti)

Some elements are only rendered in top-left area of the window (screenshot to be included). This affects both Portal and Team Fortress 2.

I've done a bisection and this is the result:

2149ce41ed6b10f7bff65d7b3f23fd03b89753e3 is the first bad commit
commit 2149ce41ed6b10f7bff65d7b3f23fd03b89753e3
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Sun Sep 30 22:59:34 2012 +0200

    nv50,nvc0: fix 3d engine blit for nvc0

:040000 040000 e0f165f869fed658f574a2719d0e841dda95139e 013265106fe6e2f2dab6b20811566fa5ba1106f3 M	src

There is nothing related to this issue in dmesg, but I'll include it anyway.
Comment 1 Ján Mlynek 2013-08-21 20:51:40 UTC
Created attachment 84413 [details]
screenshot
Comment 2 Emil Velikov 2013-08-21 21:25:18 UTC
Thanks for the bisect Ján

Bit short on hardware atm, so can you confirm hunk of the commit causes the issue? I'm suspecting the last one, although there is a small chance that it's the second to last.

Cheers
Emil
Comment 3 Ján Mlynek 2013-08-21 23:42:53 UTC
It's the last hunk that causes the issue:

BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
PUSH_DATA (push, nvc0->framebuffer.width << 16);
PUSH_DATA (push, nvc0->framebuffer.height << 16);

Removing it solved the issue, so I tried to do the same thing in current(master) code.
After removing 2 of these hunks (there is another one in commit 443b247878edd6a67adc073b0c36e2941436b9a0), the bug is not present.

I have no idea what I've broken in the process, though. :-)

-Ján
Comment 4 Emil Velikov 2013-08-23 00:16:42 UTC
You're a star Ján

Just had a word with our main dev and he suggested that
viewport transformation is optional, whereas viewport clip rectangle must be set before and after 3d_blit().

With that said, here is what can be done to double-check/fix this - note a quick piglit [1] test before and after each one, plus testing of other games/gl apps is essential.

* nuke the viewport clip rectangle (despite all odds)
* change the viewport clip rectangle - traceback and use the original values (the ones saved at the begingin on 3d_blit() and restored at the end)
* nuke the viewport transformation
* add the conditional NV50_TIC_5_LAST_LEVEL__MASK on tic[5] in nvc0_create_texture_view (compare vs nv50_create_texture_view)

I'm hoping that one of the last two will do the job, although chances are that it may be one of the first two. Either way a piglit and further testing will prove which solution is the most appropriate.

Feel free to give it a shot yourself, as it will take a some time until I get to it(apart from the lack of HW).

Note: depending on your luck(and other unknown to me factors) piglit may lockup X and your system. Normally a s2r cycle is sufficient to get it back into shape, otherwise a reboot is needed.

Cheers,
Emil

[1] http://cgit.freedesktop.org/piglit/
Comment 5 Emil Velikov 2013-09-02 15:42:20 UTC
The issue should be resolved by commit ad4dc7723(nvc0: restore viewport after blit), which will make it's way into the next 9.1 and 9.2 mesa release.

Feel free to reopen if above commit does not resolve the issue.


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.