Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 148572

Summary: Proposed x11-drm with Gentoo/FreeBSD support.
Product: Gentoo/Alt Reporter: Javier Villavicencio (RETIRED) <the_paya>
Component: FreeBSDAssignee: Gentoo X packagers <x11>
Status: RESOLVED FIXED    
Severity: normal CC: bsd+disabled
Priority: High Keywords: Inclusion
Version: unspecified   
Hardware: All   
OS: FreeBSD   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: x11-drm-20060608-r1.ebuild
x11-drm.diff

Description Javier Villavicencio (RETIRED) gentoo-dev 2006-09-21 13:08:08 UTC
Following the changes to Mesa, new drm modules are required for DRI to work properly.
I'm attaching what i've come up so far for x11-drm ebuild with g/fbsd support, the only catch here is i'm not able to build dristat and drmstat. So far they don't seem to be built either on vanilla freebsd.
Comment 1 Javier Villavicencio (RETIRED) gentoo-dev 2006-09-21 13:09:00 UTC
Created attachment 97690 [details, diff]
x11-drm-20060608-r1.ebuild

This is the whole ebuild, for easy looking at the big picture.
Comment 2 Javier Villavicencio (RETIRED) gentoo-dev 2006-09-21 13:09:46 UTC
Created attachment 97691 [details, diff]
x11-drm.diff

And this is the big patch to the current ebuild.
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2006-09-21 13:21:53 UTC
I'm not really happy with the organization of the code. I'll try to hack it around some when I find a little time.
Comment 4 Javier Villavicencio (RETIRED) gentoo-dev 2006-09-21 13:31:00 UTC
(In reply to comment #3)
> I'm not really happy with the organization of the code. I'll try to hack it
> around some when I find a little time.
> 
I'm glad that i'm not the only one.


And this is how dr{i,m}stat fails:
QA Notice: USE Flag 'kernel_FreeBSD' not in IUSE for x11-base/x11-drm-20060608-r1
cc -march=pentium3 -O2 -frename-registers -pipe -g -ansi -pedantic -DPOSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -I. -I../libdrm -I../shared-core dristat.c -o dristat
In file included from dristat.c:36:
../libdrm/xf86drm.c: In function 'drmOpenDevice':
../libdrm/xf86drm.c:295: error: 'S_IFCHR' undeclared (first use in this function)
../libdrm/xf86drm.c:295: error: (Each undeclared identifier is reported only once
../libdrm/xf86drm.c:295: error: for each function it appears in.)
dristat.c: In function 'main':
dristat.c:248: error: 'optarg' undeclared (first use in this function)
gmake: *** [dristat] Error 1

!!! ERROR: x11-base/x11-drm-20060608-r1 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  x11-drm-20060608-r1.ebuild, line 166:   Called die

!!! Building dristat failed.
!!! If you need support, post the topmost build error, and the call stack if relevant.


However, S_IFCHR is already defined in these places:

sys/stat.h:#define      S_IFCHR  0020000                /* character special */
xorg/xf86_libc.h:#define XF86_S_IFCHR 0020000
xorg/xf86_libc.h:#undef S_IFCHR
xorg/xf86_libc.h:#define S_IFCHR XF86_S_IFCHR

And sys/stat.h is already being included by 
../libdrm/xf86drm.c:58:# include <sys/stat.h>
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-09-21 13:42:35 UTC
Misses an include of sys/stat.h
Comment 6 Javier Villavicencio (RETIRED) gentoo-dev 2006-09-21 14:47:11 UTC
The dristat/drmstat issue is solved by removing -D_POSIX_SOURCE from the CFLAGS in tests/Makefile.

Little piece of the ebuild with the fix:
[...]
        elif use kernel_FreeBSD
        then
                cd "${S}/tests"
                # -D_POSIX_SOURCE skips the definition of several things we need
                # for these two to compile
                sed -i -e "s/-D_POSIX_SOURCE//" Makefile
                make dristat || die "Building dristat failed."
                make drmstat || die "Building drmstat failed."
                mv dristat drmstat ${SRC_BUILD}
        fi
[...]
Comment 7 Donnie Berkholz (RETIRED) gentoo-dev 2006-09-24 00:59:01 UTC
Still needs patches to get looked at.
Comment 8 Javier Villavicencio (RETIRED) gentoo-dev 2006-10-30 14:52:55 UTC
I've comitted a less ugly ebuild to the transition overlay:
http://overlays.gentoo.org/proj/alt/browser/trunk/transition-overlay/x11-base/x11-drm/x11-drm-20060608-r1.ebuild
[sorry big url]
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2006-10-31 18:04:09 UTC
Sorry, I forgot about this. Keep bugging me.
Comment 10 Jerome Asselin 2006-11-20 19:08:28 UTC
In the hope this ebuild would resolve my DRI issues with mach64 driver, I've installed the candidate ebuild but DRI still doesn't work.

My video card is:
ATI Technologies Inc 3D Rage Pro AGP 1X/2X (rev 5c)

$ glxinfo | grep rendering
direct rendering: No
Comment 11 Javier Villavicencio (RETIRED) gentoo-dev 2006-11-23 15:22:51 UTC
(In reply to comment #10)
> In the hope this ebuild would resolve my DRI issues with mach64 driver, I've
> installed the candidate ebuild but DRI still doesn't work.

May you open a new bug with all the relevant information please? With some more information we can help a little more.

Tip: Make sure you're loading "/boot/modules" 'modules' instead of those in "/boot/kernel".

Donnie: Any news on this ebuild before i forget as well ^_^?
Comment 12 Donnie Berkholz (RETIRED) gentoo-dev 2006-11-23 20:22:44 UTC
(In reply to comment #11)
> Donnie: Any news on this ebuild before i forget as well ^_^?

No -- the problem is that I will need a somewhat large, single chunk of time to do this, and that time has not existed yet. I've just had sporadic minutes to work on Gentoo.
Comment 13 Javier Villavicencio (RETIRED) gentoo-dev 2006-12-20 09:05:43 UTC
Donnie: spam ping, *poke in the eye*
Comment 14 Donnie Berkholz (RETIRED) gentoo-dev 2006-12-20 10:04:08 UTC
I committed a masked revision, based on the overlay ebuild. Check it out.
Comment 15 Donnie Berkholz (RETIRED) gentoo-dev 2007-01-18 16:09:24 UTC
Fixed, thanks for your work and patience.