Announcement

Collapse
No announcement yet.

enable/disable DRI, DRI2, XAA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • enable/disable DRI, DRI2, XAA

    Hello,
    I was playing with the git source code and I stumbled over a few things. As I know that at least two people from ATI are on this forum I'm going to post it here.

    I've uploaded a few diffs with changes: http://ul.to/u4wpcu (sorry I have no idea where to put the file other than on a free hosting service, as I'm not allowed to attach files here)

    The configure script doesn't allow to disable XAA support. The configure.ac.diff adds that possibility.

    I tried also to add a switch to disable DRI, but that didn't work. Is it possible to just use DRI2 and not DRI? I guess it should be, because it's possible to compile the X-Server with DRI2 but without DRI.
    If one compiles the X-Server with DRI support it will define XF86DRI in some .h files. This is problematic because the Ati driver currently uses this define to decide if DRI support should be compiled into the driver. If think those defines should be renamed so that they don't conflict with X's defines.
    After compiling the X-Server (1.7.3) without DRI support I get the following make error for the driver:
    Code:
      CC    radeon_accel.o
    radeon_accel.c: In function ?RADEONDRMGetNumPipes?:
    radeon_accel.c:433: error: ?struct <anonymous>? has no member named ?dri?
    radeon_accel.c:434: error: ?drm_radeon_getparam_t? undeclared (first use in this function)
    radeon_accel.c:434: error: (Each undeclared identifier is reported only once
    radeon_accel.c:434: error: for each function it appears in.)
    radeon_accel.c:434: error: expected ?;? before ?np?
    radeon_accel.c:436: error: ?np? undeclared (first use in this function)
    radeon_accel.c:437: error: ?RADEON_PARAM_NUM_GB_PIPES? undeclared (first use in this function)
    radeon_accel.c:439: warning: implicit declaration of function ?drmCommandWriteRead?
    radeon_accel.c:439: error: ?struct <anonymous>? has no member named ?dri?
    radeon_accel.c:439: error: ?DRM_RADEON_GETPARAM? undeclared (first use in this function)
    radeon_accel.c:441: error: storage size of ?np2? isn?t known
    radeon_accel.c:443: error: ?RADEON_INFO_NUM_GB_PIPES? undeclared (first use in this function)
    radeon_accel.c:444: error: ?struct <anonymous>? has no member named ?dri?
    radeon_accel.c:444: error: ?DRM_RADEON_INFO? undeclared (first use in this function)
    radeon_accel.c:441: warning: unused variable ?np2?
    make[2]: *** [radeon_accel.lo] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    Seems like there should be used some #ifdef XF86DRI definition.


    The other patches modify some ifdefs and includes. I would be glad if someone could have a look at those patches.

    Regards,
    Martin

  • #2
    Maybe you should send this to the radeon mailing-list, since more developers will read it then.

    Comment


    • #3
      Hm, perhaps it's better if just few people look at the changes I made. The "--disable-xaa" target works, but the other changes are just some guesses I made when I tried to compile a driver without DRI support. I have only some very basic programming skills. My guess now is that DRI is a prerequisite for DRI2 to work.
      After I have seen some of the code it's no wonder to me now why there are so few developers working on the driver and X.org code, besides the fact that it's really low level and thus probably complicated: There are almost no comments in the code.

      Edit: Ok, that's not really true, there are some comments in the code. The function names and variable names speak sometimes for themselves. I guess I get a feeling why it takes some time to write useful code. I still have no idea how this all glues together. ;-)

      I tried to find some description for the DRI2 interface but didn't find anything useful (at least it wasn't useful for me). Perhaps there is some documentation somewhere but I couldn't find it. Compare this to the KDE documentation which seems to be in much better shape: KDE Library API Reference. Again I'm not a programmer it's just an impression I have.
      Last edited by MartinS; 05 December 2009, 08:29 PM.

      Comment


      • #4
        And another test run. This time I tried to compile only modesetting support without DRI(2) acceleration.

        X-Server (1.7.3) was compiled without XAA and without DRI.

        Here is the patch file: http://pastebin.com/m313218d

        I removed some r600 files in the Makefile because I have a r300 card and I just wanted to get the driver compile for that card.

        Here's the log:
        Code:
        Making all in src                       
          CC    ati.o                           
          CC    atimodule.o                     
          LINK  ati_drv.la                      
          CC    radeon_accel.o                  
          CC    radeon_cursor.o                 
          CC    radeon_legacy_memory.o          
          CC    radeon_driver.o                 
          CC    radeon_video.o                  
          CC    radeon_bios.o                   
          CC    radeon_mm_i2c.o                 
          CC    radeon_vip.o                    
          CC    radeon_misc.o                   
          CC    radeon_probe.o                  
        radeon_probe.c: In function ‘radeon_kernel_mode_enabled’:
        radeon_probe.c:102: warning: implicit declaration of function ‘DRICreatePCIBusID’
        radeon_probe.c:102: warning: assignment makes pointer from integer without a cast
          CC    legacy_crtc.o
          CC    legacy_output.o
          CC    radeon_textured_video.o
        In file included from radeon_textured_video.c:149:
        radeon_textured_videofuncs.c: In function ‘RADEONDisplayTexturedVideoMMIO’:
        radeon_textured_videofuncs.c:204: warning: implicit declaration of function ‘radeonGetPixmapOffset’
          CC    radeon_pm.o
          CC    radeon_crtc.o
          CC    radeon_output.o
          CC    radeon_modes.o
          CC    radeon_tv.o
          CC    radeon_exa.o
        radeon_exa.c: In function ‘RADEONGetPixmapOffsetPitch’:
        radeon_exa.c:202: warning: implicit declaration of function ‘radeonGetPixmapOffset’
        In file included from radeon_exa.c:544:
        radeon_exa_render.c: In function ‘RadeonDoneCompositeMMIO’:
        radeon_exa_render.c:2085: warning: implicit declaration of function ‘CP_PACKET3’
          CC    radeon_dri2.o
          CC    radeon_kms.o
        radeon_kms.c: In function ‘RADEONPreInit_KMS’:
        radeon_kms.c:452: warning: implicit declaration of function ‘DRICreatePCIBusID’
        radeon_kms.c:452: warning: assignment makes pointer from integer without a cast
          CC    drmmode_display.o
        drmmode_display.c:39:19: error: sarea.h: No such file or directory
        drmmode_display.c: In function ‘drmmode_pre_init’:
        drmmode_display.c:1147: warning: implicit declaration of function ‘DRIOpenDRMMaster’
        drmmode_display.c:1147: error: ‘SAREA_MAX’ undeclared (first use in this function)
        drmmode_display.c:1147: error: (Each undeclared identifier is reported only once
        drmmode_display.c:1147: error: for each function it appears in.)
        drmmode_display.c:1155: warning: implicit declaration of function ‘DRIMasterFD’
        make[2]: *** [drmmode_display.lo] Error 1
        make[1]: *** [all-recursive] Error 1
        make: *** [all] Error 2
        I think the first warning (the one about radeon_exa.c) can be ignored. The other warnings end errors are about functions which are implemented in the dri.h file.

        As a reference I tried to compile the Intel driver which also failed in the kms part because of missing DRI functions.

        So it looks like: no DRI == no KMS.

        Hm, I hope I'm not the only one interested in this topic... ;-)

        Update: I've compiled the patched driver with "--disable-dri" and it still seems to work as good/bad as before with kms enabled. X-Server was compiled with "--enabled-dri" and "--enable-dri2" this time.
        Last edited by MartinS; 05 December 2009, 11:37 PM.

        Comment


        • #5
          I have to admit I don't fully understand why compiling without DRI is important, unless you are willing to live with limited or no acceleration. There are ways to get 2D acceleration without DRI, but some degree of 3D acceleration seems like a must-have these days and you can't get both 2D and 3D without DRI.
          Test signature

          Comment


          • #6
            I have some problems with the new code. When I open a lot of new windows using KMS/DRI2 my system freezes for a split second (CPU at 100%, mouse cursor stutters, audio stutters). With DRI I don't have this problem but I don't know where to report this bug, because I don't know if it's the fault of the driver, xorg or if its mesa's fault.

            So I think I was a little bit naive here. I didn't know that DRI2 is not completely independent from DRI, so I thought perhaps those two things got in each other ways.

            The driver won't compile with the "--disable-dri" target, so removed that from configure.ac and made DRI a dependency.

            I've also fixed the following error:
            Code:
            RADEON(0): [dri] RADEONDRIGetVersion failed because of a version mismatch.
            [dri] radeon kernel module version is 2.0.0 but version 1.17.0 or newer is needed.
            Here is the patch for those things (version mismatch warning, make DRI a dependency, add "--disable-xaa" target): http://pastebin.com/m577d5891

            Comment

            Working...
            X