Discussion:
xf86-video-sis changes for mips
Manuel Bouyer
2014-01-26 21:59:18 UTC
Permalink
[ I'm not subscribed to tech-x11, so please keep either me or port-mips in Cc ]

Hello,
attached is a change against the netbsd-6 xf86-video-sis, which allows me
to run X11 accelerated on a lemote fuloong.
This device has a loongson2 CPU and uses a sis 315Pro as graphic controller.
But here the controller is not in VGA-compatible mode but in framebuffer
mode. We have sisfb(4) in our kernel to use it as text console.
Recently I added support to sisfb(4) for wsfb (this was easy), and
also got xf86-video-sis working (which gives us highter resolutions,
support for the second video output, etc ...). For this, I added
support to sisfb to mmap the video memory, but also the I/O and memory-mapped
registers. The attached patch changes xf86-video-sis to use the services
provided by sisfb for registers access (I couldn't get it working
using the libpciaccess, because our pci(4) doesn't support mmap'ing the
I/O space, and chaning this would be quite intrusive).

Would anyone see a problem with this approach ? I don't think xf86-video-sis
has ever worked on mips hardware on NetBSD so this shouldn't break anything ...
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--
Manuel Bouyer
2014-01-28 11:57:10 UTC
Permalink
[ I'm not subscribed to tech-x11, so please keep either me or port-mips in Cc ]

Hello,
based on suggetion from macallan@, here's a new, less intrusive patch.
It uses the PCI_MAGIC_IO_RANGE other drivers are already using.
The challenge here is to find a value that will never show up in
PCI BARs, for any hardware supported by evbmips (a conflict here would be
a problem only when trying to map these ranges in userspace).
Using a 64bit value, we're safe for 32bit devices. I'm not sure if 64bit
devices can use values that high.

Attached is a kernel patch which defines a PCI_MAGIC_IO_RANGE for evbmips,
and use it for sisfb.
Then the xorg patch is much simpler: mips has to be handled the same way
as arm in ppc_video.c (I think it's a bug that mips was ommited here, because
the mips and arm inx/outx functions both use IOPortBase). Then we just
need to adjust the address in sisfb to use the correct address.
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--
Michael
2014-01-28 12:13:55 UTC
Permalink
Hello,

On Tue, 28 Jan 2014 12:57:10 +0100
Post by Manuel Bouyer
Then the xorg patch is much simpler: mips has to be handled the same way
as arm in ppc_video.c (I think it's a bug that mips was ommited here, because
the mips and arm inx/outx functions both use IOPortBase).
More like I Never Got There, none of my MIPS hardware needs IO access in X ;)
Seriously though, I have no idea why ARM and MIPS use a different
variable than PowerPC and such.

have fun
Michael

Loading...