public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Franck <vagabon.xyz@gmail.com>
Cc: Miguel Ojeda <maxextreme@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 13:22:57 +0000	[thread overview]
Message-ID: <4545FCB1.8030900@grupopie.com> (raw)
In-Reply-To: <4545C52A.5010105@innova-card.com>

Franck Bui-Huu wrote:
> Miguel Ojeda wrote:
>> [...]
>> Anyway, an animation of 10 Hz wouldn't be fine at this
>> kind of LCDs, so it is pointless which the refresh rate of the driver
>> is, as it is not useful to display images as fast as the driver
>> refresh the LCD.
> 
> An application might want to display quickly a set of images, not for
> doing animations but rather displaying 'fake' greyscale images.

To do "fake" greyscale you would need to synchronize with the actual 
refresh of the controller or you will have very ugly aliasing artifacts.

Since there is no hardware interface to know when the controller is 
refreshing, I don't think this is one viable usage scenario.

>> Well, mmaping is the best option, as it is the easiest and the
>> fastest. Any use will be better using mmaping than doing synchrone
>> write(). Yes, many uses just need a write() call, but other uses would
>> need mmap.
> 
> That's true for devices which have a frame buffer. But it's not your
> case. You _emulate_ this behaviour and I can see big drawbacks to
> this design:
> 
>   - You need to keep synchrone your buffer and the display every
>     100ms. It makes your CPU busy even if nothing has been written in
>     LCD for a while. Futhermore this kind of display is likely to run
>     on embedded system where CPU speed can be less than 100MHz.

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.

>   - 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.

Anyway, I think that the driver is useful as is and fulfills its 
original goals: drive an LCD connected to a parelel port on a PC.

Since the actual userspace interface supports the suggested 
improvements, we can just merge now and improve it later to support 
different usage scenarios as they appear (or even before they appear).

-- 
Paulo Marques - www.grupopie.com

"The face of a child can say it all, especially the
mouth part of the face."

  reply	other threads:[~2006-10-30 13:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-13  2:32 [PATCH 2.6.19-rc1 full] drivers: add LCD support 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 [this message]
2006-10-30 14:11                       ` Miguel Ojeda
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=4545FCB1.8030900@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxextreme@gmail.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