Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Apr 2006 18:48:08 +0400
From:      Boris Samorodov <bsam@ipt.ru>
To:        mag@intron.ac
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: DRI under Linux compat problem
Message-ID:  <03974327@srv.sem.ipt.ru>
In-Reply-To: <200604041356.k34DuQ2H035438@zhao.intron.ac> (mag@intron.ac's message of "Tue, 04 Apr 2006 20:42:44 %2B0800")
References:  <44326626.8060803@orchid.homeunix.org> <200604041356.k34DuQ2H035438@zhao.intron.ac>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=

On Tue, 04 Apr 2006 20:42:44 +0800 mag@intron.ac wrote:

> I also hope linux-XFree86-libs may be upgraded to X.org libraries
> in Fedora Core 3. XFree86 4.3.99 is too legacy to support many
> current pieces of software.

Actually, some work is already done. As soon as new releases of
FreeBSD are out, linux-xorg-libs port may be committed. If you want
to test it, here you are.

All needed patches are at the attachments.

The first one is a new port:
1. uudecode attachment
2. copy to ports/x11
2. cd ports/X11
3. tar xyvf linux-xorg-libs.tar.bz2

The second and third are patches for ports/Mk:
1. cd ports/Mk
2. patch < _two_patches_

The second patch prepares bsd.linux-rpm.mk and the third one makes
linux-xorg-libs the default port for x11 libraries with linuxolator.
All those patches are tested with linux_base-fc3 port.

Then you may try to install a new port or replace an old one, say by
"portupgrade -o x11/linux-xorg-libs linux-XFree86-libs".

Any feedback is appreciated.

> At the same time, Linux module in FreeBSD kernel should also be
> upgraded to keep up with Linus Torvalds. Currently, too much Linux
> system calls haven't been supported by FreeBSD kernel yet.

> I am learning the programming environment of FreeBSD kernel to make
> my own contribution to the module.

> Karol Kwiatkowski wrote:

> > Good day all,
> > I hope this is the appropriate list. I'm trying to get DRI working
> > under Linux emulation but it fails.
> > I'm using linux_base-fc3 right now, but with linux_base-8 it was the
> > same. I guess there's some conflict between linux_dri-4.4.0 and
> > linux-XFree86-libs-4.3.99.902_7. Linux's libGL fails with:
> >   'DDX DRI driver expected R200 version 4.0.x but got version 5.0.3'

Karol, I can't say for sure if those patches may help you. But you may
give it a try.

> > Details below.
> > In FreeBSD DRI is working, the video card is Radeon 9000Pro and it
> > is
> > using radeon driver. Any help appreciated.
> > Cheers,
> > Karol
> > $ uname -spr
> > FreeBSD 6.1-PRERELEASE i386
> > /etc/X11/xorg.conf :
> > Section "Device"
> >         Identifier  "Card0"
> >         Driver      "ati"
> >         VendorName  "ATI Technologies Inc"
> >         BoardName   "Radeon RV250 If [Radeon 9000]"
> >         BusID       "PCI:1:0:0"
> >         Option      "AGPMode" "4"
> >         Option      "EnableDepthMoves" "on"
> >         Option      "EnablePageFlip" "on"
> >         Option      "RenderAccel" "on"
> > #       Option      "AccelMethod" "EXA"
> > EndSection
> > /var/log/Xorg.0.log :
> > [...]
> > (--) Chipset ATI Radeon 9000/PRO If (AGP/PCI) found
> > (II) Loading sub module "radeon"
> > (II) LoadModule: "radeon"
> > (II) Loading /usr/X11R6/lib/modules/drivers/radeon_drv.so
> > (II) Module radeon: vendor="X.Org Foundation"
> > [...]
> > (II) RADEON(0): [drm] installed DRM signal handler
> > (II) RADEON(0): [DRI] installation complete
> > (II) RADEON(0): [drm] Added 32 65536 byte vertex/indirect buffers
> > (II) RADEON(0): [drm] Mapped 32 vertex/indirect buffers
> > (II) RADEON(0): [drm] dma control initialized, using IRQ 16
> > (II) RADEON(0): [drm] Initialized kernel GART heap manager, 5111808
> > (II) RADEON(0): Direct rendering enabled
> > FreeBSD' DRI:
> > $ LIBGL_DEBUG=verbose glxinfo
> > name of display: :0.0
> > libGL: XF86DRIGetClientDriverName: 5.0.3 r200 (screen 0)
> > libGL: OpenDriver: trying /usr/X11R6/lib/modules/dri/r200_dri.so
> > drmOpenByBusid: Searching for BusID pci:0000:01:00.0
> > drmOpenDevice: node name is /dev/dri/card0
> > drmOpenDevice: open result is 4, (OK)
> > drmOpenByBusid: drmOpenMinor returns 4
> > drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
> > libGL error:
> > Can't open configuration file /etc/drirc: No such file or directory.
> > libGL error:
> > Can't open configuration file /home/karol/.drirc: No such file or
> > directory.
> > display: :0  screen: 0
> > direct rendering: Yes
> > [...]
> > OpenGL vendor string: Tungsten Graphics, Inc.
> > OpenGL renderer string: Mesa DRI R200 20041207 AGP 4x TCL
> > OpenGL version string: 1.3 Mesa 6.4.1
> > [...]
> > DRI under Linux compat:
> > $ LIBGL_DEBUG=verbose /compat/linux/usr/X11R6/bin/glxinfo
> > libGL: XF86DRIGetClientDriverName: 5.0.3 r200 (screen 0)
> > libGL: OpenDriver: trying /usr/X11R6/lib/modules/dri/r200_dri.so
> > drmOpenByBusid: busid is pci:0000:01:00.0
> > drmOpenDevice: minor is 0
> > drmOpenDevice: node name is /dev/dri/card0
> > drmOpenDevice: open result is 4, (OK)
> > drmOpenByBusid: drmOpenMinor returns 4
> > drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
> > libGL error:
> > DDX DRI driver expected R200 version 4.0.x but got version 5.0.3
> > libGL error: InitDriver failed
> > display: :0.0  screen:0
> > direct rendering: No
> > [...]
> > OpenGL vendor string: Mesa project: www.mesa3d.org
> > OpenGL renderer string: Mesa GLX Indirect
> > OpenGL version string: 1.2 (1.5 Mesa 6.4.1)
> > [...]
> > $ pkg_info | cut -d " " -f 1 | grep -E "xorg|linux" | grep -v
> > "xorg-fonts"
> > linux-XFree86-libs-4.3.99.902_7
> > linux-aspell-0.50.4.1_1
> > linux-atk-1.8.0_1
> > linux-expat-1.95.7
> > linux-flashplugin-7.0r63
> > linux-fontconfig-2.2.3_2
> > linux-glib2-2.4.8_1
> > linux-gtk2-2.4.14_3
> > linux-jpeg-6b.33
> > linux-openmotif-2.2.4_2
> > linux-opera-8.52.20060201
> > linux-pango-1.6.0_1
> > linux-png-1.2.8
> > linux-realplayer-10.0.7.785.20060201
> > linux-tiff-3.6.1_5
> > linux_base-fc-3_1
> > linux_dri-4.4.0
> > linuxpluginwrapper-20051113
> > xorg-6.9.0
> > xorg-clients-6.9.0_2
> > xorg-documents-6.9.0
> > xorg-libraries-6.9.0
> > xorg-manpages-6.9.0
> > xorg-nestserver-6.9.0
> > xorg-printserver-6.9.0
> > xorg-server-6.9.0_1
> > xorg-vfbserver-6.9.0


WBR
-- 
Boris B. Samorodov, Research Engineer
InPharmTech Co,     http://www.ipt.ru
Telephone & Internet Service Provider

--=-=-=
Content-Disposition: attachment; filename=linux-xorg-libs.tar.bz2.uu
Content-Description: linux-xorg-libs port

begin 644 linux-xorg-libs.tar.bz2
M0EIH.3%!62936>%4?\P`%>E_D/RP`,!>9__W?___T/__W_I$```(8`J>;O%>
M^T^N^AQ][0"ZPDEUH$JI$*/B8:(T23VB-"C9OU2%--E,&AJ--#>J,@`#!``"
MJ>32>*>DT:!H````#0```:`T`!J84]%3TGJ/1E#]4>D`````--`````&95*:
M0#U&F30&@::8AH,@``#0TTTQ`R!%(@1I,3T3U4_$;4IY1[35-/4R,TFC3)A#
M1Y1HR:``2)""81D&A5/]*>!"::>J/1J,31ZF3(:-&FT@](;4K[4CVIMCV>KV
M\8>__QH2,4(Q:*#ARF2O18"9$K0">-!@>@Z5))*!Q[^GM_3AS;9&W'A[J:9Z
M<W!?WJ#+R6?W;%,$=%^B@@A`I'>)[LP!L!7B*KL*)IB`4F`3DG7.-AH][E26
M,8K=Q?.][WO>_&>6#\PF2X(V6%4CH9='K:%FWAF=*##!554`55!555555555
M555554%0555XTN/%D9`!B4%0``55!56`"JNIE\[-`<W+PP"M(B*24*9%(1D2
MR,BTD&#*A&B(QHAF1J1&#(`H````95L[LLR9.`RS1T?U).%CR1<J0;(`G`>)
M)P4W6'&T53L6A+IVW?E?G$:K!V\+FWQDI5[<482B-W[;)ONL'7+7)=QB@2F!
M^[P1[G[;M-GTL2M%A-2Z?>5!5;92[_2MPLF*\J1MQ?*)*D1<,4.&)@<]P>(7
M!H@\%SM56VZ?1D`PR`=`U`0@N%=56SSQ'H:]$H,W#2-RABAA#"4*LX*N&V8U
M;I5SE72LBBI:9L$-8%$@&0%H'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-VE6Q($@=;=`*&L]\P*PZJK[
MS:<+2LRK/K:`><`6+#);D"3!@:OF1&"#3@E^0K4`'TZLR]5>!!AS`WUC+KY2
MI=*IQA%`>VR"(A.3L;A2'4UNP)#1RM):"&4I9&5122BR0R'%2H)!0+S@5WE$
M<I!0BU&OIU*_1`ZY2&R=U3<4"$;5Q5>>L)F`ZJ%0MA()[F009;@-=:Q.N_$I
MU;BPA=O`DC>8%9L[1C&P;;3:;3:"!`H4(%"A0H4*%"A0H4*0H2A`H0*%"D)(
M$"!`H0*$(2!`H4A`E`(0@6RV&,`&VVVW[D5FT1OR&,'0#5!L#F7A.?><`]R-
MJ"U_!N05@<C`"K<#10J8.`;7&LR@WJ2:37G?378H^OQ><4_\7<D4X4)#A5'_
!,```
`
end

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=bsd.linux-rpm.mk.patch
Content-Description: linux-rpm patch

--- bsd.linux-rpm.mk.orig	Wed Jan 25 20:41:34 2006
+++ bsd.linux-rpm.mk	Tue Apr  4 18:10:42 2006
@@ -4,6 +4,30 @@
 # $FreeBSD: ports/Mk/bsd.linux-rpm.mk,v 1.2 2006/01/25 17:41:34 jylefort Exp $
 #
 
+# Variables:
+#  - LINUX_DIST:	Will be used to set some dist-specific presets.
+#			Valid values: fedora
+#  - LINUX_DIST_VER:	Use depends upon the dist-specific presets.
+#			Valid values for "fedora": all version numbers
+#				e.g. 3 for fedora core 3, 4 for fedora core 4
+#				This is used to set MASTER_SITE_{,SRC_}SUBDIR
+#				if it isn't already set.
+#  - MASTER_SITE_SRC_SUBDIR:	The subdir for the src RPM's.
+#  - DISTFILES:		For simple cases this will be set automatically
+#			based upon the DISTNAME.
+#  - SRC_DISTFILES:	Variable which contains the corresponding src RPM's.
+#			If there's no corresponding src RPM, it has to be
+#			set to the empty value (SRC_DISTFILES=	"").
+#  - AUTOMATIC_PLIST:	Generate a dynamic plist (please have a look at the
+#			porters handbook section which talks about plists.
+#			This feature is reserved for rare cases).
+#  - BRANDELF_DIRS:	A list of directories with executables to brand
+#			as a linux executable. The directories has to not
+#			contain libraries.
+#  - BRANDELF_FILES:	A list of files to brand as a linux executable in
+#			case BRANDELF_DIRS can't be used.
+
+
 .if !defined(_POSTMKINCLUDED) && !defined(Linux_RPM_Pre_Include)
 
 Linux_RPM_Include_MAINTAINER=	emulation@FreeBSD.org
@@ -12,6 +36,7 @@
 RPM2CPIO?=			${LOCALBASE}/bin/rpm2cpio
 
 EXTRACT_SUFX?=		.${LINUX_RPM_ARCH}.rpm
+SRC_SUFX?=		.src.rpm
 
 USE_LINUX?=			yes
 USE_LINUX_PREFIX=	yes
@@ -33,10 +58,38 @@
 
 Linux_RPM_Post_Include=	bsd.linux-rpm.mk
 
+LINUX_DIST?=		fedora
+LINUX_DIST_VER?=	3
+
+.  if defined(LINUX_DIST)
+DIST_SUBDIR?=	rpm/${LINUX_RPM_ARCH}/${LINUX_DIST}/${LINUX_DIST_VER}
+
+.    if ${LINUX_DIST} == "fedora"
 MASTER_SITES?=			${MASTER_SITE_FEDORA_LINUX}
-MASTER_SITE_SUBDIR?=	3/${LINUX_RPM_ARCH}/os/Fedora/RPMS/
+MASTER_SITE_SUBDIR?=	${LINUX_DIST_VER}/${LINUX_RPM_ARCH}/os/Fedora/RPMS \
+			updates/${LINUX_DIST_VER}/${LINUX_RPM_ARCH}
+MASTER_SITE_SRC_SUBDIR?=	${LINUX_DIST_VER}/SRPMS \
+				updates/${LINUX_DIST_VER}/SRPMS
+.    else
+IGNORE=	unknown LINUX_DIST in port Makefile
+.    endif
+.  endif
 PKGNAMEPREFIX?=			linux-
 
+# DISTFILES and SRC_DISTFILES assume that there is only one bindist
+# and one src file.
+# Please, define them n the Makefile of the port in case this assumption
+# is not true.
+
+DISTFILES?=		${DISTNAME}${EXTRACT_SUFX}
+SRC_DISTFILES?=		${DISTNAME}${SRC_SUFX}
+
+.  if defined(PACKAGE_BUILDING)
+DISTFILES+=		${SRC_DISTFILES}
+MASTER_SITE_SUBDIR+=	${MASTER_SITE_SRC_SUBDIR}
+ALWAYS_KEEP_DISTFILES=	yes
+.  endif
+
 EXTRACT_DEPENDS+=		${RPM2CPIO}:${PORTSDIR}/archivers/rpm
 
 EXTRACT_CMD?=			${RPM2CPIO}
@@ -45,43 +98,54 @@
 
 MD5_FILE?=				${MASTERDIR}/distinfo.${LINUX_RPM_ARCH}
 
+BRANDELF_DIRS?=
+BRANDELF_FILES?=
+
 .  if defined(AUTOMATIC_PLIST)
 
 .    if ${USE_LINUX} == "8" || ${USE_LINUX:L} == "yes"
 _LINUX_BASE_SUFFIX=		8
 .    elif ${USE_LINUX} == "debian"
 _LINUX_BASE_SUFFIX=		debian
+.    elif ${USE_LINUX} == "fc3"
+_LINUX_BASE_SUFFIX=		fc3
 .    else
 # other linux_base ports do not provide a pkg-plist file
-IGNORE=					uses AUTOMATIC_PLIST with an unsupported USE_LINUX, \"${USE_LINUX}\". Supported values are \"yes\", \"8\" and \"debian\"
+IGNORE=					uses AUTOMATIC_PLIST with an unsupported USE_LINUX, \"${USE_LINUX}\". Supported values are \"yes\", \"8\", \"debian\" and \"fc3\"
 .    endif
 
 PLIST?=					${WRKDIR}/.PLIST.linux-rpm
 
 pre-install: linux-rpm-generate-plist
 
+.    if !target(linux-rpm-generate-plist)
 linux-rpm-generate-plist:
 	@cd ${WRKSRC} && \
 	${FIND} * ! -type d | ${SORT} > ${PLIST} && \
 	${FIND} * -type d | ${SORT} | ${SED} -e 's|^|@dirrm |' > ${PLIST}.dirs
 	@${GREP} '^@dirrm ' ${PORTSDIR}/emulators/linux_base-${_LINUX_BASE_SUFFIX}/pkg-plist | ${SORT} > ${PLIST}.shared-dirs
 	@${COMM} -1 -3 ${PLIST}.shared-dirs ${PLIST}.dirs | ${SORT} -r >> ${PLIST}
-
+.    endif
 .  endif
 
 .  if !target(do-install)
 do-install:
+.	if ${BRANDELF_DIRS}
+		@cd ${WRKSRC} && ${FIND} ${BRANDELF_DIRS} -type f -print0 \
+		| ${XARGS} -0 ${FILE} | ${GREP} ELF | ${CUT} -d : -f 1 \
+		| ${XARGS} ${BRANDELF} -t Linux
+.	endif
+.	if ${BRANDELF_FILES}
+		@cd ${WRKSRC} && ${BRANDELF} -t Linux ${BRANDELF_FILES}
+.	endif
 	cd ${WRKSRC} && ${FIND} * -type d -exec ${MKDIR} "${PREFIX}/{}" \;
 	cd ${WRKSRC} && ${FIND} * ! -type d | ${CPIO} -pm -R root:wheel ${PREFIX}
 .  endif
 
 .  if !target(new-plist)
-new-plist:
-	@${RM} -rf ${WRKDIR}/.new-plist
-	@${MKDIR} ${WRKDIR}/.new-plist
-	@cd ${WRKDIR}/.new-plist && \
-	for f in ${DISTFILES}; do \
-		${RPM2CPIO} ${_DISTDIR}/$$f | ${CPIO} -id --quiet; \
+new-plist: build
+	@${RM} -f ${PLIST}.new
+	@cd ${WRKSRC} && \
 		${FIND} * ! type d | ${SORT} > ${PLIST}.new; \
 		${FIND} -d * -type d | ${SED} -e 's|^|@dirrm |' >> ${PLIST}.new; \
 	done

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=bsd.port.mk.patch
Content-Description: port.mk patch

--- bsd.port.mk.orig	Mon Mar 20 03:20:52 2006
+++ bsd.port.mk	Mon Mar 20 03:21:09 2006
@@ -1831,7 +1831,7 @@
 
 .if defined(USE_XLIB)
 .	if defined(USE_LINUX)
-RUN_DEPENDS+=	${LINUXBASE}/usr/X11R6/lib/libXrender.so.1:${PORTSDIR}/x11/linux-XFree86-libs
+RUN_DEPENDS+=	${LINUXBASE}/usr/X11R6/lib/libXrender.so.1:${PORTSDIR}/x11/linux-xorg-libs
 .	else
 LIB_DEPENDS+=	X11.6:${X_LIBRARIES_PORT}
 .	endif

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?03974327>