# Fast VESA framebuffer

## fremda

I want the fastest possible framebuffer with fglrx on Radeon HD2600 AGP. AFAIK, for VESAfb the best mode is write-combining and "vesafb: scrolling" must be anything but redraw. How do i make it work?

Kernel config:

```
CONFIG_MTRR=y

CONFIG_MTRR_SANITIZER=y

CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1

CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
```

Command line options:

```
vga=0x31A video=vesafb:ywrap,mtrr:3
```

dmesg:

```
[    0.000000] MTRR default type: uncachable

[    0.000000] MTRR fixed ranges enabled:

[    0.000000]   00000-9FFFF write-back

[    0.000000]   A0000-BFFFF uncachable

[    0.000000]   C0000-CEFFF write-protect

[    0.000000]   CF000-FFFFF uncachable

[    0.000000] MTRR variable ranges enabled:

[    0.000000]   0 base 000000000 mask FC0000000 write-back

[    0.000000]   1 disabled

[    0.000000]   2 disabled

[    0.000000]   3 disabled

[    0.000000]   4 disabled

[    0.000000]   5 disabled

[    0.000000]   6 disabled

[    0.000000]   7 disabled

[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106

[    0.000000] initial memory mapped : 0 - 01800000

[    0.000000] Base memory trampoline at [c009e000] 9e000 size 4096

...

[    0.700372] vesafb: mode is 1280x1024x16, linelength=2560, pages=0

[    0.700380] vesafb: scrolling: redraw

[    0.700386] vesafb: Truecolor: size=0:5:6:5, shift=0:11:5:0

[    0.700960] vesafb: framebuffer at 0xd0000000, mapped to 0xf8080000, using 2560k, total 2560k
```

fglrx unloaded:

```
cat /proc/mtrr

reg00: base=0x000000000 (    0MB), size= 1024MB, count=1: write-back

reg01: base=0x0d0000000 ( 3328MB), size=    4MB, count=1: write-combining
```

fglrx loaded:

```
cat /proc/mtrr

reg00: base=0x000000000 (    0MB), size= 1024MB, count=1: write-back
```

----------

## NeddySeagoon

fremda,

Why do you want a fast framebuffer with fglrx loaded?  

If fact, why do you want a framebuffer at all?

Use a terminal in Xorg fglrx will accelerate that.

You can't have a write combining MTTR for your framebuffer.

```
[    0.000000] MTRR fixed ranges enabled: 

[    0.000000]   00000-9FFFF write-back      thats the RAM below 1Mb 

[    0.000000]   A0000-BFFFF uncachable      thats your video card BIOS ROM and Pixel buffer, as exposed in real mode

[    0.000000]   C0000-CEFFF write-protect    For option card ROMs. Either in the PCI slots or provided as part of the BIOS

[    0.000000]   CF000-FFFFF uncachable
```

 The main BIOS code.

The problem is that several devices can write to the pixel buffer and the CPU does not know about them all - hence uncachable.

e.g. the CPU can write to the pixel buffer and the GPU can write to the pixel buffer, without the CPU knowing.

Your choice for framebuffers is very limited.

You can have vesa or uvesa if you want to use fglrx.

If you give up fglrx, you can have the KMS framebuffer for free, if you use the radeon driver. 

Framebuffers are not designed to be fast.  If you want fast, stick to the text console

----------

## fremda

 *NeddySeagoon wrote:*   

> Why do you want a fast framebuffer with fglrx loaded?

 

Can't say i need fast framebuffer. But i'd like to have it. Just in case fglrx breaks down.  :Smile: 

 *NeddySeagoon wrote:*   

> You can't have a write combining MTTR for your framebuffer.

 

Than, how does it work for some people? Is it faulty hardware on my side? How about asking GPU to stop writing to the pixel buffer when in vesa mode? 

 *NeddySeagoon wrote:*   

> You can have vesa or uvesa if you want to use fglrx.

 

vesafb is better than uvesafb, isn't it?

 *NeddySeagoon wrote:*   

> If you give up fglrx, you can have the KMS framebuffer for free, if you use the radeon driver. 

 

Last time i tried KMS framebuffer was much slower than vesafb.

 *NeddySeagoon wrote:*   

> Framebuffers are not designed to be fast. If you want fast, stick to the text console

 

fbterm with fast scrolling mode claims to be as fast as text console.

----------

## NeddySeagoon

fremda,

The  ebuild for fbterm says,

```
   elog "${PN} won't work with vga16fb. You have to use other native"

   elog "framebuffer drivers or vesa driver
```

."

If you want to use fglrx, you cannot use anything other than the vesa (or uvesafb) drivers. This will limit the acceleration you can get, since you can't use the framebuffer driver for your video card.  If y[u try that, fglrx won't load.

Acceleration comes from the GPU doing the drawing, not the CPU.  Yes, you can just use your video card as a pixel buffer.  Thats what the VGA driver does. The CPU plots every pixel and its very slow. 

I use vesa as its easier to set up, I have never run vesa/uvesa trials.

I rarely use the local console, so speed is not important to me.

----------

