Skip to contentSkip to conversation

x86_64 64bit kernel rivafb broke between 2.6.8.1 and linus bk as of today

DISCUSSION Andrew Walrond 3 participants 12 messages Nov 16, 2004 – Nov 18, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

Hi guys,

I just upgraded my kernel to linus latest bk head, booting with a built in rivafb as usual, but I get a corrupted display.

2.6.8.1 worked just fine.

The two pengiun logos seem fine (but ontop of garbage), but the text is totally screwed and spread all over the screen in little chunks

Before I start hunting down the problem, has anybody got any ideas/fixes?

This is a 64bit kernel on a dual opteron system.

TIA

Andrew Walrond

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#1 lore raw
Quoted 7 lines · Andrew Walrond

Hi guys,

I just upgraded my kernel to linus latest bk head, booting with a built in rivafb as usual, but I get a corrupted display.

2.6.8.1 worked just fine.

2.6.9 is also fine. I'll try and narrow it down some more...

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#2 lore raw
In reply to Andrew Walrond

x>

Quoted 12 lines

I just upgraded my kernel to linus latest bk head, booting with a built in rivafb as usual, but I get a corrupted display.

2.6.8.1 worked just fine.

The two pengiun logos seem fine (but ontop of garbage), but the text is totally screwed and spread all over the screen in little chunks

Before I start hunting down the problem, has anybody got any ideas/fixes?

This is a 64bit kernel on a dual opteron system.

2.6.8.1 through to 2.6.10-rc1 work fine
2.6.10-rc2 is broken

I'll do some more digging tomorrow unless somebody knows what's up.

Andrew

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#3 lore raw
In reply to Andrew Walrond
Quoted 5 lines · Andrew Walrond

Hi guys,

I just upgraded my kernel to linus latest bk head, booting with a built in rivafb as usual, but I get a corrupted display.

Quoted 8 lines

2.6.8.1 worked just fine.

The two pengiun logos seem fine (but ontop of garbage), but the text is totally screwed and spread all over the screen in little chunks

Before I start hunting down the problem, has anybody got any ideas/fixes?

This is a 64bit kernel on a dual opteron system.

There was a bunch of IO access fixes in rivafb. Can you narrow it down to a particular function? Replace the following...

.fb_fillrect = rivafb_fillrect,
.fb_copyarea = rivafb_copyarea,
.fb_imageblit = rivafb_imageblit,
.fb_cursor = rivafb_cursor,

..with:

.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_cursor = soft_cursor,

And make sure that 'info->pixmap.scan_align = 4' if using rivafb_imageblit and 'info->pixmap.scan_align = 1' if using cfb_imageblit. (The scan alignment is adjusted in rivafb_set_par() and riva_set_fbinfo()).

Using the soft drawing functions (cfb_*), in theory, should always produce a working console. Then just bring back the rivafb_* functions one by one.

Tony

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#4 lore raw
Quoted 16 lines · Antonino A. Daplas

There was a bunch of IO access fixes in rivafb. Can you narrow it down to a particular function? Replace the following...

.fb_fillrect = rivafb_fillrect,
.fb_copyarea = rivafb_copyarea,
.fb_imageblit = rivafb_imageblit,
.fb_cursor = rivafb_cursor,

..with:

.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_cursor = soft_cursor,

Quoted 7 lines

And make sure that 'info->pixmap.scan_align = 4' if using rivafb_imageblit and 'info->pixmap.scan_align = 1' if using cfb_imageblit. (The scan alignment is adjusted in rivafb_set_par() and riva_set_fbinfo()).

Using the soft drawing functions (cfb_*), in theory, should always produce a working console. Then just bring back the rivafb_* functions one by one.

Ok, it works using all the soft functions. I'll swap them out now...

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#5 lore raw
Quoted 5 lines · Andrew Walrond
Quoted 4 lines · Antonino A. Daplas

There was a bunch of IO access fixes in rivafb. Can you narrow it down to a particular function? Replace the following...

.fb_fillrect = rivafb_fillrect,

Broken.

Quoted 1 line
Quoted 1 line

.fb_copyarea = rivafb_copyarea,

seems ok

Quoted 1 line
Quoted 1 line

.fb_imageblit = rivafb_imageblit,

broken.

Quoted 1 line
Quoted 1 line

.fb_cursor = rivafb_cursor,

doesn't cause any problems, but I'm not using a mouse on the console, so I probably wouldn't notice?

Andrew

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#6 lore raw
Quoted 13 lines · Andrew Walrond
Quoted 5 lines · Andrew Walrond
Quoted 4 lines · Antonino A. Daplas

There was a bunch of IO access fixes in rivafb. Can you narrow it down to a particular function? Replace the following...

.fb_fillrect = rivafb_fillrect,

Broken.

Quoted 1 line
Quoted 1 line

.fb_copyarea = rivafb_copyarea,

seems ok

Quoted 8 lines
Quoted 1 line
Quoted 1 line

.fb_imageblit = rivafb_imageblit,

broken.

Quoted 1 line
Quoted 1 line

.fb_cursor = rivafb_cursor,

doesn't cause any problems, but I'm not using a mouse on the console, so I probably wouldn't notice?

It's used for the text cursor, so you're definitely using it.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#7 lore raw
Quoted 3 lines · Geert Uytterhoeven

It's used for the text cursor, so you're definitely using it.

Ah Ok.

I'm developing a fb application so I'd like to get this fixed. Any insights/clues, before I start digging? As I said, it broke between rc1 and rc2, so I guess I can narrow it down to a particular cset and work it from there if nobody has any better ideas.

Andrew

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#8 lore raw
In reply to Andrew Walrond
Quoted 9 lines · Andrew Walrond
Quoted 5 lines · Andrew Walrond
Quoted 4 lines · Antonino A. Daplas

There was a bunch of IO access fixes in rivafb. Can you narrow it down to a particular function? Replace the following...

.fb_fillrect = rivafb_fillrect,

Broken.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

.fb_copyarea = rivafb_copyarea,

seems ok

Quoted 1 line
Quoted 1 line

.fb_imageblit = rivafb_imageblit,

broken.

I was suspecting imageblit, I never suspected fillrect. Anyway, can you try the 2 patches attached. The first patch reverts io access to the old method (direct pointer loading/reading and forced alignment) and the second uses __raw_{read|write} but forces alignment. You need to reverse the previous patch before applying the other.

If none of the patches work, it will entail more work. Revert the following functions to linux-2.6.10-rc1, in the given order and preferrably one at a time.

riva_set_pattern()
riva_set_rop_solid()
riva_setup_accel()
rivafb_imageblit()
rivafb_fillrect()

Tony

drivers/video/riva/riva_hw.h +13 -10
diff -Nru a/drivers/video/riva/riva_hw.h b/drivers/video/riva/riva_hw.h
@@ -73,17 +73,20 @@
 /*
  * HW access macros.
  */
+#if defined(__powerpc__)
 #include <asm/io.h>
-
-#define NV_WR08(p,i,d)  (__raw_writeb((d), (void __iomem *)(p) + (i)))
-#define NV_RD08(p,i)    (__raw_readb((void __iomem *)(p) + (i)))
-#define NV_WR16(p,i,d)  (__raw_writew((d), (void __iomem *)(p) + (i)))
-#define NV_RD16(p,i)    (__raw_readw((void __iomem *)(p) + (i)))
-#define NV_WR32(p,i,d)  (__raw_writel((d), (void __iomem *)(p) + (i)))
-#define NV_RD32(p,i)    (__raw_readl((void __iomem *)(p) + (i)))
-
-#define VGA_WR08(p,i,d) (writeb((d), (void __iomem *)(p) + (i)))
-#define VGA_RD08(p,i)   (readb((void __iomem *)(p) + (i)))
+#define NV_WR08(p,i,d)	out_8(p+i, d)
+#define NV_RD08(p,i)	in_8(p+i)
+#else
+#define NV_WR08(p,i,d)  (((U008 *)(p))[i]=(d))
+#define NV_RD08(p,i)    (((U008 *)(p))[i])
+#endif
+#define NV_WR16(p,i,d)  (((U016 *)(p))[(i)/2]=(d))
+#define NV_RD16(p,i)    (((U016 *)(p))[(i)/2])
+#define NV_WR32(p,i,d)  (((U032 *)(p))[(i)/4]=(d))
+#define NV_RD32(p,i)    (((U032 *)(p))[(i)/4])
+#define VGA_WR08(p,i,d) NV_WR08(p,i,d)
+#define VGA_RD08(p,i)   NV_RD08(p,i)
 
 /*
  * Define different architectures.
drivers/video/riva/riva_hw.h +6 -6
diff -Nru a/drivers/video/riva/riva_hw.h b/drivers/video/riva/riva_hw.h
@@ -75,12 +75,12 @@
  */
 #include <asm/io.h>
 
-#define NV_WR08(p,i,d)  (__raw_writeb((d), (void __iomem *)(p) + (i)))
-#define NV_RD08(p,i)    (__raw_readb((void __iomem *)(p) + (i)))
-#define NV_WR16(p,i,d)  (__raw_writew((d), (void __iomem *)(p) + (i)))
-#define NV_RD16(p,i)    (__raw_readw((void __iomem *)(p) + (i)))
-#define NV_WR32(p,i,d)  (__raw_writel((d), (void __iomem *)(p) + (i)))
-#define NV_RD32(p,i)    (__raw_readl((void __iomem *)(p) + (i)))
+#define NV_WR08(p,i,d)  (__raw_writeb((d), (u8 __iomem *)(p) + (i)))
+#define NV_RD08(p,i)    (__raw_readb((u8 __iomem *)(p) + (i)))
+#define NV_WR16(p,i,d)  (__raw_writew((d), (u16 __iomem *)(p) + (i)/2))
+#define NV_RD16(p,i)    (__raw_readw((u16 __iomem *)(p) + (i)/2))
+#define NV_WR32(p,i,d)  (__raw_writel((d), (u32 __iomem *)(p) + (i)/4))
+#define NV_RD32(p,i)    (__raw_readl((u32 __iomem *)(p) + (i)/4))
 
 #define VGA_WR08(p,i,d) (writeb((d), (void __iomem *)(p) + (i)))
 #define VGA_RD08(p,i)   (readb((void __iomem *)(p) + (i)))
#9 lore raw
Quoted 9 lines · Antonino A. Daplas
Quoted 2 lines · Andrew Walrond
Quoted 1 line · Andrew Walrond

On Wednesday 17 Nov 2004 00:15, Antonino A. Daplas wrote:

I was suspecting imageblit, I never suspected fillrect. Anyway, can you try the 2 patches attached. The first patch reverts io access to the old method (direct pointer loading/reading and forced alignment) and the second uses __raw_{read|write} but forces alignment. You need to reverse the previous patch before applying the other.

Umm, forget about the first patch, just apply the second patch.

Thanks.

Tony

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#10 lore raw
Quoted 3 lines · Antonino A. Daplas

Umm, forget about the first patch, just apply the second patch.

Absolutely no change I'm afraid.

You want me to try reverting the functions you mentioned?

Andrew

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#11 lore raw
Quoted 7 lines · Andrew Walrond
Quoted 1 line · Antonino A. Daplas

Umm, forget about the first patch, just apply the second patch.

Absolutely no change I'm afraid.

You want me to try reverting the functions you mentioned?

Try the patch that reverts the "burst" code, and if that does not work, then yes, you might have to revert.

Tony

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8