9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Lucio De Re <lucio@proxima.alt.za>
To: 9fans mailing list <9fans@cse.psu.edu>
Subject: [9fans] I hate Jim!
Date: Mon, 19 Jan 2004 20:46:39 +0200	[thread overview]
Message-ID: <20040119204639.Z25947@cackle.proxima.alt.za> (raw)

In fact, I don't!  I was looking for a catchy subject.

I have made a minute amount of progress with the SiS 550 AGP/VGA
controller, to the extent that I seem to be reflecting the aperture
location and size correctly (I have changed the size and it got
picked up correctly - the base didn't move, though, I wonder if it
ought to have).

Little did I know how many things are conspiring against even an
old programming hand like me getting a VGA driver working.

The SiS 550, according to the developer who produced the XFree86
driver I'm using as the documentation, is entirely undocumented.
SiS have supplied unfinished device drivers to the XFree86 project
and are almost actively denying access to their technical information.

That whinge out the way, I'm assuming that the following questions
will not turn out to be so SiS specific that no one will be able to
answer them.

In the XFree86 driver, I find the following snippet:

pSiS->IODBase = pScrn->domainIOBase;
/* We "patch" the PIOOffset inside vgaHW in order to force
 * the vgaHW module to use our relocated i/o ports.
 */
VGAHWPTR(pScrn)->PIOOffset = pSiS->IODBase + (pSiS->PciInfo->ioBase[2] & 0xFFFC) - 0x380;

I took the liberty of moving the first line closer to the point where
it is firstly significant for the sake of clarity (I wish the developer
had done it, took me a while to put the two sections of the code
together).

The 0x380 is clearly a magic number relating to VGA registers (primary
VGA?  or more global, even?): I note that the Plan 9 code uses it as
the base for the VGA registers.  The XFree86 driver uses offsets from
this, with some glaring inconsistencies.

What I totally fail to discover or understand, is the "domainIOBase".
I presume it is an XFree86 entity, but I can't easily find out how it
is established and used.  A nudge in the right direction will help, I
think.  Then, I suppose I have to accept as gospel truth that the I/O
ports get relocated.  Again, I can't fathom how that happens, or why,
or where.  Maybe one of you has seen analogous behaviour elsewhere and
can explain it.  Private mail is perfectly fine.  I keep hoping that
at the end of this exercise I'll be able to provide documentation that
will help in future attempts, but that may be a pipe dream.  If it
does happen, I'll be keen to include any suggestions from better
skilled developers in the final document, so please let me know if
that's OK with you.

Lastly, at least for the now, I have no idea what this MMIO thing is
all about.  I get hints that wondrous things can be done with it, but
I can't piece enough bits of usage either in the Plan 9 code or in the
SiS driver for XFree86 to indicate how to set it up or use it.  I feel
like I'm totally blind to some perfectly obvious facility.  Are there
any references that might help me understand this concept?  And how it
fits into the scheme of VGA management?

I get a very vague feeling that it involves being able to used queued
I/O as well, but I really have no clue.

Now, having made it clear that I really know extremely little about
the target jmk set me (I'm not sure I'm not the butt of a very
complex joke), let me confirm your scepticism by explaining how
far I got.

I can now type:

	echo type sis550 > /dev/vgactl

and get back:

	Looking for a SiS adapter
	Looking for some I/O details
	Probably vain quest for map tables
	PCI aperture sizes: 0xa1 => 8388608
	Aperture: at 0x90000000 - Size: 8388608

thereafter:

	cat /dev/vgactl

yields:

	type sis550
	blank time 30 idle 0 state on
	hwaccel on
	hwblank off
	panning off
	addr 0x90000000

I used Kenji's i81x driver as template, thank you, Kenji.  I'll refrain
from commenting on the XFree86 code, it's a gift horse.

Anyone wants to see the mess I'm trying to disentangle, shout and I'll
post it to my web site, I won't offer, it's really not anything to be
proud of.  Although the fact that my PCI configuration access (read)
functions actually worked first time after I discovered you have to
read four bytes at the time had me utterly amazed.

In short:  Help!

++L


             reply	other threads:[~2004-01-19 18:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-19 18:46 Lucio De Re [this message]
2004-01-19 19:09 ` Lucio De Re
2004-01-19 23:06   ` [9fans] General factotum questions Jack Johnson
2004-01-19 23:31     ` mirtchov

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=20040119204639.Z25947@cackle.proxima.alt.za \
    --to=lucio@proxima.alt.za \
    --cc=9fans@cse.psu.edu \
    /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).