Re: 640x512x16bpp with VESA ?



Hi !

Dirk Wolfgang Glomp wrote:
Am Thu, 15 May 2008 02:45:37 +0200 schrieb whygee:

Public information from vesa.org:
vbe3.pdf

I have found it recently but have not had enough time
to digest everything :-/

EEDIDguideV1.pdf
e-edid_implementation_guide_vesa.pdf
EEDIDverifGuideRa.pdf
Vbeddc11.pdf
I gotta find them too, it seems.

GTF_V1R1.xls
CVTd6r1.xls

hmmm XLS is a pain under Linux...
particularly with OpenOffice on my memory-limited system :-)

VBE-AF07.pdf
-----------------------------------------------------------
INT 10 - VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION
INT 10 - VESA SuperVGA BIOS - GET SuperVGA MODE INFORMATION
I know them already, they're just like in VBE2

Bitfields for VESA SuperVGA mode attributes:
[vbe3.pdf]
D8 = Double scan mode is available
0 = No
1 = Yes
D9 = Interlaced mode is available
0 = No
1 = Yes

oh ! i didn't see them before !!Thanks :-))

;-------------------------------------------------------
INT 10 - VESA SuperVGA BIOS - SET SuperVGA VIDEO MODE

Videomode + 800h = use refresh rate control(only VBE3)

hmmmm sounds interesting, but i don't know what it is.

Setting double scan modes
If double scanning is supported by the hardware, it is possible to
support modes like 320x200, 320x240 and 400x300 that scan each line
twice in the vertical direction. These modes cannot be implemented
without double scanning support, and if the application is attempting
to perform refresh rate control on these modes, setting the double
scan bit is required. When setting a double scan mode, the actual CRTC
parameters calculated and passed in will be equal to double the number
of vertical lines. Hence for a 200 line mode you would actually set
the vertical CRTC parameters and pixel clock for a 400 line mode,
and set the double scan bit to convert the mode to a 200 line
addressable mode. Note that if you are using double scanned modes,
you cannot enable interlaced operation.

CRT DW HorizontalTotal
DW HorizontalSyncStart
DW HorizontalSyncEnd
DW VerticalTotal
DW VerticalSyncStart
DW VerticalSyncEnd
DB Flags
DD Pixelclock
DW RefreshRate
DB 40 dup (0)

oh...

;-------- normalized pixel clock -----------------
mov di, OFFSET CRT
mov ecx, DWORD PTR[di+0Dh] ; Pixelclock
mov ax, 4F0Bh ; get/set Pixel-Clock
xor bl, bl ; 0=get
mov dx, bp ; Video-Mode
int 10h
cmp ax, 4Fh
jnz ERROR
mov DWORD PTR[di+0Dh], ecx ; pixelclock
;-----------refreshRate-------------------
xor eax, eax ; calculate RefreshRate
mov ax, [di] ; HorizontalTotal
xor ebx, ebx
mov bx, [di+6] ; VertikalTotal
mul ebx
mov ebx, eax
mov eax, ecx ; Pixelclock
mov esi, 10
xor edx, edx
div esi
xor edx, edx
div ebx
mov [di+11h], ax ; RefreshRate=Pixelclock/(HTotal*Vtotal)

Should I dump the registers after X.org
has set this mode ?

I have many problems to read the sources.

I have found the following on Google while searching the "640x512" string :

(**) TDFX(0): *Default mode "640x512": 54.0 MHz, 64.0 kHz, 60.0 Hz (D)
(II) TDFX(0): Modeline "640x512" 54.00 640 664 720 844 512 512 514 533 doublescan +hsync +vsync

I infer a pixclock of 54MHz, horizontal refresh of 64KHz, and 60Hz of vertical refresh.
The rest is an encoded modline, i remember that i have found some Linux framebuffer doc
detailing the computations and how to interpret the X.org modlines (or VGAlib ?)

But i didn't know that it was possible to ask VBE3 for a custom resolution \o/

***

I´m interresting to set a separate vesamode for the secondary device,
so that i can acess a secondary linear adressfield for the secondary
display. Now the secondary displays shows the same contents of the primary
device, also when i switch to another videomode. Testet with a GF6800GT.

I have some Matrox DualHead-capable cards (G450) but have not been
successful with them in the past.

A test to get the EDID of the secondary display(Vbeddc11.pdf) fails.
Input: AX=4F15 BL=0 CX=1 Return: AX=004F BX=0000
(A test with the same "Syncmaster 950p" on the primary adapter
results successfully and i can get the EDID).

hmmm DDC is interesting but I have mostly used laptops recently
so it was not necessary.

I don´t found the way in "VBE-AF07.pdf" to handle a secondary device.
It is neccessary to switch the interface using AH=12h/BL=35h and maybe
store the current VIDEO STATE(AH=4F04h) before?

no idea _o_

My requirement is to conserve the 1:1.25 ratio of the screen
with practically fine values. If you know of other resolutions
that fit, fine, as long as I can set it with a simple asm program.

Sorry, i never compute a modi with double scan and i alsway use the given
modi. Where is the problem to use a lower mode?

I'd like to have roughly 640-pixel lines and a 5:4 ratio that
fits the screen. 1280x1024 is too much to compute and store
for my platform. 640x512 is ok.

;--------------------------------------
; 640x480 85 Hz
;--------------------------------------
CRTC DW 832
HORISTA DW 700
HORIEND DW 64
VERTOTA DW 509
VERTSTA DW 480
VERTEND DW 25
DOIFLAG DB 0Ch
PIXCLOC DD 35993000
REFRATE DW 8499
DB 40 dup (0)
;--------------------------------------


thanks for the tables, but i see no 5:4 aspect ratio mode,
except the 1280x1024 mode :-/

thanks anyway for all the hints !

Dirk

yg

.