Bug 17897

Summary: [Patch] Enable dithering on RV530 lcds
Product: xorg Reporter: Bryce Harrington <bryce>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: high CC: pedretti.fabio
Version: 7.4 (2008.09)   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Adds dithering for rv530 lcd's
none
dump lvds misc info
none
Xorg.0.log with added debug line run on a MacBook Pro
none
possible fix
none
possible fix
none
Xorg.0.log with latest pacth
none
possible fix
none
final fix none

Description Bryce Harrington 2008-10-03 19:54:11 UTC
Created attachment 19363 [details] [review]
Adds dithering for rv530 lcd's

Two ubuntu users confirmed that enabling the dithering worked out in bug 17094 worked for the RV530.  Attached is a patch to add support for this.
Comment 1 Bryce Harrington 2008-10-03 19:58:19 UTC
The Ubuntu bug is here:

https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-video-ati/+bug/264535
Comment 2 Alex Deucher 2008-10-06 12:15:09 UTC
This should be fixed properly in commit:
a5c5ce96279d01eb519bfb92b94c06a58acb7f07
Comment 3 Fabio Pedretti 2008-10-08 01:01:14 UTC
I tried current git (commit dc795ba66a8c0eb2c3fdb86bd42dfc17e0aa3b6e) using Ubuntu packages from https://edge.launchpad.net/~tormodvolden/+archive on an Ubuntu 8.04 (with xserver 1.4) but this is not yet fixed on my MacBook Pro. I can provide more informations if needed.
Comment 4 Alex Deucher 2008-10-08 06:39:31 UTC
Created attachment 19490 [details] [review]
dump lvds misc info

(In reply to comment #3)
> I tried current git (commit dc795ba66a8c0eb2c3fdb86bd42dfc17e0aa3b6e) using
> Ubuntu packages from https://edge.launchpad.net/~tormodvolden/+archive on an
> Ubuntu 8.04 (with xserver 1.4) but this is not yet fixed on my MacBook Pro. I
> can provide more informations if needed.
> 

I wouldn't put it past apple to have wrong or missing data for the LCD in their bios.  Can you apply the attached patch and then attach your resulting log to this bug?
Comment 5 Fabio Pedretti 2008-10-08 08:37:30 UTC
Created attachment 19498 [details]
Xorg.0.log with added debug line run on a MacBook Pro

Done. I get this:
LVDS misc: 0x69

Full log attached.
Comment 6 Fabio Pedretti 2008-10-08 08:38:23 UTC
Note that I was one of the two were the Ubuntu patch worked.
Comment 7 Alex Deucher 2008-10-10 07:54:10 UTC
Created attachment 19566 [details] [review]
possible fix

Looks like the grey level was being set wrong.  This patch should fix it.
Comment 8 Fabio Pedretti 2008-10-10 08:04:50 UTC
I am still having the "banding" with this patch.
Comment 9 Alex Deucher 2008-10-10 08:21:39 UTC
Created attachment 19570 [details] [review]
possible fix

Can you try this patch?
Comment 10 Fabio Pedretti 2008-10-10 08:34:21 UTC
Created attachment 19571 [details] [review]
Xorg.0.log with latest pacth

Still same problem. Xorg log attached.

For this testing is sufficient to copy the just compiled:
xf86-video-ati/src/.libs/ati_drv.so
xf86-video-ati/src/.libs/radeon_drv.so

to /usr/lib/xorg/modules/drivers/ and reboot?
Comment 11 Alex Deucher 2008-10-10 10:54:46 UTC
Created attachment 19578 [details] [review]
possible fix

Try this patch.  I think probably just clearing the truncate bit should do it, but if that doesn't work uncomment this line:
//lvtma_bit_depth_control &= ~AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN;
and try again.  As for testing, all you need to do is copy the new files over and stop and start X:
sudo /etc/init.d/gdm stop
sudo /etc/init.d/gdm start
Comment 12 Fabio Pedretti 2008-10-13 04:18:53 UTC
I tried the latest patch:
1) with the unmodified patch the banding is fixed, however there are some areas (where there is the colour transition) where the colour is not uniform (like if there were some random noise overlapped);
2) with the uncommented
//lvtma_bit_depth_control &= ~AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN;
the problem is also greatly fixed (I can see very little visible banding looking closer, but I think this is how the image is really) without the noise overlap. Trying to look the same image on an intel graphic card I get the same behaviour.

I think the second one (with the uncommented line) should be preferred as it is similar to the intel card and also looks subjectively better.

Thanks for all your work on fixing this problem.
Comment 13 Fabio Pedretti 2008-10-14 23:59:40 UTC
After 2 days of testing I would say that the behaviour with the commented
//lvtma_bit_depth_control &= ~AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN;
is buggy and that that line should be uncommented.
Comment 14 Alex Deucher 2008-10-15 07:26:02 UTC
Created attachment 19664 [details] [review]
final fix

Ok, this is what I plan to commit.  Please verify that it works.
Comment 15 Fabio Pedretti 2008-10-15 07:46:34 UTC
I confirm it's working as expected.

Thanks,
Fabio
Comment 16 Alex Deucher 2008-10-15 07:55:26 UTC
thanks!  committed: 435cf7da68186f2601c4b888296117d4f652c625

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.