* [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
@ 2008-04-22 1:26 Benjamin Herrenschmidt
2008-04-22 15:55 ` Christian Ehrhardt
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-22 1:26 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: linuxppc-dev, Andrew Morton, linux-kernel, adaplas
This fixes radeonfb to not truncate 64 bits resources on 32 bits
platforms. Unfortunately, there are still issues with addresses
returned to userspace via struct fb_fix_screeninfo. This will
have to be dealt with separately.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/video/aty/radeon_base.c | 4 ++--
drivers/video/aty/radeonfb.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
--- linux-work.orig/drivers/video/aty/radeon_base.c 2008-04-22 11:04:19.000000000 +1000
+++ linux-work/drivers/video/aty/radeon_base.c 2008-04-22 11:05:00.000000000 +1000
@@ -1886,7 +1886,7 @@ static int __devinit radeon_set_fbinfo (
info->screen_size = rinfo->mapped_vram;
/* Fill fix common fields */
strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
- info->fix.smem_start = rinfo->fb_base_phys;
+ info->fix.smem_start = (unsigned long)rinfo->fb_base_phys;
info->fix.smem_len = rinfo->video_ram;
info->fix.type = FB_TYPE_PACKED_PIXELS;
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
@@ -1894,7 +1894,7 @@ static int __devinit radeon_set_fbinfo (
info->fix.ypanstep = 1;
info->fix.ywrapstep = 0;
info->fix.type_aux = 0;
- info->fix.mmio_start = rinfo->mmio_base_phys;
+ info->fix.mmio_start = (unsigned long)rinfo->mmio_base_phys;
info->fix.mmio_len = RADEON_REGSIZE;
info->fix.accel = FB_ACCEL_ATI_RADEON;
Index: linux-work/drivers/video/aty/radeonfb.h
===================================================================
--- linux-work.orig/drivers/video/aty/radeonfb.h 2008-04-22 11:03:17.000000000 +1000
+++ linux-work/drivers/video/aty/radeonfb.h 2008-04-22 11:03:27.000000000 +1000
@@ -287,8 +287,8 @@ struct radeonfb_info {
char name[DEVICE_NAME_SIZE];
- unsigned long mmio_base_phys;
- unsigned long fb_base_phys;
+ resource_size_t mmio_base_phys;
+ resource_size_t fb_base_phys;
void __iomem *mmio_base;
void __iomem *fb_base;
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-22 1:26 [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs Benjamin Herrenschmidt
@ 2008-04-22 15:55 ` Christian Ehrhardt
2008-04-22 16:04 ` Michel Dänzer
2008-04-22 22:21 ` Benjamin Herrenschmidt
2009-01-08 10:20 ` Sergei Shtylyov
2009-01-08 10:26 ` Sergei Shtylyov
2 siblings, 2 replies; 10+ messages in thread
From: Christian Ehrhardt @ 2008-04-22 15:55 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-fbdev-devel, Hollis Blanchard, adaplas, linux-kernel,
linuxppc-dev, Andrew Morton, Detlev Zundel
Benjamin Herrenschmidt wrote:
> This fixes radeonfb to not truncate 64 bits resources on 32 bits
> platforms. Unfortunately, there are still issues with addresses
> returned to userspace via struct fb_fix_screeninfo. This will
> have to be dealt with separately.
Thanks for this patch Benjamin, I use it together with what we have discussed in the "pci issue - wrong detection of pci ressources" thread.
Unfortunately I now hit exactly that issue with fb_fix_screeninfo you describe.
For everyone the fb_fix_screeninfo has two "unsigned long" vars that need to strore a IO address.
This fails in my case with a 32bit powerpc system (=sizeof(long)=4) which has paddr >4Gb and actually it should affect any 32bit platform with paddr>4Gb.
You see it e.g. when you try to initialize X11, the x11 radeon driver issues a FBIOGET_FSCREENINFO ioctl and because our address is >4Gb it get's clobbered by that unsigned long in the fb_fix_screeninfo structure (the value comes from a resource_size_t variable which has the correct 64bit).
struct fb_fix_screeninfo {
char id[16]; /* identification string eg "TT Builtin" */
unsigned long smem_start; /* Start of frame buffer mem */
[...]
unsigned long mmio_start; /* Start of Memory Mapped I/O */
[...]
I tried the stupid solution to just change the fb_fix_screeninfo structure to resource_size_t, but that changes the size ioctl transports and would require awareness in the userspace applications using that ioctl.
The X11 & Framebuffer driver work on 64bit systems, so I think it's just an issue of not cutting that data down to 32bit when transporting it (has anyone already checked the x11 drivers, I hope they don't use unsigned long too).
I wanted to ask if there are any known workarounds atm that would allow me to use my X11 for now?
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-22 15:55 ` Christian Ehrhardt
@ 2008-04-22 16:04 ` Michel Dänzer
2008-04-22 22:21 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 10+ messages in thread
From: Michel Dänzer @ 2008-04-22 16:04 UTC (permalink / raw)
To: Christian Ehrhardt
Cc: linux-fbdev-devel, Hollis Blanchard, adaplas, linux-kernel,
linuxppc-dev, Andrew Morton, Detlev Zundel
On Tue, 2008-04-22 at 17:55 +0200, Christian Ehrhardt wrote:
>
> You see it e.g. when you try to initialize X11, the x11 radeon driver
> issues a FBIOGET_FSCREENINFO ioctl [...]
FWIW, current versions of the xf86-video-ati radeon driver no longer use
radeonfb for anything.
--
Earthling Michel Dänzer | http://tungstengraphics.com
Libre software enthusiast | Debian, X and DRI developer
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-22 15:55 ` Christian Ehrhardt
2008-04-22 16:04 ` Michel Dänzer
@ 2008-04-22 22:21 ` Benjamin Herrenschmidt
2008-04-23 9:32 ` [Linux-fbdev-devel] " Michel Dänzer
1 sibling, 1 reply; 10+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-22 22:21 UTC (permalink / raw)
To: Christian Ehrhardt
Cc: linux-fbdev-devel, Hollis Blanchard, adaplas, linux-kernel,
linuxppc-dev, Andrew Morton, Detlev Zundel
On Tue, 2008-04-22 at 17:55 +0200, Christian Ehrhardt wrote:
> I wanted to ask if there are any known workarounds atm that would
> allow me to use my X11 for now?
X is doing a mmap of /dev/mem instead of /dev/fb ?
You can normally map the fb mapping /dev/fb and then map the registers
using /dev/fb at an offset beyond the framebuffer (fix->smem_len).
If X is using /dev/mem instead, then it's being stupid and needs to be
fixed...
Cheers,
Ben.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Linux-fbdev-devel] [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-22 22:21 ` Benjamin Herrenschmidt
@ 2008-04-23 9:32 ` Michel Dänzer
2008-04-23 9:40 ` Benjamin Herrenschmidt
2008-04-23 9:57 ` David Miller
0 siblings, 2 replies; 10+ messages in thread
From: Michel Dänzer @ 2008-04-23 9:32 UTC (permalink / raw)
To: benh
Cc: linux-fbdev-devel, Hollis Blanchard, adaplas, linux-kernel,
linuxppc-dev, Andrew Morton, Detlev Zundel
On Wed, 2008-04-23 at 08:21 +1000, Benjamin Herrenschmidt wrote:
> On Tue, 2008-04-22 at 17:55 +0200, Christian Ehrhardt wrote:
> > I wanted to ask if there are any known workarounds atm that would
> > allow me to use my X11 for now?
>
> X is doing a mmap of /dev/mem instead of /dev/fb ?
>
> You can normally map the fb mapping /dev/fb and then map the registers
> using /dev/fb at an offset beyond the framebuffer (fix->smem_len).
>
> If X is using /dev/mem instead, then it's being stupid and needs to be
> fixed...
It's up to the driver, and again, the current radeon driver doesn't use
radeonfb at all anymore...
--
Earthling Michel Dänzer | http://tungstengraphics.com
Libre software enthusiast | Debian, X and DRI developer
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Linux-fbdev-devel] [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-23 9:32 ` [Linux-fbdev-devel] " Michel Dänzer
@ 2008-04-23 9:40 ` Benjamin Herrenschmidt
2008-04-23 9:57 ` David Miller
1 sibling, 0 replies; 10+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-23 9:40 UTC (permalink / raw)
To: Michel Dänzer
Cc: linux-fbdev-devel, Hollis Blanchard, adaplas, linux-kernel,
linuxppc-dev, Andrew Morton, Detlev Zundel
On Wed, 2008-04-23 at 11:32 +0200, Michel Dänzer wrote:
> > X is doing a mmap of /dev/mem instead of /dev/fb ?
> >
> > You can normally map the fb mapping /dev/fb and then map the
> registers
> > using /dev/fb at an offset beyond the framebuffer (fix->smem_len).
> >
> > If X is using /dev/mem instead, then it's being stupid and needs to
> be
> > fixed...
>
> It's up to the driver, and again, the current radeon driver doesn't
> use
> radeonfb at all anymore...
Right. And I'm happy to go fix what remains, don't get me wrong here :-)
We all know how stupid legacy code can be !
I'll try to get some patches to expose a new version of the structure
sometimes in the upcoming week or two (we'll see what time permits) and
then see about fixing X drivers that need fixing, though hopefully with
pci-rework being upstream now, that shouldn't be many.
The main issue is directfb. I hope they'll catch up with the new ioctls.
Ben.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Linux-fbdev-devel] [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-23 9:32 ` [Linux-fbdev-devel] " Michel Dänzer
2008-04-23 9:40 ` Benjamin Herrenschmidt
@ 2008-04-23 9:57 ` David Miller
2008-04-23 10:34 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 10+ messages in thread
From: David Miller @ 2008-04-23 9:57 UTC (permalink / raw)
To: michel
Cc: linux-fbdev-devel, hollisb, adaplas, linux-kernel, linuxppc-dev,
akpm, dzu
From: Michel D=E4nzer <michel@tungstengraphics.com>
Date: Wed, 23 Apr 2008 11:32:07 +0200
> On Wed, 2008-04-23 at 08:21 +1000, Benjamin Herrenschmidt wrote:
> > On Tue, 2008-04-22 at 17:55 +0200, Christian Ehrhardt wrote:
> > > I wanted to ask if there are any known workarounds atm that would=
> > > allow me to use my X11 for now?
> > =
> > X is doing a mmap of /dev/mem instead of /dev/fb ?
> > =
> > You can normally map the fb mapping /dev/fb and then map the regist=
ers
> > using /dev/fb at an offset beyond the framebuffer (fix->smem_len).
> > =
> > If X is using /dev/mem instead, then it's being stupid and needs to=
be
> > fixed...
> =
> It's up to the driver, and again, the current radeon driver doesn't u=
se
> radeonfb at all anymore...
The only portable thing is for X to use the PCI sysfs mmap() stuff,
which current Xorg servers using libpciaccess do.
I know because I'm typing this from a sparc64 using a Radeon
with current Xorg :-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Linux-fbdev-devel] [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-23 9:57 ` David Miller
@ 2008-04-23 10:34 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 10+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-23 10:34 UTC (permalink / raw)
To: David Miller
Cc: linux-fbdev-devel, adaplas, hollisb, linux-kernel, michel,
linuxppc-dev, akpm, dzu
On Wed, 2008-04-23 at 02:57 -0700, David Miller wrote:
> > It's up to the driver, and again, the current radeon driver doesn't
> use
> > radeonfb at all anymore...
>
> The only portable thing is for X to use the PCI sysfs mmap() stuff,
> which current Xorg servers using libpciaccess do.
>
> I know because I'm typing this from a sparc64 using a Radeon
> with current Xorg :-)
True :-) But I'd still like to fix the fb API for the sake of things
like directfb etc...
Ben.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-22 1:26 [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs Benjamin Herrenschmidt
2008-04-22 15:55 ` Christian Ehrhardt
@ 2009-01-08 10:20 ` Sergei Shtylyov
2009-01-08 10:26 ` Sergei Shtylyov
2 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2009-01-08 10:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev, Andrew Morton, linux-fbdev-devel, linux-kernel,
adaplas
Hello.
Benjamin Herrenschmidt wrote:
> This fixes radeonfb to not truncate 64 bits resources on 32 bits
> platforms. Unfortunately, there are still issues with addresses
> returned to userspace via struct fb_fix_screeninfo. This will
> have to be dealt with separately.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
I'm seeing that these 3 patch series (dating back to April) still
unapplied. Have everybody forgotten about them? I'd like to see them
finally applied.
> --- linux-work.orig/drivers/video/aty/radeon_base.c 2008-04-22 11:04:19.000000000 +1000
> +++ linux-work/drivers/video/aty/radeon_base.c 2008-04-22 11:05:00.000000000 +1000
> @@ -1886,7 +1886,7 @@ static int __devinit radeon_set_fbinfo (
> info->screen_size = rinfo->mapped_vram;
> /* Fill fix common fields */
> strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
> - info->fix.smem_start = rinfo->fb_base_phys;
> + info->fix.smem_start = (unsigned long)rinfo->fb_base_phys;
> info->fix.smem_len = rinfo->video_ram;
> info->fix.type = FB_TYPE_PACKED_PIXELS;
> info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
> @@ -1894,7 +1894,7 @@ static int __devinit radeon_set_fbinfo (
> info->fix.ypanstep = 1;
> info->fix.ywrapstep = 0;
> info->fix.type_aux = 0;
> - info->fix.mmio_start = rinfo->mmio_base_phys;
> + info->fix.mmio_start = (unsigned long)rinfo->mmio_base_phys;
> info->fix.mmio_len = RADEON_REGSIZE;
> info->fix.accel = FB_ACCEL_ATI_RADEON;
>
> Index: linux-work/drivers/video/aty/radeonfb.h
> ===================================================================
> --- linux-work.orig/drivers/video/aty/radeonfb.h 2008-04-22 11:03:17.000000000 +1000
> +++ linux-work/drivers/video/aty/radeonfb.h 2008-04-22 11:03:27.000000000 +1000
> @@ -287,8 +287,8 @@ struct radeonfb_info {
>
> char name[DEVICE_NAME_SIZE];
>
> - unsigned long mmio_base_phys;
> - unsigned long fb_base_phys;
> + resource_size_t mmio_base_phys;
> + resource_size_t fb_base_phys;
>
> void __iomem *mmio_base;
> void __iomem *fb_base;
WBR, Sergei
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
2008-04-22 1:26 [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs Benjamin Herrenschmidt
2008-04-22 15:55 ` Christian Ehrhardt
2009-01-08 10:20 ` Sergei Shtylyov
@ 2009-01-08 10:26 ` Sergei Shtylyov
2 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2009-01-08 10:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev, Andrew Morton, linux-fbdev-devel, linux-kernel,
adaplas
Hello.
Benjamin Herrenschmidt wrote:
> This fixes radeonfb to not truncate 64 bits resources on 32 bits
> platforms. Unfortunately, there are still issues with addresses
> returned to userspace via struct fb_fix_screeninfo. This will
> have to be dealt with separately.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
I'm seeing that this 3 patch series (dating back to April) still
unapplied. Have everybody forgotten about them? I'd like to see them
finally applied.
> --- linux-work.orig/drivers/video/aty/radeon_base.c 2008-04-22 11:04:19.000000000 +1000
> +++ linux-work/drivers/video/aty/radeon_base.c 2008-04-22 11:05:00.000000000 +1000
> @@ -1886,7 +1886,7 @@ static int __devinit radeon_set_fbinfo (
> info->screen_size = rinfo->mapped_vram;
> /* Fill fix common fields */
> strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
> - info->fix.smem_start = rinfo->fb_base_phys;
> + info->fix.smem_start = (unsigned long)rinfo->fb_base_phys;
> info->fix.smem_len = rinfo->video_ram;
> info->fix.type = FB_TYPE_PACKED_PIXELS;
> info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
> @@ -1894,7 +1894,7 @@ static int __devinit radeon_set_fbinfo (
> info->fix.ypanstep = 1;
> info->fix.ywrapstep = 0;
> info->fix.type_aux = 0;
> - info->fix.mmio_start = rinfo->mmio_base_phys;
> + info->fix.mmio_start = (unsigned long)rinfo->mmio_base_phys;
> info->fix.mmio_len = RADEON_REGSIZE;
> info->fix.accel = FB_ACCEL_ATI_RADEON;
>
> Index: linux-work/drivers/video/aty/radeonfb.h
> ===================================================================
> --- linux-work.orig/drivers/video/aty/radeonfb.h 2008-04-22 11:03:17.000000000 +1000
> +++ linux-work/drivers/video/aty/radeonfb.h 2008-04-22 11:03:27.000000000 +1000
> @@ -287,8 +287,8 @@ struct radeonfb_info {
>
> char name[DEVICE_NAME_SIZE];
>
> - unsigned long mmio_base_phys;
> - unsigned long fb_base_phys;
> + resource_size_t mmio_base_phys;
> + resource_size_t fb_base_phys;
>
> void __iomem *mmio_base;
> void __iomem *fb_base;
WBR, Sergei
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-01-08 10:52 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22 1:26 [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs Benjamin Herrenschmidt
2008-04-22 15:55 ` Christian Ehrhardt
2008-04-22 16:04 ` Michel Dänzer
2008-04-22 22:21 ` Benjamin Herrenschmidt
2008-04-23 9:32 ` [Linux-fbdev-devel] " Michel Dänzer
2008-04-23 9:40 ` Benjamin Herrenschmidt
2008-04-23 9:57 ` David Miller
2008-04-23 10:34 ` Benjamin Herrenschmidt
2009-01-08 10:20 ` Sergei Shtylyov
2009-01-08 10:26 ` Sergei Shtylyov
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).