Bug 75666 - add Matrox MGA Driver to xorg-server
Summary: add Matrox MGA Driver to xorg-server
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-x11 mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-30 17:50 UTC by Oliver Lehmann
Modified: 2005-01-13 20:54 UTC (History)
1 user (show)

See Also:


Attachments
patch-x11-servers::xorg-server (3.20 KB, text/plain)
2004-12-30 17:50 UTC, Oliver Lehmann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Lehmann freebsd_committer 2004-12-30 17:50:30 UTC
	Add the matrox-driver stuff back since matrox now supports driver for xorg
Comment 1 Oliver Lehmann freebsd_committer 2004-12-30 17:51:45 UTC
Responsible Changed
From-To: freebsd-ports-bugs->x11

assign to maintainer
Comment 2 Oliver Lehmann freebsd_committer 2005-01-09 11:55:01 UTC
Please take this patch as it covers an extra patch which is needed:


diff -ruN --exclude=CVS /usr/ports/x11-servers/xorg-server/Makefile xorg-server/Makefile
--- /usr/ports/x11-servers/xorg-server/Makefile	Sat Jan  8 12:02:58 2005
+++ xorg-server/Makefile	Sun Jan  9 01:24:27 2005
@@ -137,6 +137,38 @@
 PLIST_SUB+=	AMD64_I386="@comment "
 .endif
 
+.if ${ARCH} == i386
+.if !defined(WITH_MATROX_GXX_DRIVER)
+SCRIPTS_ENV+=		HaveMatroxHal=NO
+PLIST_SUB+=		MATROX="@comment "
+pre-fetch::
+	@${ECHO_MSG} "********************************************************"
+	@${ECHO_MSG} "Define WITH_MATROX_GXX_DRIVER to include Matrox's extra"
+	@${ECHO_MSG} "\"HALLIB\" binary driver"
+	@${ECHO_MSG} "********************************************************"
+.else
+NO_PACKAGE=	"Matrox drivers may not be distributed"
+RESTRICTED=	"Matrox drivers may not be distributed."
+EXTRA_PATCHES=	${FILESDIR}/extra-patch-matrox
+SCRIPTS_ENV+=		HaveMatroxHal=YES
+MGA_DRIVER_VERSION=	4.1-1
+MASTER_SITES+=  	ftp://ftp.matrox.com/pub/mga/archive/linux/2004/:mga
+DISTFILES+=		mgadriver-${MGA_DRIVER_VERSION}-src.tar.gz:mga
+#EXTRACT_ONLY+=  	mgadriver-${MGA_DRIVER_VERSION}-src.tar.gz
+RESTRICTED_FILES=	mgadriver-${MGA_DRIVER_VERSION}-src.tar.gz
+PLIST_SUB+=		MATROX=""
+post-extract::
+	${CP} -r ${WRKDIR}/mgadriver-${MGA_DRIVER_VERSION}-src/${PORTVERSION}/mga \
+		${WRKSRC}/programs/Xserver/hw/xfree86/drivers/
+post-install::
+	${INSTALL_DATA} ${WRKDIR}/mgadriver-${MGA_DRIVER_VERSION}-src/${PORTVERSION}/mga/README_HALLIB \
+		${PREFIX}/lib/X11/doc/README.mga_HALLIB
+.endif  # !WITH_MATROX_GXX_DRIVER
+.else
+SCRIPTS_ENV+=		HaveMatroxHal=NO
+PLIST_SUB+=		MATROX="@comment "
+.endif
+
 .if !defined(NO_SUID_XSERVER) || ${NO_SUID_XSERVER} == NO
 pre-everything::
 	@${ECHO_MSG} "By default, the X Server installs as a set-user-id root binary. When run by"
diff -ruN --exclude=CVS /usr/ports/x11-servers/xorg-server/distinfo xorg-server/distinfo
--- /usr/ports/x11-servers/xorg-server/distinfo	Fri Dec 31 13:41:22 2004
+++ xorg-server/distinfo	Fri Jan  7 21:21:36 2005
@@ -2,3 +2,5 @@
 SIZE (xorg/X11R6.8.1-src1.tar.gz) = 30562401
 MD5 (xorg/X11R6.8.1-src3.tar.gz) = 8578e566e909e7c40300f44b6f0e88d3
 SIZE (xorg/X11R6.8.1-src3.tar.gz) = 10014808
+MD5 (xorg/mgadriver-4.1-1-src.tar.gz) = 5376fed39733b605191cf4dbb138a3ff
+SIZE(xorg/mgadriver-4.1-1-src.tar.gz) = 1148470
diff -ruN --exclude=CVS /usr/ports/x11-servers/xorg-server/files/extra-patch-matrox xorg-server/files/extra-patch-matrox
--- /usr/ports/x11-servers/xorg-server/files/extra-patch-matrox	Thu Jan  1 01:00:00 1970
+++ xorg-server/files/extra-patch-matrox	Sun Jan  9 01:16:31 2005
@@ -0,0 +1,17 @@
+--- programs/Xserver/hw/xfree86/drivers/mga/Imakefile.orig	Sun Jan  9 01:14:42 2005
++++ programs/Xserver/hw/xfree86/drivers/mga/Imakefile	Sun Jan  9 01:14:48 2005
+@@ -6,6 +6,14 @@
+ #define IHaveModules
+ #include <Server.tmpl>
+ 
++#undef NormalRelocatableTarget
++#define NormalRelocatableTarget(objname,objlist)                        @@\
++AllTarget(objname.Osuf)                                                 @@\
++                                                                        @@\
++objname.Osuf: objlist $(EXTRALIBRARYDEPS)                               @@\
++	RemoveFile($@)                                                  @@\
++	$(MODLD) $(MODLDCOMBINEFLAGS) objlist -L../../i2c -li2c -o $@
++
+ #if BuildMatroxHal
+ #define IHaveSubdirs
+ SUBDIRS=hallib
diff -ruN --exclude=CVS /usr/ports/x11-servers/xorg-server/pkg-plist xorg-server/pkg-plist
--- /usr/ports/x11-servers/xorg-server/pkg-plist	Sat Jan  8 12:02:58 2005
+++ xorg-server/pkg-plist	Mon Jan  3 21:27:37 2005
@@ -63,6 +63,7 @@
 lib/X11/doc/README.fonts
 lib/X11/doc/README.i740
 lib/X11/doc/README.i810
+%%MATROX%%lib/X11/doc/README.mga_HALLIB
 lib/X11/doc/README.mouse
 lib/X11/doc/README.newport
 lib/X11/doc/README.r128
@@ -93,6 +94,7 @@
 %%I386%%lib/modules/drivers/i740_drv.o
 %%I386%%lib/modules/drivers/i810_drv.o
 lib/modules/drivers/mga_drv.o
+%%MATROX%%lib/modules/drivers/mga_hal_drv.o
 %%AMD64_I386%%lib/modules/drivers/neomagic_drv.o
 %%I386%%lib/modules/drivers/nsc_drv.o
 %%SPARC64_NA%%lib/modules/drivers/nv_drv.o
diff -ruN --exclude=CVS /usr/ports/x11-servers/xorg-server/scripts/configure xorg-server/scripts/configure
--- /usr/ports/x11-servers/xorg-server/scripts/configure	Sat Jan  8 12:02:58 2005
+++ xorg-server/scripts/configure	Mon Jan  3 21:27:37 2005
@@ -24,6 +24,8 @@
 echo "#define UseInstalledPrograms YES"		>> $LOCALDEF
 echo "#define StandardIncludes -I${PREFIX}/include" >> $LOCALDEF
 echo "#define BuildXFree86ConfigTools YES"	>> $LOCALDEF
+# Matrox driver support
+echo "#define HaveMatroxHal $HaveMatroxHal"	>> $LOCALDEF
 
 if [ X$WITH_DEBUG != X ]; then
 	export CFLAGS="-g $CFLAGS"


-- 
 Oliver Lehmann
  http://www.pofo.de/
  http://wishlist.ans-netz.de/
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2005-01-10 16:58:55 UTC
Responsible Changed
From-To: x11->freebsd-x11

Canonicalize assignment.
Comment 4 Tod McQuillin 2005-01-13 11:12:22 UTC
I can confirm that this works brilliantly on RELENG_4 as well, although 
the patch might not be in exactly the right format.

Thank goodness this works, too, as it's absolutely needed to get xorg 
working with the matrox G550 when using DVI displays.

Here's a version of the patch relative to cwd instead of to 
/usr/ports/x11-servers:

Index: Makefile
===================================================================
RCS file: /usr/src/cvs-repo/ports/x11-servers/xorg-server/Makefile,v
retrieving revision 1.20
diff -u -u -r1.20 Makefile
--- Makefile	2 Jan 2005 00:32:06 -0000	1.20
+++ Makefile	13 Jan 2005 10:05:06 -0000
@@ -137,6 +137,38 @@
  PLIST_SUB+=	AMD64_I386="@comment "
  .endif

+.if ${ARCH} == i386
+.if !defined(WITH_MATROX_GXX_DRIVER)
+SCRIPTS_ENV+=		HaveMatroxHal=NO
+PLIST_SUB+=		MATROX="@comment "
+pre-fetch::
+	@${ECHO_MSG} "********************************************************"
+	@${ECHO_MSG} "Define WITH_MATROX_GXX_DRIVER to include Matrox's extra"
+	@${ECHO_MSG} "\"HALLIB\" binary driver"
+	@${ECHO_MSG} "********************************************************"
+.else
+NO_PACKAGE=	"Matrox drivers may not be distributed"
+RESTRICTED=	"Matrox drivers may not be distributed."
+EXTRA_PATCHES=	${FILESDIR}/extra-patch-matrox
+SCRIPTS_ENV+=		HaveMatroxHal=YES
+MGA_DRIVER_VERSION=	4.1-1
+MASTER_SITES+=  	ftp://ftp.matrox.com/pub/mga/archive/linux/2004/:mga
+DISTFILES+=		mgadriver-${MGA_DRIVER_VERSION}-src.tar.gz:mga
+#EXTRACT_ONLY+=  	mgadriver-${MGA_DRIVER_VERSION}-src.tar.gz
+RESTRICTED_FILES=	mgadriver-${MGA_DRIVER_VERSION}-src.tar.gz
+PLIST_SUB+=		MATROX=""
+post-extract::
+	${CP} -r ${WRKDIR}/mgadriver-${MGA_DRIVER_VERSION}-src/${PORTVERSION}/mga \
+		${WRKSRC}/programs/Xserver/hw/xfree86/drivers/
+post-install::
+	${INSTALL_DATA} ${WRKDIR}/mgadriver-${MGA_DRIVER_VERSION}-src/${PORTVERSION}/mga/README_HALLIB \
+		${PREFIX}/lib/X11/doc/README.mga_HALLIB
+.endif  # !WITH_MATROX_GXX_DRIVER
+.else
+SCRIPTS_ENV+=		HaveMatroxHal=NO
+PLIST_SUB+=		MATROX="@comment "
+.endif
+
  .if !defined(NO_SUID_XSERVER) || ${NO_SUID_XSERVER} == NO
  pre-everything::
  	@${ECHO_MSG} "By default, the X Server installs as a set-user-id root binary. When run by"
Index: distinfo
===================================================================
RCS file: /usr/src/cvs-repo/ports/x11-servers/xorg-server/distinfo,v
retrieving revision 1.2
diff -u -u -r1.2 distinfo
--- distinfo	23 Dec 2004 01:35:48 -0000	1.2
+++ distinfo	13 Jan 2005 10:02:34 -0000
@@ -2,3 +2,5 @@
  SIZE (xorg/X11R6.8.1-src1.tar.gz) = 30562401
  MD5 (xorg/X11R6.8.1-src3.tar.gz) = 8578e566e909e7c40300f44b6f0e88d3
  SIZE (xorg/X11R6.8.1-src3.tar.gz) = 10014808
+MD5 (xorg/mgadriver-4.1-1-src.tar.gz) = 5376fed39733b605191cf4dbb138a3ff
+SIZE(xorg/mgadriver-4.1-1-src.tar.gz) = 1148470
Index: pkg-plist
===================================================================
RCS file: /usr/src/cvs-repo/ports/x11-servers/xorg-server/pkg-plist,v
retrieving revision 1.6
diff -u -u -r1.6 pkg-plist
--- pkg-plist	2 Jan 2005 00:32:06 -0000	1.6
+++ pkg-plist	13 Jan 2005 10:02:34 -0000
@@ -63,6 +63,7 @@
  lib/X11/doc/README.fonts
  lib/X11/doc/README.i740
  lib/X11/doc/README.i810
+%%MATROX%%lib/X11/doc/README.mga_HALLIB
  lib/X11/doc/README.mouse
  lib/X11/doc/README.newport
  lib/X11/doc/README.r128
@@ -93,6 +94,7 @@
  %%I386%%lib/modules/drivers/i740_drv.o
  %%I386%%lib/modules/drivers/i810_drv.o
  lib/modules/drivers/mga_drv.o
+%%MATROX%%lib/modules/drivers/mga_hal_drv.o
  %%AMD64_I386%%lib/modules/drivers/neomagic_drv.o
  %%I386%%lib/modules/drivers/nsc_drv.o
  %%SPARC64_NA%%lib/modules/drivers/nv_drv.o
Index: files/extra-patch-matrox
===================================================================
RCS file: files/extra-patch-matrox
diff -N files/extra-patch-matrox
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/extra-patch-matrox	13 Jan 2005 10:02:34 -0000
@@ -0,0 +1,17 @@
+--- programs/Xserver/hw/xfree86/drivers/mga/Imakefile.orig	Sun Jan  9 01:14:42 2005
++++ programs/Xserver/hw/xfree86/drivers/mga/Imakefile	Sun Jan  9 01:14:48 2005
+@@ -6,6 +6,14 @@
+ #define IHaveModules
+ #include <Server.tmpl>
+ 
++#undef NormalRelocatableTarget
++#define NormalRelocatableTarget(objname,objlist)                        @@\
++AllTarget(objname.Osuf)                                                 @@\
++                                                                        @@\
++objname.Osuf: objlist $(EXTRALIBRARYDEPS)                               @@\
++	RemoveFile($@)                                                  @@\
++	$(MODLD) $(MODLDCOMBINEFLAGS) objlist -L../../i2c -li2c -o $@
++
+ #if BuildMatroxHal
+ #define IHaveSubdirs
+ SUBDIRS=hallib
Index: scripts/configure
===================================================================
RCS file: /usr/src/cvs-repo/ports/x11-servers/xorg-server/scripts/configure,v
retrieving revision 1.5
diff -u -u -r1.5 configure
--- scripts/configure	2 Jan 2005 00:32:07 -0000	1.5
+++ scripts/configure	13 Jan 2005 10:02:34 -0000
@@ -24,6 +24,8 @@
  echo "#define UseInstalledPrograms YES"		>> $LOCALDEF
  echo "#define StandardIncludes -I${PREFIX}/include" >> $LOCALDEF
  echo "#define BuildXFree86ConfigTools YES"	>> $LOCALDEF
+# Matrox driver support
+echo "#define HaveMatroxHal $HaveMatroxHal"	>> $LOCALDEF

  if [ X$WITH_DEBUG != X ]; then
  	export CFLAGS="-g $CFLAGS"
Comment 5 Eric Anholt freebsd_committer 2005-01-13 20:52:48 UTC
State Changed
From-To: open->closed

I've committed an mga_hal port in x11-servers which I believe does all that's 
necessary for MGA HAL support, without cluttering up xorg-server.  (I read the 
diffs and didn't see things that seemed too major, but please tell me if there 
are pieces of Matrox's code that are necessary).