[MPlayer-dev-eng] vidix - Rage 128 (radeon_vid.c): base2 size
Aurelien Jacobs
aurel at gnuage.org
Fri Mar 16 14:33:10 CET 2007
On Thu, 15 Mar 2007 00:38:10 +0100
"sustmi" <sustmidown at centrum.cz> wrote:
> Hello,
> First of all I don't know if I'm posting the patch in correct way, but I didn't
> want to spam bugzilla and I don't svn access.
> Recently I wanted to get work vidix even for non-root users.
> I have ATI AIW Rage 128.
> The problem was the gained error:
>
> So I have looked for the reason of this and found that 'mmap' function for
> 'base2' memory (registers I think) is called with length 0xFFFF (64k),
> but 'lspci -v' gives this:
>
> 01:00.0 VGA compatible controller: ATI Technologies Inc Rage 128 Pro Ultra TF (prog-if 00 [VGA])
> Subsystem: ATI Technologies Inc Rage 128 AIW Pro AGP
> Flags: bus master, stepping, 66MHz, medium devsel, latency 64, IRQ9
> Memory at e4000000 (32-bit, prefetchable) [size=64M]
> I/O ports at d000 [size=256]
> Memory at e9000000 (32-bit, non-prefetchable) [size=16K] <<<< HERE
> [virtual] Expansion ROM at e8000000 [disabled] [size=128K]
> Capabilities: [50] AGP version 2.0
> Capabilities: [5c] Power Management version 2
>
> Then I googled a little and I've realized that Rage128 has 16kB base2
> memory unlike Radeon's 64kB.
> So I did this patch and 'plötzlich' :) it works.
>
> (This 'bug' occurs only when using svgalib_helper for memory access, but
> when you don't use the helper you must have access to /dev/mem (root))
>
> --- vidix/drivers/radeon_vid.c 2007-03-14 22:37:42.000000000 +0100
> +++ vidix/drivers/radeon_vid.c.new 2007-03-15 00:26:42.000000000 +0100
> @@ -1142,7 +1142,11 @@
> printf(RADEON_MSG" Driver was not probed but is being initializing\n");
> return EINTR;
> }
> +#ifdef RAGE128
> + if((radeon_mmio_base = map_phys_mem(pci_info.base2,0x3FFF))==(void *)-1) return ENOMEM;
> +#else
> if((radeon_mmio_base = map_phys_mem(pci_info.base2,0xFFFF))==(void *)-1) return ENOMEM;
> +#endif
> radeon_ram_size = INREG(CONFIG_MEMSIZE);
> /* mem size is bits [28:0], mask off the rest. Range: from 1Mb up to 512 Mb */
> radeon_ram_size &= CONFIG_MEMSIZE_MASK;
> @@ -1256,7 +1260,11 @@
> #endif
>
> unmap_phys_mem(radeon_mem_base,radeon_ram_size);
> +#ifdef RAGE128
> + unmap_phys_mem(radeon_mmio_base,0x3FFF);
> +#else
> unmap_phys_mem(radeon_mmio_base,0xFFFF);
> +#endif
This looks a bit ugly. Instead you could write something like:
#ifdef RAGE128
# define MMIO_SIZE 0x3FFF
#else
# define MMIO_SIZE 0xFFFF
#endif
And use MMIO_SIZE in both places.
BTW, what's the status of internal vidix vs. vidix.sf.net ?
Should this patch be applied to both ?
Will mplayer switch to external vidix ?
Aurel
More information about the MPlayer-dev-eng
mailing list