Re: Detect switching to X?
From: Knut Petersen <hidden>
Date: 2005-11-28 13:45:59
Hi Tony, thanks for the quick reply.
Try this patch. fb_save_state() will be called when going from KD_GRAPHICS to KD_TEXT. The driver has the opportunity here to save the current state of the hardware before it's touched by fbdev. fb_restore_state() will be called when going from KD_TEXT to KD_GRAPHICS mode. The driver has the opportunity to set the hardware back to something recognizable by the graphics application.
Are you sure? I added a save_state and restore_state function to
cyblafb, both
including nothing but a printk and return. I also added a printk at the
start of
both the check_var and set_par functions of cyblafb. The "Scrollmode=
..." lines
originate from a printk in updatescrollmode:
Loading of cyblafb and switching to it using the following commands:
echo -n "0" > /sys/class/graphics/fb0/con_rotate
echo -n "0" > /sys/class/graphics/fb1/con_rotate
con2fb /dev/fb0 /dev/tty1
rmmod cyblafb
sync
modprobe cyblafb scalign=4
con2fb /dev/fb1 /dev/tty1
echo -n "0" > /sys/class/graphics/fb0/con_rotate
echo -n "0" > /sys/class/graphics/fb1/con_rotate
setfont ~/lat9w-16.psfu.gz
rcgpm restart
echo -e '\033[?2c'
dmesg output:
[ 4910.034508] cyblafb: CyblaFB version 0.55 normal exit.
[ 4910.086590] cyblafb: CyblaFB version 0.55 initializing
[ 4910.088746] cyblafb: Pixmap size = 8188, alignement = 4
[ 4910.090688] ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] ->
GSI 11 (level, low) -> IRQ 11
[ 4910.094348] cyblafb: region 0x3c0/0x20 already reserved
[ 4910.096321] cyblafb: region 0xe1800000/0x800000 already reserved
[ 4910.098374] cyblafb: check_var
[ 4910.106050] cyblafb: set_par
[ 4910.108224] Scrollmode = SCROLL_PAN_MOVE
[ 4910.121050] Scrollmode = SCROLL_PAN_MOVE
[ 4910.138671] Scrollmode = SCROLL_PAN_MOVE
[ 4910.138763] Scrollmode = SCROLL_PAN_MOVE
[ 4910.180336] Scrollmode = SCROLL_PAN_MOVE
now switching to X:
[ 4921.533936] Scrollmode = SCROLL_PAN_REDRAW
now switching back to framebuffer console:
[ 4929.167382] cyblafb: set_par
[ 4929.169506] Scrollmode = SCROLL_PAN_MOVE
[ 4929.181895] cyblafb: save_state has been called, switching from
KD_GRAPHICS to KD_TEXT
[ 4929.181917] cyblafb: check_var
[ 4929.181929] cyblafb: set_par
[ 4929.184695] Scrollmode = SCROLL_PAN_MOVE
no switching to X again:
[ 4933.273261] Scrollmode = SCROLL_PAN_REDRAW
1. restore_state is never called
2. there is a set_par prior to the call to save_state, but that´s
irrelevant for me as
there is a check_var and set_par call after save_state.
cu,
Knut
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click