Bug 11357 - Color tiling with randr-1.2 branch broken on rv280
Summary: Color tiling with randr-1.2 branch broken on rv280
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: xf86-video-ati maintainers
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-23 22:25 UTC by Andrew Randrianasulu
Modified: 2007-07-05 17:42 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
log with ColorTiling enabled (50.29 KB, text/plain)
2007-06-25 13:41 UTC, Andrew Randrianasulu
no flags Details
log with color tiling disabled (91.45 KB, text/plain)
2007-06-25 13:43 UTC, Andrew Randrianasulu
no flags Details

Description Andrew Randrianasulu 2007-06-23 22:25:15 UTC
i open separate bug for ColorTiling breakage in randr-1.2 branch of radeon driver.

hardware:
01:00.0 VGA compatible controller: ATI Technologies Inc RV280 [Radeon 9200 SE] (rev 01) (prog-if 00 [VGA])
        Subsystem: Hightech Information System Ltd. Excalibur 9200SE VIVO 128M
        Flags: bus master, 66Mhz, medium devsel, latency 32, IRQ 20
        Memory at d0000000 (32-bit, prefetchable) [size=128M]
        I/O ports at c800 [size=256]
        Memory at dfdf0000 (32-bit, non-prefetchable) [size=64K]
        Expansion ROM at dfdc0000 [disabled] [size=128K]
        Capabilities: [58] AGP version 2.0
        Capabilities: [50] Power Management version 2

Software:
kernel 2.6.21.5 from kernel org
drm from git 068ffc1e1bf5607f836839a1fc621a95547251e3
Mesa from git 1a413b4d7765bbdc5e922659a4cc8aa17b1feb2d
xf86-video-radeon randr-1.2 branch 3bb46c03fddd3bd79bdab887366aeeced0290a3a

I have very wrong image when start x server without  Option "ColorTiling" "0"
Things are work well if i use this option.

Because i don't know previously about tiling as technique - i do simple search and found two may_be_useful links:

http://www.freepatentsonline.com/5841446.html
 Method and apparatus for address mapping of a video memory using tiling

http://www.freepatentsonline.com/6972768.html
 Method and apparatus for rasterizing in a hierarchical tile order

So, according to these articles - Frame Buffer tiling is important for 2D and 3D performance. And yes, on my low-end consumer card with slow memory

(--) RADEON(0): Mapped VideoRAM: 65536 kByte (64 bit DDR SDRAM)

I can actually see difference in 3d apps (2x-2.5x slowdown in quake3, resolution 1024x768@75hz, 24 bit. Quake3 is my standard 3d app for finding basic regressions in 3d), 2d performance still acceptable, but this may be because fast CPU (celeron-1700).

I have question for r300 owners - do color tiling work for you in radeon randr-1.2 branch? 

May be this is fundamental limitation in current drivers for non-r300 cards? r300 have bigger hardware limits (MaxSurfaceWidth = 3968, info->MaxLines = 4096 vs info->MaxSurfaceWidth = 2048; info->MaxLines = 2048 in radeon_driver.c) - may be this is source for my problems? As far as i known - current radeon randr-1.2 driver over allocated all buffers (include framebuffer) just in case there will be second monitor attached later - but i can't find in source files  how i can override this. (and all randr-1.2 fun will be off if i'll do such thing). 

Thanks!
Comment 1 Roland Scheidegger 2007-06-24 15:40:52 UTC
(In reply to comment #0)
> So, according to these articles - Frame Buffer tiling is important for 2D and
> 3D performance. And yes, on my low-end consumer card with slow memory
> 
> (--) RADEON(0): Mapped VideoRAM: 65536 kByte (64 bit DDR SDRAM)
> 
> I can actually see difference in 3d apps (2x-2.5x slowdown in quake3,
> resolution 1024x768@75hz, 24 bit. Quake3 is my standard 3d app for finding
> basic regressions in 3d), 2d performance still acceptable, but this may be
> because fast CPU (celeron-1700).
I've never seen tiling really make a difference for 2d with radeons, you can measure a difference with some benchmarks but it's nothing you'd care.

> vs info->MaxSurfaceWidth = 2048; info->MaxLines = 2048 in radeon_driver.c) -
> may be this is source for my problems? As far as i known - current radeon
> randr-1.2 driver over allocated all buffers (include framebuffer) just in case
> there will be second monitor attached later - but i can't find in source files 
> how i can override this. (and all randr-1.2 fun will be off if i'll do such
> thing). 
Yes, I'd suspect there is something wrong with the code detecting if tiling can be enabled or not in the randr branch.
The size it sets is with the xf86CrtcSetSizeRange call in radeon_driver.c if you stick to something below 2048 instead of the 2708 maybe tiling works again.
Comment 2 Alex Deucher 2007-06-25 12:53:37 UTC
Should be fixed now:
52cc1dc1491559a9055f3ba6dd54064bb382ad86

Default size is 1600x1200; use a virtual line in your config to make it bigger.
Comment 3 Andrew Randrianasulu 2007-06-25 13:41:48 UTC
Created attachment 10446 [details]
log with ColorTiling enabled
Comment 4 Andrew Randrianasulu 2007-06-25 13:43:41 UTC
Created attachment 10447 [details]
log with color tiling disabled
Comment 5 Andrew Randrianasulu 2007-06-25 13:59:44 UTC
sorry, still not fixed ....
Corrupted display with ColorTiling "1"



And I still need my hack in radeon_driver.c


#if 0                                                                           
    {                                                                           
        xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);          
        int i;                                                                  
        for (i = 0; i <= xf86_config->num_crtc; i++) {                          
                if (i == 0)                                                     
                        xf86_config->crtc[i]->enabled = 1;                      
                else                                                            
                        xf86_config->crtc[i]->enabled = 0;                      
        }                                                                       
    }                                                                           
#endif                                                                          
    RADEONUnblank(pScrn);   

// move RADEONUnblank(pScrn); outside if 0 ... endif

(without this my screen stay blank after VT switch to text console or server shutdown)

not sure about proper fix ....
Comment 6 Alex Deucher 2007-06-25 15:24:23 UTC
should be fixed now as of:
6a3599d6155d073a3116c4b13bdf04b44bb9e087
stride was not properly set.
Comment 7 Andrew Randrianasulu 2007-06-25 17:30:07 UTC
i using 7901bcafa92dccd319ddb5de4627d806a39f15f9 and main bug _still_ there ....

I tried 16 and 24 bit color depth - both broken ...

I have 48 pixels wide square flag (xxkb). If ColorTiling "ON" square broken into 8 chunks at first horizontal half of screen, and 8 another chunks [at one line] but slightly lower at another half of screen. If i use 16-bit depth i have only 8 chunks at horizontal, screen-wide, line.
Comment 8 Andrew Randrianasulu 2007-07-02 22:58:16 UTC
xf86-video-ati, randr-1.2 branch, include 
commit bdcae622100c81a4d9a53938542b64908bacd195

after commented out line 226 in radeon_crtc.c 

save->crtc_offset_cntl = INREG(RADEON_CRTC_OFFSET_CNTL) & ~0xf;

tiling finally working!

Hm, something wrong with my git software?  Or something wrong with my hardware? Looks like i need all sorts of hacks only for making it work. Seriously, i fear all such blind hacking (like i did) may even damage other videocards....
Comment 9 Roland Scheidegger 2007-07-03 04:41:16 UTC
(In reply to comment #8)
> xf86-video-ati, randr-1.2 branch, include 
> commit bdcae622100c81a4d9a53938542b64908bacd195
> 
> after commented out line 226 in radeon_crtc.c 
> 
> save->crtc_offset_cntl = INREG(RADEON_CRTC_OFFSET_CNTL) & ~0xf;
> 
> tiling finally working!
> 
> Hm, something wrong with my git software?  Or something wrong with my hardware?
> Looks like i need all sorts of hacks only for making it work. Seriously, i fear
> all such blind hacking (like i did) may even damage other videocards....
Highly unlikely...
And I think your solution is correct. This was wrong due to the code reshuffling, the inreg is at the wrong place, but the code doesn't seem to rely on any values already set, so it can go. Apart from that, the issue mentioned in the comment (the scrolling in a virtual screen causing headaches) doesn't exist with randr anyway, as that feature isn't supported at all.
I think you're just discovering these bugs because not too many people are using the randr 1.2 branch with pre-r300 radeons right now.
Comment 10 Alex Deucher 2007-07-05 17:42:50 UTC
This should be fixed now.  Thanks for your help!


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.