This is a good idea. I'm going to re-work the patch, but I have a lot of other stuff going on too, so it may be a week or so before I get back to it.

On 11/01/2011 12:57 PM, Gerd Hoffmann wrote:
On 11/01/11 14:39, John Baboval wrote:
I don't know of any reason for it.
I'd guess it is alignment, probably not important for all color depts.

Maybe it is a good idea to do all sanity checks in the
VBE_DISPI_INDEX_ENABLE branch where the actual mode switch happens. Then
you already know xres, yres and depth when applying the checks.  You can
calculate the scanline length, then check the scanline alignment instead
of being overly strict on xres in high color modes to satisfy alignment
requirements in low color modes.

You can also simply calculate how much memory the video mode needs and
check that against the configured video ram instead of pulling xres and
yres limits out of thin air.

cheers,
   Gerd


Reply via email to