linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kronos <kronos@kronoz.cjb.net>
To: James Simmons <jsimmons@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Jon Smirl <jonsmirl@yahoo.com>,
	Linux Fbdev development list
	<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: Re: New radeonfb, mostly untested
Date: Sun, 14 Sep 2003 19:31:37 +0200	[thread overview]
Message-ID: <20030914173137.GA2971@dreamland.darkstar.lan> (raw)
In-Reply-To: <Pine.LNX.4.44.0309122317180.5017-100000@phoenix.infradead.org>

Il Fri, Sep 12, 2003 at 11:20:13PM +0100, James Simmons ha scritto: 
> > Also, modes  from fb_get_mode  are different from  XFree modes  so every
> > time I switch from console to X I have to re-center the screen.
> > 
> > This happens only when modedb is created from edid, not when using the
> > standard modedb.
> > 
> > Currently create_modedb is unused (the new radeon driver is the first
> > user of edid stuff) so we may be hitting a real bug.
> 
> Sounds like bugs in the code. The code was never tested before.

Look at this:

bc 1.05
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation,
Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
xres=1280
yres=1024
refresh=60
hactive=xres
vactive=yres
vfreq=refresh
divisor = (1000000 - (vfreq * 550))/1000
hfreq = (yres + 1) * vfreq  * 1000;
hfreq=hfreq/divisor
c_val = (((40-20) * 128)/256 + 20)*1000
m_val = (128 * 600)/256
m_val = (m_val * 1000000)/hfreq;
duty_cycle = c_val - m_val;
hblank = (xres * duty_cycle)/(100000 - duty_cycle);
htotal = hactive+hblank
hsync_len = (htotal * 8)/100
hsync_len
137
hblank
433
duty_cycle
25283

hsync_len should be 112, so:

htotal = (112 * 100)/8
htotal
1400
hblank = htotal - hactive
hblank
120
duty_cycle = (hblank*100000 - xres)/(hblank + 1)
duty_cycle
99162

duty_cycle calculated by from fb_get_hblank_by_hfreq) is 25283
duty_cycle reversed from EDID detailed timing is 99162

I just downloaded GTF_V1R1.xls from vesa.org, now I'm downloading
gnumeric...

Until we find the bug we can change calc_mode_timings in this way:

void calc_mode_timings(int xres, int yres, int refresh, struct fb_videomode *mode)
{
        int dbsize = sizeof(modedb)/sizeof(modedb[0]);
        struct fb_videomode *cur;
        int i;

        for (i = 0; i < dbsize; i++) {
                cur = &modedb[i];

                if (cur->xres == xres && cur->yres == yres &&
                                     cur->refreh == refresh) {
                        /* Yeah */
                        mode->xres = xres;
                        mode->yres = yres;
                        mode->pixclock = cur->pixclock;
                        mode->refresh = refresh;
                        mode->left_margin = cur->left_margin;
                        mode->right_margin = cur->right_margin;
                        mode->upper_margin = cur->upper_margin;
                        mode->lower_margin = cur->lower_margin;
                        mode->hsync_len = cur->hsync_len;
                        mode->vsync_len = cur->vsync_len;
                        mode->vmode = cur->vmode;
                        mode->sync = cur->sync;

                        return;
                }
        }

        BUG();
}

Luca
-- 
Reply-To: kronos@kronoz.cjb.net
Home: http://kronoz.cjb.net
Not an editor command: Wq


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  parent reply	other threads:[~2003-09-14 17:33 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-07 16:37 New radeonfb, mostly untested Benjamin Herrenschmidt
2003-09-07 17:48 ` Kronos
2003-09-07 18:23   ` Benjamin Herrenschmidt
2003-09-07 18:43     ` Kronos
2003-09-07 18:49       ` Benjamin Herrenschmidt
2003-09-09 17:18         ` James Simmons
2003-09-09 17:54           ` Kronos
2003-09-09 18:13             ` Benjamin Herrenschmidt
2003-09-09 19:24               ` Kronos
2003-09-09 19:37                 ` Benjamin Herrenschmidt
2003-09-09 20:45                   ` Kronos
2003-09-09 21:07                     ` Benjamin Herrenschmidt
2003-09-09 21:52                       ` Kronos
2003-09-09 22:08                         ` Kronos
2003-09-12 17:44                           ` James Simmons
2003-09-12 17:48                     ` James Simmons
2003-09-12 22:47                       ` Kronos
2003-09-09 20:59                   ` Geert Uytterhoeven
2003-09-12 17:46                     ` James Simmons
2003-09-07 23:03 ` Kronos
2003-09-08  6:06   ` Benjamin Herrenschmidt
2003-09-08 19:05     ` Kronos
2003-09-10 16:41       ` Kronos
2003-09-10 16:48         ` Benjamin Herrenschmidt
2003-09-10 17:46           ` Kronos
2003-09-10 17:50             ` Benjamin Herrenschmidt
2003-09-10 18:41               ` Kronos
2003-09-10 21:27               ` Kronos
2003-09-10 21:32                 ` Benjamin Herrenschmidt
2003-09-12 17:43                   ` James Simmons
2003-09-12 19:36                     ` Kronos
2003-09-12 22:20                       ` James Simmons
2003-09-12 22:45                         ` Kronos
2003-09-14 17:31                         ` Kronos [this message]
2003-09-14 17:46                           ` Benjamin Herrenschmidt
2003-09-14 18:59                             ` Kronos
2003-09-15  0:56                           ` Tony
2003-09-15 16:00                             ` Kronos
2003-09-14 23:59                 ` Tony
2003-09-15 15:55                   ` Kronos
2003-09-11  6:03           ` Geert Uytterhoeven
2003-09-11  6:38             ` Benjamin Herrenschmidt
2003-09-11  6:55               ` Geert Uytterhoeven
2003-09-11  7:05                 ` Benjamin Herrenschmidt
2003-09-12 17:25                   ` James Simmons

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=20030914173137.GA2971@dreamland.darkstar.lan \
    --to=kronos@kronoz.cjb.net \
    --cc=benh@kernel.crashing.org \
    --cc=jonsmirl@yahoo.com \
    --cc=jsimmons@infradead.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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).