9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ronald G Minnich <rminnich@lanl.gov>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] shared memory
Date: Mon, 29 Jul 2002 07:56:57 -0600	[thread overview]
Message-ID: <Pine.LNX.4.33.0207290751130.4551-100000@snaresland.acl.lanl.gov> (raw)
In-Reply-To: <15685.9057.72875.389455@nanonic.hilbert.space>

On Mon, 29 Jul 2002 paurea@gsyc.escet.urjc.es wrote:

> I am writing (or trying to :-)) the driver for the sis630 vga card. It
> uses shared memory, i.e. the video memory comes from the normal ram of
> the computer. At first it seemed to me I had to reserve memory for it
> like a dma buffer, but after looking more closely to the linux driver,
> it seems to me that something hardware is going on and that the memory
> is reserved some way by the bios works as normal video memory. Does
> anybody know how this should be treated?. Any pointers to info?.


sis 630 vga card? don't you mean a motherboard with an sis630 chipset?

Anyway, the sis630 integrated vga uses part of main memory for graphics
memory, called SMA (Shared Memory something). You have to see if it is
enabled (always true with normal bios)  and then see how big it is. Also
the SMA can be supplied by any of the DIMM slots.

Here is the linuxbios code for this.

/* find the device */
        if ((pcidev = pci_find_device(PCI_VENDOR_ID_SI,
PCI_DEVICE_ID_SI_630, NULL)) == NULL)
                return 0;

/* see which banks are enabledd */
        pci_read_config_byte(pcidev, SIS630_BANKENABLE, &dram_status);
        dimm_status = dram_status & 0x7;

/* see if shared memory with integrated vga is enabled */
        sma_enable = dram_status & 0x80;

/* see which dimm is being used for the shared memory */
        pci_read_config_byte(pcidev, SIS630_DIMM_LOCATION_FOR_SMA,
&sma_location);
        sma_location &= 0x03;


        /* compute Shared Menory Area (SMA) size in Mega Bytes */
        sma_size_bits = (dram_status >> 4) & 0x7;
        if (sma_size_bits > 5)
                // this is invalid!
                sma_size = 0;
        else {
                sma_size = (2 << sma_size_bits);
        }


at the end of this code fragment sma (an int) has the shared memory sized
in MB.

let me know if you get this going, we're interested here -- I have a fair
number of these motherboards.

ron



  reply	other threads:[~2002-07-29 13:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-29 11:13 paurea
2002-07-29 13:56 ` Ronald G Minnich [this message]
2002-07-29 13:59   ` Ronald G Minnich
2002-07-31 12:52 ` andrey mirtchovski
2003-09-12  8:33 [9fans] g++ okamoto
2003-09-12  8:43 ` [9fans] shared memory okamoto
2003-09-12  8:48   ` Geoff Collyer
2003-09-12  8:52     ` okamoto
2003-09-12  9:25       ` Geoff Collyer
2003-09-12  9:30         ` Charles Forsyth
2003-09-12 15:33           ` splite
2003-09-12 16:11         ` boyd, rounin
2003-09-12 12:12       ` David Presotto
2003-09-16  3:07         ` okamoto
2003-09-15 13:30           ` okamoto
2003-09-16  4:23           ` Russ Cox

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=Pine.LNX.4.33.0207290751130.4551-100000@snaresland.acl.lanl.gov \
    --to=rminnich@lanl.gov \
    --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).