[PATCH 1/3: FBDEV: VGA State Save/Restore module
Quoted 10 lines · Antonino Daplas
Quoted 1 line · Petr Vandrovec
On 4 Dec 02 at 22:26, Antonino Daplas wrote:
[...]
Quoted 5 lines
And if my VGA documentation is correct, you are saving random data into
vga_text: first 8192 chars interleaved with
8192 bytes of garbage, plus attributes from chars 8192-16383 interleaved with 8192 bytes of garbage.Right, I'm not sure about this part too. The docs say that this is true for EGA compatible hardware. How about non-compliant hardware?
Like non-VGA? Like CGA/MDA? I thought that non-VGA/non-EGA adapters are out of scope of this document ;-)
Quoted 8 lines
Quoted 4 lines
And if you are using standard hardware, then font data live only in plane 2, plane 3 is unused on VGA hardware in text mode. I think that you should either save whole 256KB of memory, without deeper understanding, or you should just save FONT 0 (first 32*256 bytes from plane 2) if you
Only if saving the first character map in plane 2. Hardware can have as much as 8 character maps per plane, each 8K in size for 64K. The same setup is true for plane 3 fonts.
How you select them? Mine doc says that font block 0 begins in plane 2 at offset 0, block 1 at offset 16KB, 2 at 32K, 3 at 48K, 4 at 8K, 5 at 24K, 6 at 40K, and last, 7th, at 56KB, and sequencer has two threebit fields...
Quoted 7 lines
Quoted 2 lines
want to save memory and you know that console was driven by vgacon in text mode.
To save memory, apps can explicitly choose what to save, but I don't want to go finer than that, ie. save character maps 2,3,5 of plane 2 and 1,2,3 of plane 3. The current way of saving the text mode map may be a bit wasteful, but better than being bitten by hardware that's non-EGA compliant.
Look at vgacon. Uses font block 0,2,3 from plane 2 when built without BROKEN_GRAPHICS_PROGRAMS, or 0,1 when built with BROKEN_GRAPHICS_PROGRAMS. So if you want just restore vgacon environment, save only these 4 blocks (4*8K = 32K). Or you want to save whole VGA memory, and then save whole 256KB, without tricks while saving planes 0 & 1.
Petr Vandrovec [email protected]
Quoted 9 lines · Petr Vandrovec
Quoted 8 lines · Antonino Daplas
Quoted 1 line · Petr Vandrovec
On 4 Dec 02 at 22:26, Antonino Daplas wrote:
[...]
Quoted 5 lines
And if my VGA documentation is correct, you are saving random data into
vga_text: first 8192 chars interleaved with
8192 bytes of garbage, plus attributes from chars 8192-16383 interleaved with 8192 bytes of garbage.
Quoted 6 lines
Quoted 2 lines
Right, I'm not sure about this part too. The docs say that this is true for EGA compatible hardware. How about non-compliant hardware?
Like non-VGA? Like CGA/MDA? I thought that non-VGA/non-EGA adapters are out of scope of this document ;-)
Okay :-), as I've said this is the part I'm not sure of. I'll do it your way then, save 8K at offset 0 and save 8K at offset 16K. That should be 16K used instead of 32K, right?
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
And if you are using standard hardware, then font data live only in plane 2, plane 3 is unused on VGA hardware in text mode. I think that you should either save whole 256KB of memory, without deeper understanding, or you should just save FONT 0 (first 32*256 bytes from plane 2) if you
Quoted 8 lines
Quoted 3 lines
Only if saving the first character map in plane 2. Hardware can have as much as 8 character maps per plane, each 8K in size for 64K. The same setup is true for plane 3 fonts.
How you select them? Mine doc says that font block 0 begins in plane 2 at offset 0, block 1 at offset 16KB, 2 at 32K, 3 at 48K, 4 at 8K, 5 at 24K, 6 at 40K, and last, 7th, at 56KB, and sequencer has two threebit fields...
Selection was not the problem, the code just saves the entire 64K for character maps 0-7.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
want to save memory and you know that console was driven by vgacon in text mode.
To save memory, apps can explicitly choose what to save, but I don't want to go finer than that, ie. save character maps 2,3,5 of plane 2 and 1,2,3 of plane 3. The current way of saving the text mode map may be a bit wasteful, but better than being bitten by hardware that's non-EGA compliant.
Quoted 6 lines
Look at vgacon. Uses font block 0,2,3 from plane 2 when built without
BROKEN_GRAPHICS_PROGRAMS, or 0,1 when built withBROKEN_GRAPHICS_PROGRAMS. So if you want just restore vgacon environment, save only these 4 blocks (4*8K = 32K). Or you want to save whole VGA memory, and then save whole 256KB, without tricks while saving planes 0 & 1.
Okay, then. My approach was to be non-vgacon specific. I'll do it to specifically target vgacon then.
To summarize:
plane 0/1 save 8K at offset 0 and 8K at offset 16K;
plane 2 save 32K at offset 0 (covers blocks 0-3),
plane 3 same for plane 2
Drivers can set VGA_SAVE_TEXT | VGA_SAVE_FONT0 to save planes 0-2. If there are no complaints, I'll proceed doing it this way.
Thanks for the input Petr.
Tony
Quoted 9 lines · Antonino Daplas
Quoted 2 lines · Petr Vandrovec
On 5 Dec 02 at 6:05, Antonino Daplas wrote:
planes 0 & 1.Okay, then. My approach was to be non-vgacon specific. I'll do it to specifically target vgacon then.
To summarize:
plane 0/1 save 8K at offset 0 and 8K at offset 16K;
I'm not sure about this one. AFAIK by default vgacon uses first 32KB completely (every second byte...) from both 0/1, and can be configured (by enabling VGA_CAN_DO_64KB) to use full 64KB.
Quoted 5 lines
plane 2 save 32K at offset 0 (covers blocks 0-3),
plane 3 same for plane 2Drivers can set
VGA_SAVE_TEXT|VGA_SAVE_FONT0to save planes 0-2. If there are no complaints, I'll proceed doing it this way.
I have no other problems.
Petr Vandrovec [email protected]
Quoted 7 lines
Look at vgacon. Uses font block 0,2,3 from plane 2 when built without
BROKEN_GRAPHICS_PROGRAMS, or 0,1 when built withBROKEN_GRAPHICS_PROGRAMS. So if you want just restore vgacon environment, save only these 4 blocks (4*8K = 32K). Or you want to save whole VGA memory, and then save whole 256KB, without tricks while saving planes 0 & 1.
If you could get ride of the dependance on BROKEN_GRAPHICS_PROGRAM I would be really happy.