Reply 160 of 166, by Falcosoft
- Rank
- l33t
Falcosoft wrote on Today, 04:42:OK, I have tried once again and X-VESA's virtual resolution test could really use 3840x2160 virtual resolution in 1920x1080x8-bi […]
RayeR wrote on Yesterday, 23:57:Falcosoft wrote on Yesterday, 22:40:But on my GTX 970 and 960 cards the around 4MB video memory limit is present in practice even in LFB modes (although reported as 16MB).
ORLY? Once when I got in touch with 4k Dell LCD I tested on my GTX 970 VESA LFB modes 3840 x 2160 / 8 and 16 bpp so it definitely used more than 4MB for LFB:
OK, I have tried once again and X-VESA's virtual resolution test could really use 3840x2160 virtual resolution in 1920x1080x8-bit LFB mode.
But my test program (that actually works perfectly on Intel's integrated GFX) still produces the same problem. That is it can only draw to about 4MB video memory in LFB mode.
The interesting thing is that since I tried my test program after running X-VESA's virtual resolution test I got no garbage at the unreachable memory region but the test image left by X-VESA's virtual resolution test 😀
Here is a demo video about this:@Edit:
BTW, my test program's result is somewhat confirmed by VBETEST.EXE that can be found in Scitech's UNIVBE package. That is only a ~4MB buffer can be created even in LFB mode by the program's virtual resolution test:Maybe the different results are because both my test program and VBETEST.EXE from UNIVBE uses 32-bit protected mode while X-VESA does not.
I have found what the problem is:
VBE Function 06 - Set Logical Scanline Length in DX register returns the number of scanlines possible in the set virtual resolution mode. In case of my cards this call returns the number of scanlines possible in banked mode (about 4 MB) even when it is called after an LFB mode is set. After I modified NEWAX source to return double the amount of scanlinlines in DX both my test program and UNIVBE's VBETEST.EXE started to use the doubled memory region without problems:
continue_int_10_3:cmp ax,(VESA_ID SHL 8h) + VESA_FUNC_SET_GET_SCANLINEjne continue_int_10_4pushfcall cs: dword ptr [old_int_10_off]cmp ax,VESA_IDjne no_set_scanlinetest cs: byte ptr [status_flag_0],NEWAX_FLAG_VESA_MODEje no_set_scanlinemov cs: word ptr [byte_per_scanline],bx[b]add dx, dx[/b]no_set_scanline:
This way actually I can use the doubled ~8 MB of video memory also from banked modes! This means that the ~4 MB limit is not a real hardware limit. 3840 x 2160 x 8-bit virtual resolution works perfectly without artifacts in banked mode.
Maybe an option can be added to NEWAX to report the double amount of available scanlines for the ones like me 😀
BTW, I also changed what value is put to ModeInfoBlock.NumberOfImagePages since according to my tests in this filed the same value is expected by VBETEST.EXE from UNIVBE as in ModeInfoBlock.LinNumberOfImagePages and not as in ModeInfoBlock.BnkNumberOfImagePages. This way VBETEST.EXE from UNIVBE can differentiate between the available image pages in banked vs. LFB modes.
With the current version of NEWAX VBETEST.EXE from UNIVBE only lists the same amount of image pages available for LFB modes as for banked modes.
continue_number_pages:movzx eax,cs: word ptr [vesa_memory]shl eax,10hpush eaxxor edx,edxdiv esidec ax[b]mov es: byte ptr [di].ModeInfoBlock.NumberOfImagePages,al[/b]mov es: byte ptr [di].ModeInfoBlock.LinNumberOfImagePages,alpop eaxtest cs: byte ptr [status_flag_0],NEWAX_FLAG_LINEAR_MODEjne nvidia_high_vramcmp esi,NVIDIA_BANKED_VRAM SHL 10hja nvidia_high_vrammov eax,NVIDIA_BANKED_VRAM SHL 10h
@Edit:
Modified NEWAX06 3840 x 2160 x 8-bit virtual resolution Banked mode test video (it works perfectly):
https://youtu.be/2PCI_7Oxz8Q
PS:
It seems X-VESA can detect the falsely reported ~4 MB available scanlines in LFB modes and can use more than the reported scanlines in LFB modes (most likely that's why it worked even with the original NEWAX why other programs do not)
but X-VESA actually fails to detect that the reported ~4 MB available video memory is also false in case of banked modes and refuses to use the actually available more than ~4 MB video memory in banked modes.