Bug 1033 - Non-DRI build broken recently (
Summary: Non-DRI build broken recently (
Status: RESOLVED DUPLICATE of bug 922
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: git
Hardware: All Linux (All)
: highest blocker
Assignee: Mike Harris
QA Contact:
Depends on:
Blocks: 351
  Show dependency treegraph
Reported: 2004-08-10 22:45 UTC by Mike A. Harris
Modified: 2004-08-10 14:10 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

xorg-x11-6.8.0-build-fix-for-non-dri-builds.patch (697 bytes, patch)
2004-08-10 23:56 UTC, Mike A. Harris
no flags Details | Splinter Review

Description Mike A. Harris 2004-08-10 22:45:52 UTC
On a PPC build with DRI disabled by using "#define BuildXF86DRI NO", the
build fails in the Radeon driver with the following:

gcc -O2  -pipe -m32 -fsigned-char -fno-strict-aliasing -pipe -fsigned-char   
-fno-merge-constants -I. -I../../../../../../programs/Xserver/hw/xfree86/common
-I../../../../../../programs/Xserver/hw/xfree86/vbe -I../../../../../.
-I../../../../../../programs/Xserver/hw/xfree86/i2c            -I../../../
-I../../../../../../programs/Xserver/hw/xfree86/shadowfb -I../../.
-I../../../../../../programs/Xserver/mfb -I../../.
./../../../programs/Xserver/fb -I../../../../../../programs/Xserver/mi         
server/render -I../../../../../../programs/Xserver/Xext
-I../../../../../../include/fonts -I../../../../../../includ
e/extensions -I../../../../../../exports/include/X11  -I../../../../../..
-I../../../../../../exports/include   -Dlinux -D__powerpc__
                -D_POSIX_SOURCE -D_XOPEN_SOURCE                                
-D_BSD_SOURCE -D_SVID_SOURCE                             -D_GNU_SOURCE
                -DXFreeXDGA -DXvExtension                              
ree86Server                             -DXF86VIDMODE                          
-DXvMCExtension                                 -DSMART_SCHEDULE
 -DXResExtension                                -DX_BYTE_ORDER=X_BIG_ENDIAN    
                        -DXORG_VERSION_CURRENT="(((6) * 10000000) + ((7) *
100000) + ((99) *
-DAVOID_CPIO  -DAVOID_NON_PCI    -c radeon_accel.c
In file included from radeon_accel.c:382:
radeon_render.c: In function `R100SetupTextureMMIO':
radeon_render.c:438: error: structure has no member named `CPStarted'
radeon_render.c: In function `R200SetupTextureMMIO':
radeon_render.c:746: error: structure has no member named `CPStarted'
make[7]: *** [radeon_accel.o] Error 1
make[7]: Leaving directory
make[6]: *** [all] Error 2
make[6]: Leaving directory
make[5]: *** [all] Error 2
make[5]: Leaving directory
make[4]: *** [hw/xfree86] Error 2
make[4]: Leaving directory
make[3]: *** [all] Error 2
make[3]: Leaving directory
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/build/435544-ppc/BUILD/xorg-x11-'
make[1]: *** [World] Error 2
make[1]: Leaving directory `/usr/src/build/435544-ppc/BUILD/xorg-x11-'
make: *** [World] Error 2
make: Leaving directory `/usr/src/build/435544-ppc/BUILD/xorg-x11-'
error: Bad exit status from /usr/src/build/435544-ppc/install-tmp/rpm-tmp.71867 

I haven't investigated the driver source yet, but my initial assumption
is that there may have been recent changes commited to the Radeon driver
perhaps that aren't properly wrapped in a check to see if DRI is being
built in.  I'm going to have a look at that right now.
Comment 1 Mike A. Harris 2004-08-10 23:13:16 UTC
Here's the problem:

    if (info->accel->NeedToSync) {
        if (info->CPStarted)

The code above, from R100SetupTextureMMIO() gets called, but the check for
info-CPStarted blows up because CPStarted structure member isn't defined for
the non-DRI case.  Then RADEONInit3DEngineForRender(pScrn) is called but only
if CPStarted is set.  This is obviously incorrect, since the code in
RADEONInit3DEngineForRender(pScrn) has conditional compilation for both the
DRI and non-DRI cases, and for the DRI case, it already checks internally
if CPStarted has been set or not:

void RADEONInit3DEngineForRender(ScrnInfoPtr pScrn)
#ifdef XF86DRI
    RADEONInfoPtr info = RADEONPTR (pScrn);

    if (info->CPStarted)

As such, the if blocks in both R100SetupTextureMMIO() and
R200SetupTextureMMIO() right now which check if CPStarted is set or not, will
result in RADEONInit3DEngineForRender() never being called unless DRI is
enabled, which is obviously wrong.

The correct fix for this problem, is to remove the conditional checks for
CPStarted prior to calling RADEONInit3DEngineForRender(), which will result
in RADEONInit3DEngineForRender() making that decision internally.  This should
fix both the compile time problem, and also the runtime problem that would
have occured in the non-DRI case, had the existing code actually compiled
(had CPStarted been a structure member outside of the XF86DRI conditional).

I'll attach a patch to fix this shortly.
Comment 2 Mike A. Harris 2004-08-10 23:16:46 UTC
Changing Hardware to "All" as this problem isn't PPC specific, just discovered
during a PPC non-DRI build.
Comment 3 Mike A. Harris 2004-08-10 23:56:08 UTC
Created attachment 600 [details] [review]

Patch to fix the problems outlined above.
Comment 4 Kevin E. Martin 2004-08-11 07:10:37 UTC
Eric Anholt has fixed this as part of his work on the context switching issue,
which he said he would get working today and apply.  Marking as dup of 922.

*** This bug has been marked as a duplicate of 922 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.