SVGA page flip in pmode without INT 10H

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
iman
Member
Member
Posts: 84
Joined: Wed Feb 06, 2019 10:41 am
Libera.chat IRC: ImAn

SVGA page flip in pmode without INT 10H

Post by iman »

Hi.
Can someone please explain which steps should be taken in order to set the CRTC register with the new screen address while in 32-bit PMODE and without using VM86 INT 10H.

While in 16-bit, one can set indices 0x0C and 0x0D of the CRTC index register (i.e. 0x03D4) to set the new screen address, but how is the procedure in case of having a 32-bit address?
Iman Abdollahzadeh
Github
Codeberg
nullplan
Member
Member
Posts: 2054
Joined: Wed Aug 30, 2017 8:24 am

Re: SVGA page flip in pmode without INT 10H

Post by nullplan »

No VM86 mode? Well, then you'll have to interpret opcodes. There is no general way to control a graphics card but through its BIOS extensions. You may be able to use VGA compatibility mode to access VGA modes, but that means that 640x480x4 (i.e. 16 color mode) is going to be the highest possible resolution. For any more you will need the SVGA BIOS, either by running it directly or by interpreting opcodes. Or else you will need a graphics card driver, for your graphics card. Usually, you only need a driver for the chipset, the integrators really don't change a lot about it. If you have an Intel graphics card, this should be possible, since they publish their drivers in the Linux source code. AMD users might be a little less lucky, and nVidia users are just SOL, since nVidia don't publish hardware documentation. One reason why I've sworn off them.
Carpe diem!
User avatar
iman
Member
Member
Posts: 84
Joined: Wed Feb 06, 2019 10:41 am
Libera.chat IRC: ImAn

Re: SVGA page flip in pmode without INT 10H

Post by iman »

nullplan wrote: You may be able to use VGA compatibility mode to access VGA modes, but that means that 640x480x4 (i.e. 16 color mode) is going to be the highest possible resolution.
I use 1024 x 768 x 32 bpp mode.
Since I was able to get the vsync implementation directly by programming port 0x3DA without INT 10H , I am thinking of doing so to page flip as well.

Is it possible to find the SVGA mapped registers with knowing only the vendor?
Iman Abdollahzadeh
Github
Codeberg
Octocontrabass
Member
Member
Posts: 6282
Joined: Mon Mar 25, 2013 7:01 pm

Re: SVGA page flip in pmode without INT 10H

Post by Octocontrabass »

iman wrote:Since I was able to get the vsync implementation directly by programming port 0x3DA without INT 10H , I am thinking of doing so to page flip as well.
Directly accessing VGA registers will only work when the mode you've selected is reported as VGA-compatible (when bit 5 of ModeAttributes is 0).
iman wrote:Is it possible to find the SVGA mapped registers with knowing only the vendor?
No.
rdos
Member
Member
Posts: 3396
Joined: Wed Oct 01, 2008 1:55 pm

Re: SVGA page flip in pmode without INT 10H

Post by rdos »

I wouldn't bother with any video mode that is not direct mapped (linear frame buffer). With those you simply don't need to flip.

I have an V86 monitor and so could call the video BIOS flip or mode switch from protected mode, but with EFI support that doesn't allow mode switches after boot, I've decided to always set the native video mode instead even when I boot in legacy mode. Technically, I can still boot in text mode, and let the V86 monitor switch video mode, but I never do it anymore.

I really hated all those strange bit-plane mapped modes. So much that I never did any graphics code at all until I could setup linear frame buffer. It's a nightmare to handle, and the palette is impossible to implement in a sane way.
rdos
Member
Member
Posts: 3396
Joined: Wed Oct 01, 2008 1:55 pm

Re: SVGA page flip in pmode without INT 10H

Post by rdos »

iman wrote:I use 1024 x 768 x 32 bpp mode.
I think that is an LFB mode, and so doesn't use bitplanes, and thus no need to flip.
Post Reply