Re: Patch to add mode setting to sysfs
From: Jon Smirl <hidden>
Date: 2005-02-18 02:59:36
On Fri, 18 Feb 2005 08:04:46 +0800, Antonino A. Daplas [off-list ref] wrote:
This is dangerous. For one, if the mode in info->var does not match any of the entries in the modelist, you can get a screwed up display. Secondly, fbcon refers to info->modelist to store settings for each console. Thus it is better to check first if the mode in the modelist is currently in use. A safer way is to loop through each entries of the old modelist, call fb_set_var() with the FB_ACTIVATE_INV_MODE set in var->activate. This process will safely remove each mode from the modelist. Not all entries will be deleted of course. After that, loop through each entries of the new modedb array, and use fb_add_videomode() to add each entry to the modelist.
Radeon hardware has an interrupt that is not hooked up in radeonfb that can tell if the monitor has been switched. Hook a radeon to a KVM switch and flip the switch. We should get an interrupt. Use the interrupt to trigger a hotplug event. Hotplug event will set a new list of modes into radeonfb. All of the old modes have to be deleted, they probably don't exist in the new monitor. At this point fbcon needs to get a modelist change event. It can then find_mode() to find a new mode that is close to what it was using. So the problem seems to be that disp->mode holds a pointer to the mode instead of a copy of the mode. I'll try changing this to a copy. Does fbcon really need to know the entire mode structure or could it work with just the resolution? I'd feel more comfortable if fbcon used a well defined interface to fbdev instead of having access to all of fbdev's internal structures. I tried modifying fbcon to use DRM but it is completely tied to fbdev. Anyway, the current code is much better than it was in 2.4. -- Jon Smirl jonsmirl@gmail.com ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click