From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ronald G Minnich To: <9fans@cse.psu.edu> Subject: Re: [9fans] shared memory In-Reply-To: <15685.9057.72875.389455@nanonic.hilbert.space> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Mon, 29 Jul 2002 07:56:57 -0600 Topicbox-Message-UUID: d5158eb8-eaca-11e9-9e20-41e7f4b1d025 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