9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] ugliness in vesa
Date: Tue, 14 Jul 2009 08:06:53 -0400	[thread overview]
Message-ID: <1a71e77003b3e1e72f9ae1d4f7a7fb1d@quanstro.net> (raw)
In-Reply-To: <7d3530220907132223o58711065w5a669c7fd0084e53@mail.gmail.com>

> I didn't seem to see any improvement after applying the mtrr patch...
> did you make any changes to the vganvidia file before compiling? I
> haven't looked at the 'pat' thing, I'll have to check that out.
>

for the pat business, i did:

/n/sources/plan9//sys/src/9/pc/vganvidia.c:371,377 - vganvidia.c:371,377
  		if(scr->storage <= scr->apsize)
  			nv.dmabase = (ulong*)((uchar*)scr->vaddr + scr->storage - 128*1024);
  		else{
- 			nv.dmabase = (void*)vmap(scr->paddr + scr->storage - 128*1024, 128*1024);
+ 			nv.dmabase = (void*)vmappat(scr->paddr + scr->storage - 128*1024, 128*1024, PATWT);
  			if(nv.dmabase == 0){
  				hwaccel = 0;
  				hwblank = 0;

a quick explainer.  the pat patch just keeps a look-aside
table of memory of special types.  any time the mmu
code is asked to map that memory, it is mapped with
the special type given.  this means that if you wanted
to, for example (the current interface is better than
this unless you want a user-space driver), map pci space
in a segment accessable from user space, you could do
this and you would get the proper NC memory type.

it's fun when the explination's longer than the code.

- erik



  reply	other threads:[~2009-07-14 12:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13 23:57 john
2009-07-14  2:42 ` erik quanstrom
2009-07-14  5:23   ` John Floren
2009-07-14 12:06     ` erik quanstrom [this message]
2009-07-14 16:03       ` John Floren
2009-07-14 16:10         ` erik quanstrom
2009-07-14 16:23           ` John Floren
2009-07-14 16:49             ` erik quanstrom
2009-07-14  4:42 ` lucio
2009-07-14  6:24 ` cinap_lenrek

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=1a71e77003b3e1e72f9ae1d4f7a7fb1d@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.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).