sisfb update 2.6.1
PATCH 1/1 sisfb update 2.6.1
Update for SiS framebuffer driver for 2.6.1 vanilla
Since it does not seem as if the fbdev stuff gets merged anytime soon, I made this patch for 2.6.1 vanilla.
I slightly lost track of current patch size policy, so please excuse me if this is beyond current limits.
Anyway, sisfb is simply broken in current 2.6.x. This patch updates sisfb to the current development version which no less than 11 months ahead of the version in the kernel.
Updated includes
- many fixes (duh)
- support for new chipsets (661, 741, 760)
- support for new video bridges (301C, 302ELV)
- removal of all offending fp code (as discussed earlier this month)
- a lot of code clean-up (which is the main reason for its size)
Patch is here: http://www.winischhofer.net/sis/sisfb_patch_2.6.1.diff.gz
If I may say "pretty please"...?
Thomas
Signature · 4 lines
Thomas Winischhofer Vienna/Austria thomas AT winischhofer DOT net *** http://www.winischhofer.net/ twini AT xfree86 DOT org
Quoted 2 lines · Thomas Winischhofer
Update for SiS framebuffer driver for 2.6.1 vanilla
It still has floating point stuff in sis_init(). Could you please review, integrate and test the below patch?
After that we need to coordinate this with James and Ben who are also doing things in this area. But we wouldn't want to have to defer this SiS patch until everything is sorted out in the fbdev core - life is too short ;)
From: Andi Kleen <[email protected]>
Here's the matching patch from the SuSE 2.4 tree which also compiles with soft-float. No i haven't even checked if it applies to 2.6. But maybe it will help somebody fix the 2.6 driver.
---
25-akpm/drivers/video/sis/init.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-)
drivers/video/sis/init.c renamed from drivers/video/sis/init.c~sis-DRM-floating-point-removal +8 -7
@@ -5165,7 +5165,8 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrunsigned short HRE ,HBE ,HRS ,HBS ,HDE ,HT ;unsigned char sr_data, cr_data, cr_data2, cr_data3;unsigned char sr2b, sr2c; -float num, denum, postscalar, divider; +//float num, denum, postscalar, divider; +unsigned int num, denum, postscalar, divider;int A ,B ,C ,D ,E ,F , temp, i, j, index, vclkindex;DisplayModePtr new =NULL , current =NULL , first =NULL , backup =NULL ;
@@ -5230,19 +5231,19 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScr sr2b = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2B; sr2c = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2C; - divider = (sr2b &0x80 ) ?2.0 :1.0 ; + divider = (sr2b &0x80 ) ?2 :1 ; postscalar = (sr2c &0x80 ) ? - ( (((sr2c >>5 ) &0x03 ) ==0x02 ) ?6.0 :8.0 ) : (((sr2c >>5 ) &0x03 ) +1.0 ); - num = (sr2b &0x7f ) +1.0 ; - denum = (sr2c &0x1f ) +1.0 ; + ( (((sr2c >>5 ) &0x03 ) ==0x02 ) ?6 :8 ) : (((sr2c >>5 ) &0x03 ) +1 ); + num = (sr2b &0x7f ) +1 ; + denum = (sr2c &0x1f ) +1 ;#ifdef TWDEBUG xf86DrvMsg (0 ,X_INFO ,"------------\n" ); -xf86DrvMsg (0 ,X_INFO ,"sr2b: %x sr2c %x div %f ps %f num %f denum %f\n" , +xf86DrvMsg (0 ,X_INFO ,"sr2b: %x sr2c %x div %i ps %i num %i denum %i\n" , sr2b, sr2c, divider, postscalar, num, denum);#endif - current->Clock = (int )(14318 * (divider / postscalar) * (num / denum)); + current->Clock = (int )(14318 * divider / postscalar * num / denum); sr_data = pSiS->SiS_Pr->SiS_CRT1Table[index].CR[14 ];/* inSISIDXREG(SISSR, 0x0b, sr_data); */
_
Quoted 7 lines · Andrew Morton
Quoted 1 line · Thomas Winischhofer
Update for SiS framebuffer driver for 2.6.1 vanilla
It still has floating point stuff in
sis_init(). Could you please review, integrate and test the below patch?
sis_init()? You probably mean sis/init.c?
Anyway: Irrelevant. This code part isn't even being compiled for the linux kernel (See line 4304 - #ifdef LINUX_XF86).
(init.c and init301.c are universal modules for XFree86 and the Linux kernel; there are some lines of code which are unique to one of these, though. I will sort this out in the next release.)
Quoted 3 lines
After that we need to coordinate this with James and Ben who are also doing things in this area. But we wouldn't want to have to defer this SiS patch until everything is sorted out in the fbdev core - life is too short ;)
Exactly. I don't see any activity on the fvdevel list since a while back. Don't even know what the current status is.
Anyway, it required only to compiler directives to exclude the modifications needed by the current James-stuff. Shouldn't be too hard.
Thomas
Quoted 55 lines
From: Andi Kleen <[email protected]>
Here's the matching patch from the SuSE 2.4 tree which also compiles with soft-float. No i haven't even checked if it applies to 2.6. But maybe it will help somebody fix the 2.6 driver.
---
25-akpm/drivers/video/sis/init.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-)diff -puN
drivers/video/sis/init.c~sis-DRM-floating-point-removaldrivers/video/sis/init.cdrivers/video/sis/init.c renamed from drivers/video/sis/init.c~sis-DRM-floating-point-removal +8
-7@@ -5165,7 +5165,8 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrunsigned short HRE ,HBE ,HRS ,HBS ,HDE ,HT ;unsigned char sr_data, cr_data, cr_data2, cr_data3;unsigned char sr2b, sr2c; -float num, denum, postscalar, divider; +//float num, denum, postscalar, divider; +unsigned int num, denum, postscalar, divider;int A ,B ,C ,D ,E ,F , temp, i, j, index, vclkindex;DisplayModePtr new =NULL , current =NULL , first =NULL , backup =NULL ;@@ -5230,19 +5231,19 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScr sr2b = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2B; sr2c = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2C; - divider = (sr2b &0x80 ) ?2.0 :1.0 ; + divider = (sr2b &0x80 ) ?2 :1 ; postscalar = (sr2c &0x80 ) ? - ( (((sr2c >>5 ) &0x03 ) ==0x02 ) ?6.0 :8.0 ) : (((sr2c >>5 ) &0x03 ) +1.0 ); - num = (sr2b &0x7f ) +1.0 ; - denum = (sr2c &0x1f ) +1.0 ; + ( (((sr2c >>5 ) &0x03 ) ==0x02 ) ?6 :8 ) : (((sr2c >>5 ) &0x03 ) +1 ); + num = (sr2b &0x7f ) +1 ; + denum = (sr2c &0x1f ) +1 ;#ifdef TWDEBUG xf86DrvMsg (0 ,X_INFO ,"------------\n" ); -xf86DrvMsg (0 ,X_INFO ,"sr2b: %x sr2c %x div %f ps %f num %f denum %f\n" , +xf86DrvMsg (0 ,X_INFO ,"sr2b: %x sr2c %x div %i ps %i num %i denum %i\n" , sr2b, sr2c, divider, postscalar, num, denum);#endif - current->Clock = (int )(14318 * (divider / postscalar) * (num / denum)); + current->Clock = (int )(14318 * divider / postscalar * num / denum); sr_data = pSiS->SiS_Pr->SiS_CRT1Table[index].CR[14 ];/* inSISIDXREG(SISSR, 0x0b, sr_data); */ _
Signature · 4 lines
Thomas Winischhofer Vienna/Austria thomas AT winischhofer DOT net *** http://www.winischhofer.net/ twini AT xfree86 DOT org
Quoted 8 lines · Thomas Winischhofer
Quoted 3 lines
It still has floating point stuff in
sis_init(). Could you please review, integrate and test the below patch?
sis_init()? You probably meansis/init.c?Anyway: Irrelevant. This code part isn't even being compiled for the linux kernel (See line 4304 - #ifdef
LINUX_XF86).
Well darn, that patch fixed the wrong bit and we still have float in there. allmodconfig doesn't pick this up.
drivers/built-in.o: In function `sisfb_do_set_var':
//drivers/video/sis/sis_main.c:654: undefined reference to `__floatsidf'
...drivers/built-in.o: In function `sisfb_init':
//drivers/video/sis/sis_main.c:4450: undefined reference to `__floatsidf'
Search for "1E12" in sis_main.c
Here's the patch which adds -msoft-float to the kernel build, which picks up these things.
arch/i386/Makefile renamed from arch/i386/Makefile~use-soft-float +1 -1
@@ -19,7 +19,7 @@ LDFLAGS := -m elf_i386 OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := -CFLAGS += -pipe +CFLAGS += -pipe -msoft-float # prevent gcc from keeping the stack 16 byte aligned CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,)
_
Quoted 5 lines · Andrew Morton
Well darn, that patch fixed the wrong bit and we still have float in there. allmodconfig doesn't pick this up.
Quoted 7 lines
drivers/built-in.o: In function `sisfb_do_set_var':
//drivers/video/sis/sis_main.c:654: undefined reference to `__floatsidf'
...drivers/built-in.o: In function `sisfb_init':
//drivers/video/sis/sis_main.c:4450: undefined reference to `__floatsidf'Search for "1E12" in
sis_main.c
I did. "Not found."
Compiles and links wonderfully here.... erm yes, WITH mfloat.
Search for "1000000000" in sis_main.c. If you don't find this, you didn't apply the patch ;)
With what value is "VER_LEVEL" in sis_main.h #defined? Should be 25.
Me confused....
Thomas
Signature · 4 lines
Thomas Winischhofer Vienna/Austria thomas AT winischhofer DOT net *** http://www.winischhofer.net/ twini AT xfree86 DOT org
Quoted 14 lines · Thomas Winischhofer
Quoted 11 lines · Andrew Morton
Well darn, that patch fixed the wrong bit and we still have float in there. allmodconfig doesn't pick this up.
drivers/built-in.o: In function `sisfb_do_set_var':
//drivers/video/sis/sis_main.c:654: undefined reference to `__floatsidf'
...drivers/built-in.o: In function `sisfb_init':
//drivers/video/sis/sis_main.c:4450: undefined reference to `__floatsidf'
Quoted 4 lines
Quoted 1 line
Search for "1E12" in
sis_main.cI did. "Not found."
Ah OK, so you fixed it. Doh.