From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Samsung S3C6410 mainline merge coordination
Date: Thu, 3 Sep 2009 11:34:21 +0100 [thread overview]
Message-ID: <20090903103421.GA9507@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20090903095142.GB3302@digital-scurf.org>
On Thu, Sep 03, 2009 at 10:51:42AM +0100, Daniel Silverstone wrote:
> Basically the expectation appears to be that userland wishing to use
> acceleration features of a framebuffer device (such as the multiple planes,
> hardware cursor support, hardware bitblt etc which an SoC or graphics chip
> might implement) is expected to do it for itself by knowing which bit of
> physical memory to mmap() and fiddle, underneath and behind-the-back-of the
> kernel.
Not quite. The FB API provides a method to map the hardware registers
in a well defined way:
- read the fb_fix_screeninfo structure via the FBIOGET_FSCREENINFO ioctl.
This gives you the size of the video memory (smem_len) and the size of
the MMIO registers (mmio_len). It also tells you what kind of device
is there (accel).
- mmap using an offset of smem_len and a length of mmio_len.
This gives you a mapping for the hardware registers independent of the
actual physical address location.
There is protection built in here to prevent userspace having access to
the hardware registers while the kernel wants to access them - you can
only mmap the MMIO registers provided var.accel_flags is zero (in other
words, you've asked the kernel _not_ to use any hardware acceleration.)
To put it another way, your driver must not use hardware acceleration
for the FB console if var.accel_flags is zero.
So, really, there's no "fiddling behind the back of the kernel" if things
are done correctly, and there's no need to know where the registers
actually appear in the physical space - which was required in the old
days of mapping them via /dev/mem.
Yes, it's unfortunate that the acceleration functions themselves are not
available to userspace, but I don't think the situation is as bad as
you're making it out to be.
next prev parent reply other threads:[~2009-09-03 10:34 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-02 3:17 Samsung S3C6410 mainline merge coordination Harald Welte
2009-09-02 9:51 ` Nelson Castillo
2009-09-02 12:15 ` Harald Welte
2009-09-02 15:58 ` Nelson Castillo
2009-09-02 10:05 ` Mark Brown
2009-09-02 12:11 ` Harald Welte
2009-09-02 13:44 ` jassi brar
2009-09-02 14:47 ` Mark Brown
2009-09-03 0:38 ` jassi brar
2009-09-03 12:14 ` Mark Brown
2009-09-03 13:39 ` jassi brar
2009-09-03 15:18 ` Mark Brown
2009-09-04 1:08 ` jassi brar
2009-09-04 13:41 ` Mark Brown
2009-09-04 14:27 ` jassi brar
2009-09-04 14:57 ` Mark Brown
2009-09-04 1:27 ` Samsung SoC ASOC drivers Harald Welte
2009-09-04 4:10 ` jassi brar
2009-09-02 19:09 ` Samsung S3C6410 mainline merge coordination Ben Dooks
2009-09-03 0:21 ` Joonyoung Shim
2009-09-03 11:06 ` Mark Brown
2009-09-03 12:48 ` Joonyoung Shim
2009-09-02 13:45 ` Mark Brown
2009-09-02 19:22 ` Ben Dooks
[not found] ` <19987914.1168001251884594226.JavaMail.coremail@bj126app54.126.com>
2009-09-02 12:01 ` Harald Welte
2009-09-02 19:10 ` Ben Dooks
2009-09-02 22:26 ` Harald Welte
2009-09-03 9:51 ` Daniel Silverstone
2009-09-03 10:34 ` Russell King - ARM Linux [this message]
2009-09-03 10:40 ` Daniel Silverstone
2009-09-04 5:48 ` Pavel Machek
2009-09-02 12:03 ` David F. Carlson
2009-09-02 12:46 ` Peter Korsgaard
2009-09-02 19:16 ` Ben Dooks
2009-09-03 1:56 ` Harald Welte
2009-09-03 10:04 ` Peter Korsgaard
2009-09-03 10:57 ` Mark Brown
[not found] ` <7641737.122161251944382753.JavaMail.coremail@bj126app17.126.com>
2009-09-03 4:31 ` Harald Welte
2009-09-10 5:49 ` Samsung S3C6410 / SmartQ / 2D acceleration / Xorg Harald Welte
2009-09-15 23:34 ` Ben Dooks
2009-09-15 9:49 ` Samsung S3C6410 / SmartQ / 2D acceleration / Xorgy David F. Carlson
2009-09-02 12:49 ` Samsung S3C6410 mainline merge coordination Peter Korsgaard
2009-09-02 22:30 ` Harald Welte
2009-09-02 16:12 ` Ben Dooks
2009-09-02 21:25 ` David F. Carlson
2009-09-02 23:18 ` Harald Welte
2009-09-03 3:31 ` Bill Gatliff
2009-09-03 3:38 ` Nelson Castillo
2009-09-03 4:33 ` Harald Welte
2009-09-04 7:15 ` Nelson Castillo
2009-09-02 16:58 ` Mark Brown
[not found] <23992600.419641251935757361.JavaMail.weblogic@epml11>
2009-09-03 0:46 ` Harald Welte
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=20090903103421.GA9507@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).