Created attachment 118091 [details]
Witcher2 on Nouveau
Witcher 2 looks blurry on nouveau and spams dmesg with a lot of:
[ 390.489069] nouveau E[ PGRAPH][0000:01:00.0] DATA_ERROR [INVALID_BITFIELD] ch 5 [0x007f853000 witcher2] subc 0 class 0xa097 mthd 0x2380 data 0x00024000
[ 390.489156] nouveau E[ PGRAPH][0000:01:00.0] DATA_ERROR [INVALID_BITFIELD] ch 5 [0x007f853000 witcher2] subc 0 class 0xa097 mthd 0x238c data 0x00010500
Screenshots comparing intel and nouveau attached.
Apitrace: http://people.freedesktop.org/~mslusarz/witcher2.trace.xz (130MB)
Created attachment 118092 [details]
Witcher2 on Intel
Hmmm... that's the CB_SIZE which is 64K max, aka 0x10000. Somehow it's trying to write to 0x24000 which is well past that. Should probably throw some asserts in to see where it's happening.
IIRC I fixed some issues with CB writes at some point, can you confirm that this happens on a semi-recent mesa? Preferably Mesa 11-rcN or git?
This happens on mesa git (3c6c4d4f298ec81fe57992790a68aaab2e573519).
Created attachment 118094 [details] [review]
cb management patch
This is a very preliminary patch, but in replaying the above trace, I get the same results as on intel (at least on the last frame). And at least with mesa 10.6.3, I do see the same blurriness as you did. (Fun, looks like it makes use of GL_DEPTH_BOUNDS_TEST_EXT, which wasn't available in 10.6.3.)
Please confirm that the included patch fixes the blurriness. It's a pile-o-hacks right now, but could definitely be cleaned up. I've been aware of this issue for a while, but didn't have a reason to fix until now.
This patch resolves both blurriness and DATA_ERRORs.
Pushed out this commit:
Author: Ilia Mirkin <firstname.lastname@example.org>
Date: Wed Sep 9 03:17:38 2015 -0400
nvc0: keep track of cb bindings per buffer, use for upload settings
on Mar 30, 2017 at 22:36:01.
(provided by the Example extension).