|
From: James S. <jsi...@in...> - 2003-01-09 00:33:46
|
> How is a driver supposed to set the default mode on init lately ?
>
> Looking at rivafb, it fills info->var from fb_find_mode with the mode
> option if any, but then does nothing with it (and does nothing if
> no mode option is passed).
>
> On radeonfb, I fill a var with the default mode obtained
> from EDID or the option if any. Then, I basically do
>
> info->var = var;
> var.activate = FB_ACTIVATE_NOW;
> fb_set_var(&var, info);
>
> before calling register_framebuffer.
>
> What is the right way to do ?
Sorry about the confusion. The answer depends on the driver. For the
rivafb driver because it has a VGA core we have it NOT switch to a
graphics state. The reason is
1) If we run a /dev/fb app was can save the hardware text mode state and
restore it on closing /dev/fb. You can see this in rivafb_open and
rivafb_release.
2) We can test loading it as a module as see debugging info while still
having a VGA text mode. Makes life a little easier. The other thing
I like to do is run mdacon and just the fbdev driver by itself. I can
then test the fbdev driver. When I get really brave I test fbcon.c and
can debug it.
Now for graphics hardware built in that has no hardware text mode. It is
better to set the video mode right away.
|