All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Linux-fbdev-devel] [RFC] fbdev & power management
@ 2001-03-21 17:02 James Simmons
  2001-03-21 22:09 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 14+ messages in thread
From: James Simmons @ 2001-03-21 17:02 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Linux Fbdev development list, Linux console project,
	Linux Kernel Mailing List


>Ok, I see. Currently, the sleep process is started from an ioctl sent to
>another driver, which will in turn call various notifier functions to
>shut down bits of hardware and finally put the machine to sleep. It's not
>a direct ioctl to the /dev/fb (which may not be opened).

[snip]...

I need to ask you where is this code? I like to take a look at it to
figure out what you are doing.

MS: (n) 1. A debilitating and surprisingly widespread affliction that
renders the sufferer barely able to perform the simplest task. 2. A disease.

James Simmons  [jsimmons@linux-fbdev.org]               ____/|
fbdev/console/gfx developer                             \ o.O|
http://www.linux-fbdev.org                               =(_)=
http://linuxgfx.sourceforge.net                            U
http://linuxconsole.sourceforge.net


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [Linux-fbdev-devel] [RFC] fbdev & power management
@ 2001-03-14 21:30 James Simmons
  0 siblings, 0 replies; 14+ messages in thread
From: James Simmons @ 2001-03-14 21:30 UTC (permalink / raw)
  To: Brad Douglas
  Cc: Geert Uytterhoeven, Benjamin Herrenschmidt,
	Linux Fbdev development list, Linux Kernel Mailing List,
	Linux console project


>But wouldn't falling back to dummycon prevent the driver specific
>suspend/resume calls from working?  Or at a minimum, make handling those
>calls more complex?

Not if suspend/resume are handled on the fbdev driver level. Dummycon
would only shutdown fbcon on explict open of /dev/fb. Also note it will be
possible to have only a serial console and use /dev/fb by itself. In this
case we don't even need dummycon since their is no VT support present.

>No, there does not need to be graphical images of the text console -- a
>simply text buffer would suffice.

See email to Ben.

>But what about things like GTKFb and
>Embedded QT?  They would certainly benefit from having a backup screen
>image, right?  I do not believe there is any way to determine if the
>console is in fact in a 'text' or graphical state.

Yes and it would not be hard to do this. I have the basic idea in the
email to Ben. As for console in text or graphical state take a look at
vt_ioctl.c:vt_ioctl() for KDGETMODE. You get back KD_TEXT or KD_GRAPHICS.


MS: (n) 1. A debilitating and surprisingly widespread affliction that
renders the sufferer barely able to perform the simplest task. 2. A disease.

James Simmons  [jsimmons@linux-fbdev.org]               ____/|
fbdev/console/gfx developer                             \ o.O|
http://www.linux-fbdev.org                               =(_)=
http://linuxgfx.sourceforge.net                            U
http://linuxconsole.sourceforge.net


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [Linux-fbdev-devel] [RFC] fbdev & power management
@ 2001-03-14 21:20 James Simmons
  2001-03-15 11:31 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 14+ messages in thread
From: James Simmons @ 2001-03-14 21:20 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Geert Uytterhoeven, Linux Kernel Mailing List,
	Linux Fbdev development list, Linux console project


>>I'd go for a fallback to dummycon. It's of no use to waste power on
>>creating graphical images of the text console when asleep. And the
>>fallback to dummycon is needed anyway while a fbdev is opened (in
>>2.5.x).
>
>We do already have the backup image since we need to backup & restore the
>framebuffer content.

  What he is talking about is in 2.5.X when you explictly open /dev/fb it
will call take_over_console with dummy con. This allows for several
things. One is with this approach their is no chance of a conflict between
X/DRI and fbdev. Especially when we will have fbdev drivers using DMA
internally to preform console operations. For some hardware using DMA is
the only way fbdev can work and on some platforms fbcon is the only
choice. So things going into /dev/ttyX will not have a chance to interfere
with X.  The second reason is for security. It is possible to have a
program to open /dev/fb and see what is being typed on the fore ground
console. I sealed up those holes using the dummy con approach and some
test to see if the current process is local.
  Now for fbcon its simpler. Things get writing to the shadow buffer
(vc_screenbuf). When the console gets woken up update_screen is called.
While power down the shadow buffer can be written to which is much faster
than saving a image of the framebuffer. Of course if you still want to do
this such in the case of the X server then copy the image of the
framebuffer to regular ram. Then power down /dev/fb using some ioctl calls
provide.

MS: (n) 1. A debilitating and surprisingly widespread affliction that
renders the sufferer barely able to perform the simplest task. 2. A disease.

James Simmons  [jsimmons@linux-fbdev.org]               ____/|
fbdev/console/gfx developer                             \ o.O|
http://www.linux-fbdev.org                               =(_)=
http://linuxgfx.sourceforge.net                            U
http://linuxconsole.sourceforge.net


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [Linux-fbdev-devel] [RFC] fbdev & power management
@ 2001-03-14 20:48 James Simmons
  2001-03-15  8:21 ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: James Simmons @ 2001-03-14 20:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Brad Douglas, Linux Kernel Mailing List,
	Linux Fbdev development list, Linux console project


>>So the fbdev drivers would register PM with fbcon, not PCI, correct?
>
>Either that, or the fbdev would register with PCI (or whatever), _and_
>fbcon would too independently. In that scenario, fbcon would only handle
>things like disabling the cursor timer, while fbdev's would handle HW
>issues. THe only problem is for fbcon to know that a given fbdev is
>asleep, this could be an exported per-fbdev flag, an error code, or
>whatever. In this case, fbcon can either buffer text input, or fallback
>to the cfb working on the backed up fb image (that last thing can be
>handled entirely within the fbdev I guess).

Hi!
  I had to give it some thought. I like to see this handles inside the
fbdev driver itself instead of inside fbcon. For 2.5.X it will be possible
to use /dev/fb with vgacon. Even better yet it will be possible to use
just a serial console and not use a VT but still use /dev/fb. So we will
want to to have fbdev doing power management itself. As for handling the
cursors I recently purposed a standardize cursor api so X can use it as
well via userland and a standard fbcon_cursor can be written. With this
api it would be easy to handle suspending and restoring the cursor for
fbcon for /dev/fb.
  As for fbcon knowing when it is asleep. Hum. We could have a flags to
tell it to have text data updates to be placed in the shadow buffer
(struct vc_datas->vc_screenbuffer) only;

MS: (n) 1. A debilitating and surprisingly widespread affliction that
renders the sufferer barely able to perform the simplest task. 2. A disease.

James Simmons  [jsimmons@linux-fbdev.org]               ____/|
fbdev/console/gfx developer                             \ o.O|
http://www.linux-fbdev.org                               =(_)=
http://linuxgfx.sourceforge.net                            U
http://linuxconsole.sourceforge.net


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [RFC] fbdev & power management
@ 2001-03-13 21:25 Benjamin Herrenschmidt
  2001-03-14  8:02 ` [Linux-fbdev-devel] " Brad Douglas
  0 siblings, 1 reply; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2001-03-13 21:25 UTC (permalink / raw)
  To: Linux Fbdev development list, linux-kernel

I'm working on improving some aspects of Power Management on the
PowerBooks, and among other things, I have a problem with fbdevs.

Currently, each fbdev registers a power management callback to sleep/
wakeup the device. We handle HW related things (shutting the backlight
off, putting the chip to sleep when possible, backing up the frame buffer
content, etc...) from there.

We do call the video sleep last during the sleep process, and wake it up
first, to avoid any problem if something is beeing printed to the console
while the chip is suspended.

However, this is not very safe. First, there's the cursor timer, which
can screw us up. I have a hack in my tree where the fbdev driver calls a
new routine in fbcon.c that stops/starts the cursor timer.

But I'm looking toward a more generic solution. By having a way to
"suspend" the entire fbcon, maybe we can have all console output blocked
& buffered until the fbcon is woken up. Also, a question is should we
call that fbcon_suspend()/fbcon_resume() (currently only the cursor timer
stuff) from the fbdev's or should the fbcon itself register as a power
management client, and then call fbdev's suspend/resume routines ? I
prefer the second solution as the fbdev's are often PCI devices (and so
already have the ability of having PCI suspend/resume hooks).

Another solution would be to have all fbdev's have it's own suspend/
resume hook (and maintain a "suspend" state that would tell fbdev to stop
calling them or start working on a memory based backup image), and
separately, fbdev's own suspend/resume (for the cursor, as it's not head-
dependant but rather global to all fbdev's).

Any comment ?

Ben.



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2001-03-21 22:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E14d6Ee-00009a-00@usw-sf-list1.sourceforge.net>
2001-03-14 13:17 ` [Linux-fbdev-devel] [RFC] fbdev & power management Benjamin Herrenschmidt
2001-03-14 13:39   ` Geert Uytterhoeven
2001-03-14 14:05     ` Benjamin Herrenschmidt
2001-03-14 14:51       ` Geert Uytterhoeven
2001-03-14 20:57     ` Brad Douglas
2001-03-21 17:02 James Simmons
2001-03-21 22:09 ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2001-03-14 21:30 James Simmons
2001-03-14 21:20 James Simmons
2001-03-15 11:31 ` Benjamin Herrenschmidt
2001-03-15 12:03   ` Geert Uytterhoeven
2001-03-14 20:48 James Simmons
2001-03-15  8:21 ` Geert Uytterhoeven
2001-03-13 21:25 Benjamin Herrenschmidt
2001-03-14  8:02 ` [Linux-fbdev-devel] " Brad Douglas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.