public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Thomas Winischhofer <thomas@winischhofer.net>
Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH] sisfb update 2.6.1
Date: Wed, 21 Jan 2004 16:03:09 -0800	[thread overview]
Message-ID: <20040121160309.2fd26f0a.akpm@osdl.org> (raw)
In-Reply-To: <400F0F8C.8070900@winischhofer.net>

Thomas Winischhofer <thomas@winischhofer.net> wrote:
>
> 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 <ak@muc.de>

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-removal drivers/video/sis/init.c
--- 25/drivers/video/sis/init.c~sis-DRM-floating-point-removal	Fri Jan  9 13:22:47 2004
+++ 25-akpm/drivers/video/sis/init.c	Fri Jan  9 13:22:47 2004
@@ -5165,7 +5165,8 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScr
    unsigned 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); */

_


  reply	other threads:[~2004-01-22  0:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-21 23:47 [PATCH] sisfb update 2.6.1 Thomas Winischhofer
2004-01-22  0:03 ` Andrew Morton [this message]
2004-01-22  8:56   ` Thomas Winischhofer
2004-01-22  9:23     ` Andrew Morton
2004-01-22 10:19       ` Thomas Winischhofer
2004-01-22 10:46         ` Andrew Morton

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=20040121160309.2fd26f0a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@winischhofer.net \
    --cc=torvalds@osdl.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