[PATCH] xfree86: Add Loongson MIPS support

Alan Coopersmith alan.coopersmith at oracle.com
Wed Oct 12 07:48:00 PDT 2011


On 10/11/11 11:58 PM, Matt Kraai wrote:
> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41038
> ---
>   hw/xfree86/dri/sarea.h                  |    2 ++
>   hw/xfree86/os-support/linux/lnx_video.c |   20 ++++++++++++++++++--
>   2 files changed, 20 insertions(+), 2 deletions(-)
>
>   I asked the person that I received this patch from,
>   liushiwei at gmail.com, to certify the Developer's Certificate of
>   Origin.  They said that this patch was available under the GPL2+ and
>   was written by zhangfx at lemote.com.  The modified files are not
>   licensed under the GPL.  Do I need to ask them to relicense the
>   patch?

Yes. GPL licensed code will not be accepted into Xorg, only MIT/BSD licensed.

The patch itself needs work:

> +	extern unsigned int IOPortBase;

Don't add extern variable declarations in functions, especially ones already
defined in headers.

> +#elif defined(__mips__)
> +	fd = open("/dev/mem", O_RDWR);
> +	IOPortBase = (volatile unsigned char *)mmap(0, 0x20000,
> +			PROT_READ | PROT_WRITE, MAP_SHARED, fd,
> +			0x1fd00000);
> +	if (IOPortBase == MAP_FAILED) {
> +		xf86Msg(X_WARNING,
> +				"xf86EnableIOPorts: Failed to map iobase (%s)\n",
> +				strerror(errno));
> +		return FALSE;
> +	}
> +	close(fd);
> +	xf86Msg(X_WARNING,
> +	       "xf86EnableIOPorts: map iobase (%x)\n",
> +	        IOPortBase);

This is almost an exact copy of the existing powerpc code - is it really
necessary to duplicate it all instead of just doing something more like:

#if defined(__powerpc__)
	ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0);
#elif defined(__mips__)
	ioBase_phys = 0x1fd00000;
#endif

and then sharing the rest of the code?

[Not even compile tested of course since I have no MIPS systems.]

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list