From: Paulo Marques <pmarques@grupopie.com>
To: Miguel Ojeda <maxextreme@gmail.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:21:52 +0000 [thread overview]
Message-ID: <45461890.2000007@grupopie.com> (raw)
In-Reply-To: <653402b90610300611ucdc46d9y88f016800b498538@mail.gmail.com>
Miguel Ojeda wrote:
>[...]
>> 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.
No, this is not the sequence I thought of at all. I don't remember the
exact API functions you need to call (I have to read LDD3 again ;), but
if the hardware supports it, there must be a way. The plan is something
like:
- at mmap time you return a pointer to something that is not actually
mapped, and do nothing else
- when userspace actually writes to that area, you get a page fault,
and nopage is called. At this point you map the page, and set the dirty
state. All other writes from userspace until the timer completes are
done without faulting.
- when the timer completes, you unmap the page so that the next access
will generate a fault again
As I said, I don't remember the exact details, but this should be doable.
--
Paulo Marques - www.grupopie.com
"The face of a child can say it all, especially the
mouth part of the face."
next prev parent reply other threads:[~2006-10-30 15:21 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
2006-10-30 14:11 ` Miguel Ojeda
2006-10-30 15:21 ` Paulo Marques [this message]
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=45461890.2000007@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