[haiku-development] Re: [PATCH 2/4] Mode switching support for VESA driver.
- From: Jan Kloetzke <jan.kloetzke@xxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Wed, 28 May 2008 19:22:58 +0200
"Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx> wrote:
> Jan Klötzke <jan.kloetzke@xxxxxxxxxx> wrote:
> > @@ -149,6 +154,75 @@ vesa_uninit(vesa_info &info)
> > dprintf(DEVICE_NAME": vesa_uninit()\n");
> >
> > delete_area(info.shared_info->frame_buffer_area);
> > - delete_area(info.shared_area);
> > +}
>
> Already applied, but was there any reason to remove this line? In any
> case, I've added it back in before applying the patch.
Indeed this was a mistake. It should have been the line before, that
is "delete_area(info.shared_info->frame_buffer_area);". The vesa driver get's
the frame buffer area via the FRAME_BUFFER_BOOT_INFO boot item. As the driver
doesn't allocate the area itself it also shouldn't delete it when unloaded.
> + newFBArea = map_physical_memory("vesa_fb",
> + (void *)modeInfo.physical_base, modeInfo.bytes_per_row *
> + modeInfo.height, B_ANY_KERNEL_ADDRESS,
> + B_READ_AREA | B_WRITE_AREA | B_USER_CLONEABLE_AREA, &
> frameBuffer);
>
> I've removed B_USER_CLONEABLE_AREA from this, even though it shouldn't
> really matter, as the the frame buffer is accessible from userland
> anyway.
> BTW maybe it would be nicer to make the mapped space large enough for
> the highest resolution, so that one doesn't need to remap it everytime.
I know but the vesa bios is free to give you a different physical address of
the frame buffer for every mode (even if it's unlikely). Therefore I decided
to remap it unconditionally for every mode switch. Could be an option to
optimize the most common case, that is a static physical frame buffer
address -> allocate the area for the highest resolution and do the remapping
only when really needed. I think I'll do that... :-)
> I also noticed the app_server now falls back to 640x480 on Qemu, but
> that problems seems to be in the app_server. I'll look into that in the
> next few days.
I also noticed that but I thought it's ok as only happens with a fresh image.
As soon as I changed the resolution with the screen preflet all works as
expected...
/Jan
Other related posts: