Re: 640x512x16bpp with VESA ?



Am Thu, 15 May 2008 02:45:37 +0200 schrieb whygee:

Hello,

I have to use a 1280x1024 screen but there are too many pixels
to compute there. I think that a halved resolution would fit
but 1:1.25 ratio modes are very scarce. Practically, I use
the VESA2 framebuffer in ASM with my own bootloader so the
help of an operating system is useless, unless it gives me
correct parameters.

Public information from vesa.org:
vbe3.pdf

EEDIDguideV1.pdf
e-edid_implementation_guide_vesa.pdf
EEDIDverifGuideRa.pdf
Vbeddc11.pdf

GTF_V1R1.xls
CVTd6r1.xls

VBE-AF07.pdf
-----------------------------------------------------------
INT 10 - VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION
AX = 4F00h
ES:DI -> buffer for SuperVGA information (see #00077)
....
Format of SuperVGA information:
Offset Size Description (Table 00077)
....
0Eh DWORD pointer to list of supported VESA and OEM video modes
(list of words terminated with FFFFh)
;-------------------------------------------------------
INT 10 - VESA SuperVGA BIOS - GET SuperVGA MODE INFORMATION
AX = 4F01h
CX = SuperVGA video mode
bit 14 set means enable linear framebuffer mode (VBE v2.0+)
bit 13 set means VBE/AF v1.0P initializes accelerator hardware
ES:DI -> 256-byte buffer for mode information (see #00079)
....
Format of VESA SuperVGA mode information:
Offset Size Description (Table 00079)
00h WORD mode attributes (see #00080)
....
12h WORD width in pixels (graphics) or characters (text)
14h WORD height in pixels (graphics) or characters (text)
....
19h BYTE number of bits per pixel
...
28h DWORD physical address of linear video buffer
....

Bitfields for VESA SuperVGA mode attributes:
Bit(s) Description (Table 00080)
[vbe3.pdf]
The ModeAttributes field is defined as follows:
D0 = Mode supported by hardware configuration
0 = Mode not supported in hardware
1 = Mode supported in hardware
D1 = 1 (Reserved)
D2 = TTY Output functions supported by BIOS
0 = TTY Output functions not supported by BIOS
1 = TTY Output functions supported by BIOS
D3 = Monochrome/color mode (see note below)
0 = Monochrome mode
1 = Color mode
D4 = Mode type
0 = Text mode
1 = Graphics mode
D5 = VGA compatible mode
0 = Yes
1 = No
D6 = VGA compatible windowed memory mode is available
0 = Yes
1 = No
D7 = Linear frame buffer mode is available
0 = No
1 = Yes
D8 = Double scan mode is available
0 = No
1 = Yes
D9 = Interlaced mode is available
0 = No
1 = Yes
D10 = Hardware triple buffering support
0 = No
1 = Yes
D11 = Hardware stereoscopic display support
0 = No
1 = Yes
D12 = Dual display start address support
0 = No
1 = Yes
D13-D15 = Reserved
;-------------------------------------------------------
INT 10 - VESA SuperVGA BIOS - SET SuperVGA VIDEO MODE
AX = 4F02h
BX = mode
ES:DI = Pointer to CRT-Block

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

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)

;-------- 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´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.

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).

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?

[RBIL]
--------V-1012--BL35-------------------------
INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS) - DISPLAY-SWITCH INTERFACE
AH = 12h
BL = 35h
AL = subfunction
00h initial adapter video off
01h initial planar video on
02h switch active video off
03h switch inactive video on
80h *UNDOCUMENTED* set system board video active flag
ES:DX -> buffer for 128 byte save area (if AL = 00h-03h)
Return: AL = 12h if function supported
Desc: switch between two video adapters which may otherwise have address
conflicts
SeeAlso: AX=BF00h,AX=BF01h,INT 6D"VGA"

--------V-104F04-----------------------------
INT 10 - VESA SuperVGA BIOS - SAVE/RESTORE SuperVGA VIDEO STATE
AX = 4F04h
DL = subfunction

I guess that I have to setup 1280x1024x16 then tweak the CRTC
to "double scan" (so i get 1280x512). I have read books 12 years
ago about this but i don't remember the particularities of the X mode :-)
I have to half the clock speed too but it's above my ability now
(i don't have the books anymore). Hint : my graphics chip is based on S3.

....

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.

thanks,
YG (not been here for 8 years or so...)

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?

;--------------------------------------
; 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)
;--------------------------------------

***

-------------------------------------
ATI 9800 PRO VESA Modi 128 MB (VBE2)
-------------------------------------
4 8 15 16 24 32 Matrix
-------------------------------------
109 132 x 25
10A 132 x 43
130 132 x 44
182 10D 10E 10F 120 320 x 200
192 193 194 195 196 320 x 240
1A2 1A3 1A4 1A5 1A6 400 x 300
1B2 1B3 1B4 1B5 1B6 512 x 384
1C2 1C3 1C4 1C5 1C6 640 x 350
100 183 184 185 186 640 x 400
101 110 111 112 121 640 x 480
102 103 113 114 115 122 800 x 600
104 105 106 107 108 123 1024 x 768
107 119 11A 11B 124 1280 x 1024
-------------------------------------
ATI X800 PRO VESA MODI 256 MB
-------------------------------------
4 8 15 16 24 32 Matrix
-------------------------------------
109 132 x 25
10A 132 x 34
130 132 x 44
10D 10F 320 x 200
193 194 196 320 x 240
1B3 1B4 1B6 512 x 384
1C3 1C4 1C6 640 x 350
100 184 186 640 x 400
101 110 112 640 x 480
133 134 136 720 x 400
103 113 115 800 x 600
105 116 118 1024 x 768
153 154 156 1152 x 864
107 119 11B 1280 x 1024
143 144 146 1400 x 1050
173 174 176 1600 x 1200
1D3 1D4 1D6 1856 x 1392
1E3 1E4 1E6 1920 x 1440
-------------------------------------
NVIDIA GF 4 Ti4200 VESA Modi 64 MB
-------------------------------------
4 8 15 16 24 32 Matrix
-------------------------------------
108 80 x 60
109 132 x 25
10A 132 x 43
10B 132 x 50
10C 132 x 60
130 10E 10F 320 x 200
134 135 136 320 x 240
131 132 133 320 x 400
100 13D 13E 640 x 400
101 111 112 640 x 480
102 103 114 115 800 x 600
104 105 117 118 1024 x 768
106 107 11A 1280 x 1024
147 148 1400 x 1050
145 146 1600 x 1200
-------------------------------------
NVIDIA GF 6800 GT VESA Modi 256 MB
-------------------------------------
4 8 15 16 24 32 Matrix
-------------------------------------
130 10E 10F 320 x 200
134 135 136 320 x 240
131 132 133 320 x 400
100 13D 13E 640 x 400
101 111 112 640 x 480
102 103 114 115 800 x 600
104 105 117 118 1024 x 768
106 107 11A 11B 1280 x 1024
145 146 1600 x 1200
147 148 1400 x 1050
152 2048 x 1536
-------------------------------------

Dirk

.



Relevant Pages

  • Kernel bug at net/core/skbuf.c:93
    ... The kernel BUG backtrace starts with "unknown_bootoption" and it contains the smp_apic_timer_interrupt. ... The kernel BUG occurs just when the the video disc recorder is initializing its plugins. ... 00:03.0 USB Controller: Silicon Integrated Systems USB 1.0 ... # ACPI Support ...
    (Linux-Kernel)
  • Re: So long and thanks for all the fish.
    ... The management of video within RISC OS 6 has changed significantly. ... Drivers can now support multiple display devices. ... Browser search ...
    (comp.sys.acorn.misc)
  • 2.6.0-test1 freeze when loading maestro3 sound module
    ... 000c0000-000c7fff: Video ROM ... f8000000-fbffffff: PCI Bus #01 ... ATI Technologies Inc Rage Mobility M3 AGP ... # ACPI Support ...
    (Linux-Kernel)
  • Re: Linux-2.6.27-rc5, drm errors in log
    ... an older radeon 9200SE video card. ... # Linux kernel version: 2.6.27-rc5 ... # IPVS transport protocol load balancing support ... # Input Device Drivers ...
    (Linux-Kernel)
  • Top MP3 players
    ... TV and video formats supported: ... Support for 480p and 576p component TV out ... Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio ... Additional features: Calendar, Bass Boost, Volume control, Voice ...
    (microsoft.public.windows.vista.music_pictures_video)