From: Eric Anholt <eric@anholt.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Airlie <airlied@linux.ie>,
linuxppc-dev@ozlabs.org, dri-devel@lists.sf.net
Subject: Re: [PATCH 3/3] drm: Make drm_local_map use a resource_size_t offset
Date: Mon, 02 Feb 2009 13:01:04 -0800 [thread overview]
Message-ID: <1233608464.4932.15.camel@gaiman> (raw)
In-Reply-To: <20090202055559.8D600DDF51@ozlabs.org>
[-- Attachment #1: Type: text/plain, Size: 2805 bytes --]
On Mon, 2009-02-02 at 16:55 +1100, Benjamin Herrenschmidt wrote:
> This changes drm_local_map to use a resource_size for its "offset"
> member instead of an unsigned long, thus allowing 32-bit machines
> with a >32-bit physical address space to be able to store there
> their register or framebuffer addresses when those are above 4G,
> such as when using a PCI video card on a recent AMCC 440 SoC.
>
> This patch isn't as "trivial" as it sounds: A few functions needed
> to have some unsigned long/int changed to resource_size_t and a few
> printk's had to be adjusted.
>
> But also, because userspace isn't capable of passing such offsets,
> I had to modify drm_find_matching_map() to ignore the offset passed
> in for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS.
>
> If we ever support multiple _DRM_FRAMEBUFFER or _DRM_REGISTERS maps
> for a given device, we might have to change that trick, but I don't
> think that happens on any current driver.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Just one little comment I think then I'd be happy:
> ---
>
> drivers/gpu/drm/drm_bufs.c | 33 ++++++++++++++++++++++++---------
> drivers/gpu/drm/drm_proc.c | 4 ++--
> drivers/gpu/drm/drm_vm.c | 22 ++++++++++++----------
> drivers/gpu/drm/mga/mga_dma.c | 17 +++++++++--------
> drivers/gpu/drm/mga/mga_drv.h | 4 ++--
> drivers/gpu/drm/r128/r128_cce.c | 7 ++++---
> drivers/gpu/drm/radeon/radeon_cp.c | 9 +++++----
> include/drm/drmP.h | 12 ++++++------
> 8 files changed, 64 insertions(+), 44 deletions(-)
>
> --- linux-work.orig/drivers/gpu/drm/drm_bufs.c 2009-02-02 16:29:54.000000000 +1100
> +++ linux-work/drivers/gpu/drm/drm_bufs.c 2009-02-02 16:29:54.000000000 +1100
> @@ -54,11 +54,25 @@ static struct drm_map_list *drm_find_mat
> {
> struct drm_map_list *entry;
> list_for_each_entry(entry, &dev->maplist, head) {
> - if (entry->map && (entry->master == dev->primary->master) && (map->type == entry->map->type) &&
> - ((entry->map->offset == map->offset) ||
> - ((map->type == _DRM_SHM) && (map->flags&_DRM_CONTAINS_LOCK)))) {
> + /* Due to userspace API breakage, we ignore the map offset
> + * for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS
> + */
Could this comment instead be maybe:
Because the kernel-userspace ABI is fixed at a 32-bit offset, while PCI
resources may live above that, we ignore the map offset for maps of type
_DRM_FRAMEBUFFER or _DRM_REGISTERS. It is assumed that each driver will
have only one resource of each type.
(I want to remember later what exact ABI problem was in question)
--
Eric Anholt
eric@anholt.net eric.anholt@intel.com
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-02-02 21:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-02 5:55 [PATCH 3/3] drm: Make drm_local_map use a resource_size_t offset Benjamin Herrenschmidt
2009-02-02 21:01 ` Eric Anholt [this message]
2009-02-02 21:21 ` Benjamin Herrenschmidt
2009-02-03 8:39 ` Dave Airlie
2009-02-03 9:02 ` Benjamin Herrenschmidt
2009-02-03 9:06 ` Dave Airlie
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=1233608464.4932.15.camel@gaiman \
--to=eric@anholt.net \
--cc=airlied@linux.ie \
--cc=benh@kernel.crashing.org \
--cc=dri-devel@lists.sf.net \
--cc=linuxppc-dev@ozlabs.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).