mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Miguel Ojeda" <maxextreme@gmail.com>
To: "Paulo Marques" <pmarques@grupopie.com>
Cc: Franck <vagabon.xyz@gmail.com>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.19-rc1 full] drivers: add LCD support
Date: Mon, 30 Oct 2006 15:11:21 +0100	[thread overview]
Message-ID: <653402b90610300611ucdc46d9y88f016800b498538@mail.gmail.com> (raw)
In-Reply-To: <4545FCB1.8030900@grupopie.com>

On 10/30/06, Paulo Marques <pmarques@grupopie.com> wrote:
> It is not *that* bad. If nothing has changed, the driver only pays the
> cost of a 1024 bytes memcmp. Even more, there are no current users for
> anything other than a PC, so I think we shouldn't overdesign at this point.
>

I really can't imagine a smartphone with a PC parallel port ;-)

> >   - All accesses to the device depend on the previous behaviour whereas
> >     write(), read() syscall could be synchrone and easier to use for
> >     fast writing of image sets. Actually the refresh stuff is really
> >     needed only if you mmap the device. And it seems not really used
> >     for now since it was broken on your last patch.
>
> That is not entirely true. If a user-space application misbehaves and
> starts writing faster than what can actually be seen, not having a fixed
> refresh rate means that your CPU will be *very* busy writing garbage
> that the user won't be able to see.
>
> A fixed refresh rate is a maximum CPU usage tunable that prevents
> applications (that are not aware that this is an external slow device)
> to write more than what they should.
>
> This can be improved, however.
>
> We could have the concept of a "dirty" buffer. Any write or nopage call
> would set the dirty flag and set a timer to refresh the display in one
> refresh period from now.
>
> When doing the actual refresh, the "dirty" flag would be cleared and the
> buffer unmapped.
>
> In this case, if nothing was ever written to the display, the CPU usage
> would be _zero_ (as it should), and it would work nicely with dynticks
> and such.
>

Hum, interesting. But what happens if...

1. For example, the userspace app maps the fb (nopage is called, dirty
flag set, timer created), and then the app doesn't use the fb. The
timer will refresh the LCD, without anything new to refresh, so we are
wasting CPU time. After refreshing, the driver clears the dirty flag
and unmap the buffer.

2. After some seconds, the userspace app decides to write the buffer.
As it is not mmaped anymore, it will simply get a segmentation fault,
right? AFAIK nopage() is not called again because we have destroyed
the mmapping information, and Linux can't know what are the nopage()
ops to call to.

3. We mmap the device, timer is created, we start writing to the
buffer, the timer calls our refreshing function but we didn't finish
filling the buffer with our information: The LCD will have only some
of the screen.

And so on, am I right?

Thanks,
       Miguel Ojeda

  reply	other threads:[~2006-10-30 14:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-13  2:32 Miguel Ojeda Sandonis
2006-10-13 12:43 ` Paulo Marques
2006-10-18 14:55 ` Franck Bui-Huu
2006-10-23  8:41   ` Franck Bui-Huu
2006-10-23 12:56     ` Miguel Ojeda
2006-10-23 15:35       ` Franck Bui-Huu
2006-10-23 16:21         ` Miguel Ojeda
2006-10-23 16:51           ` Franck Bui-Huu
2006-10-26 14:45             ` Miguel Ojeda
2006-10-27 20:08               ` Franck Bui-Huu
2006-10-27 20:38                 ` Miguel Ojeda
2006-10-30  8:43                   ` Franck Bui-Huu
2006-10-30 13:35                     ` Miguel Ojeda
2006-10-23 16:05       ` Franck Bui-Huu
2006-10-23 16:08         ` Miguel Ojeda
2006-10-23 17:15           ` Franck Bui-Huu
2006-10-26 14:55             ` Miguel Ojeda
2006-10-27 20:03               ` Franck Bui-Huu
2006-10-27 20:25                 ` Miguel Ojeda
2006-10-30  9:26                   ` Franck Bui-Huu
2006-10-30 13:22                     ` Paulo Marques
2006-10-30 14:11                       ` Miguel Ojeda [this message]
2006-10-30 15:21                         ` Paulo Marques
2006-10-30 17:32                           ` Miguel Ojeda
2006-10-30 20:45                             ` Paulo Marques
2006-10-31  8:10                       ` Franck Bui-Huu
2006-10-31 14:12                         ` Miguel Ojeda
2006-10-31 14:54                         ` Paulo Marques
2006-10-30 13:47                     ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=653402b90610300611ucdc46d9y88f016800b498538@mail.gmail.com \
    --to=maxextreme@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmarques@grupopie.com \
    --cc=vagabon.xyz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®