remove code dealing with drmMinor version < 6 since all radeon drivers request at...
authorRoland Scheidegger <rscheidegger@gmx.ch>
Fri, 2 Jun 2006 01:52:54 +0000 (01:52 +0000)
committerRoland Scheidegger <rscheidegger@gmx.ch>
Fri, 2 Jun 2006 01:52:54 +0000 (01:52 +0000)
src/mesa/drivers/dri/r200/r200_cmdbuf.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_ioctl.c
src/mesa/drivers/dri/r200/r200_pixel.c
src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_ioctl.c
src/mesa/drivers/dri/radeon/radeon_ioctl.h

index 2122d16dcbefd8557afe8cc699d81b5ea49c1fd5..6ce68708940a7afb676700ef3fd7ed37993c82fa 100644 (file)
@@ -412,15 +412,13 @@ void r200EmitBlit( r200ContextPtr rmesa,
 
 void r200EmitWait( r200ContextPtr rmesa, GLuint flags )
 {
-   if (rmesa->dri.drmMinor >= 6) {
-      drm_radeon_cmd_header_t *cmd;
-
-      assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) );
-      
-      cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, 1 * sizeof(int),
-                                                  __FUNCTION__ );
-      cmd[0].i = 0;
-      cmd[0].wait.cmd_type = RADEON_CMD_WAIT;
-      cmd[0].wait.flags = flags;
-   }
+   drm_radeon_cmd_header_t *cmd;
+
+   assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) );
+
+   cmd = (drm_radeon_cmd_header_t *)r200AllocCmdBuf( rmesa, 1 * sizeof(int),
+                                          __FUNCTION__ );
+   cmd[0].i = 0;
+   cmd[0].wait.cmd_type = RADEON_CMD_WAIT;
+   cmd[0].wait.flags = flags;
 }
index aaaaa5a95bfb5bfc0f4aff05ecd68b00ccb7430f..24f0ea551020f0b3996827ee82c29f60532ba24c 100644 (file)
@@ -494,17 +494,15 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
    fthrottle_mode = driQueryOptioni(&rmesa->optionCache, "fthrottle_mode");
    rmesa->iw.irq_seq = -1;
    rmesa->irqsEmitted = 0;
-   rmesa->do_irqs = (rmesa->dri.drmMinor >= 6 && 
-                    fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS &&
+   rmesa->do_irqs = (fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS &&
                     rmesa->r200Screen->irq);
 
    rmesa->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
 
    if (!rmesa->do_irqs)
       fprintf(stderr,
-             "IRQ's not enabled, falling back to %s: %d %d %d\n",
+             "IRQ's not enabled, falling back to %s: %d %d\n",
              rmesa->do_usleeps ? "usleeps" : "busy waits",
-             rmesa->dri.drmMinor,
              fthrottle_mode,
              rmesa->r200Screen->irq);
 
index fcbb307177bcc0672b080bf1a3f9847e2ed4c6ca..650d7cfdf2bc0e0f1a23d510a2f7e4c0e020b0da 100644 (file)
@@ -870,10 +870,7 @@ void *r200AllocateMemoryMESA(__DRInativeDisplay *dpy, int scrn, GLsizei size,
 
    if (getenv("R200_NO_ALLOC"))
       return NULL;
-   
-   if (rmesa->dri.drmMinor < 6) 
-      return NULL;
-      
+
    alloc.region = RADEON_MEM_REGION_GART;
    alloc.alignment = 0;
    alloc.size = size;
@@ -912,9 +909,6 @@ void r200FreeMemoryMESA(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer)
       return;
    }
 
-   if (rmesa->dri.drmMinor < 6) 
-      return;
-
    region_offset = (char *)pointer - (char *)rmesa->r200Screen->gartTextures.map;
 
    if (region_offset < 0 || 
@@ -950,9 +944,6 @@ GLuint r200GetMemoryOffsetMESA(__DRInativeDisplay *dpy, int scrn, const GLvoid *
    if (!r200IsGartMemory( rmesa, pointer, 0 ))
       return ~0;
 
-   if (rmesa->dri.drmMinor < 6) 
-      return ~0;
-
    card_offset = r200GartOffsetFromVirtual( rmesa, pointer );
 
    return card_offset - rmesa->r200Screen->gart_base;
index c3489b6c621a20afa523757b63a041c8eaa4fa87..1f711bbee5a0b9bc0aff2cd048091824899fd375 100644 (file)
@@ -490,7 +490,7 @@ void r200InitPixelFuncs( GLcontext *ctx )
    ctx->Driver.DrawPixels = _swrast_DrawPixels;
    ctx->Driver.ReadPixels = _swrast_ReadPixels;
 
-   if (!getenv("R200_NO_BLITS") && R200_CONTEXT(ctx)->dri.drmMinor >= 6) {
+   if (!getenv("R200_NO_BLITS")) {
       ctx->Driver.ReadPixels = r200ReadPixels;  
       ctx->Driver.DrawPixels = r200DrawPixels; 
       if (getenv("R200_HW_BITMAP")) 
index 159285962d2aab5823db4cc8ea999fb83f6d113b..2a2eef58120a209bf79edc8144a62d8327fb5f6b 100644 (file)
@@ -875,9 +875,6 @@ GLuint r300GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn,
        if (!r300IsGartMemory(rmesa, pointer, 0))
                return ~0;
 
-       if (rmesa->radeon.dri.drmMinor < 6)
-               return ~0;
-
        card_offset = r300GartOffsetFromVirtual(rmesa, pointer);
 
        return card_offset - rmesa->radeon.radeonScreen->gart_base;
index 0147c6492e537c23342729f6bcf3d9f6049e178a..4172fbcf83432371ee9fef6006165369e0bad204 100644 (file)
@@ -175,17 +175,15 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
        fthrottle_mode = driQueryOptioni(&radeon->optionCache, "fthrottle_mode");
        radeon->iw.irq_seq = -1;
        radeon->irqsEmitted = 0;
-       radeon->do_irqs = (radeon->dri.drmMinor >= 6 &&
-                         fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS &&
+       radeon->do_irqs = (fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS &&
                          radeon->radeonScreen->irq);
 
        radeon->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
 
        if (!radeon->do_irqs)
                fprintf(stderr,
-                       "IRQ's not enabled, falling back to %s: %d %d %d\n",
+                       "IRQ's not enabled, falling back to %s: %d %d\n",
                        radeon->do_usleeps ? "usleeps" : "busy waits",
-                       radeon->dri.drmMinor,
                        fthrottle_mode, radeon->radeonScreen->irq);
 
        radeon->vblank_flags = (radeon->radeonScreen->irq != 0)
index 8ef35a9ac63aacd235452f96e565975ef9f9b93a..aee849e13bfbe0cd32cbee07a6eaf64568dfe466 100644 (file)
@@ -521,17 +521,15 @@ void radeonEmitBlit( radeonContextPtr rmesa, /* FIXME: which drmMinor is require
 
 void radeonEmitWait( radeonContextPtr rmesa, GLuint flags )
 {
-   if (rmesa->dri.drmMinor >= 6) {
-      drm_radeon_cmd_header_t *cmd;
+   drm_radeon_cmd_header_t *cmd;
 
-      assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) );
-      
-      cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, 1 * sizeof(int),
-                                                  __FUNCTION__ );
-      cmd[0].i = 0;
-      cmd[0].wait.cmd_type = RADEON_CMD_WAIT;
-      cmd[0].wait.flags = flags;
-   }
+   assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) );
+
+   cmd = (drm_radeon_cmd_header_t *)radeonAllocCmdBuf( rmesa, 1 * sizeof(int),
+                                          __FUNCTION__ );
+   cmd[0].i = 0;
+   cmd[0].wait.cmd_type = RADEON_CMD_WAIT;
+   cmd[0].wait.flags = flags;
 }
 
 
@@ -782,25 +780,15 @@ void radeonAllocDmaRegion( radeonContextPtr rmesa,
 
 static u_int32_t radeonGetLastFrame (radeonContextPtr rmesa) 
 {
-   unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map;
+   drm_radeon_getparam_t gp;
    int ret;
    u_int32_t frame;
 
-   if (rmesa->dri.screen->drmMinor >= 4) {
-      drm_radeon_getparam_t gp;
+   gp.param = RADEON_PARAM_LAST_FRAME;
+   gp.value = (int *)&frame;
+   ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_GETPARAM,
+                             &gp, sizeof(gp) );
 
-      gp.param = RADEON_PARAM_LAST_FRAME;
-      gp.value = (int *)&frame;
-      ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_GETPARAM,
-                                &gp, sizeof(gp) );
-   } 
-   else
-      ret = -EINVAL;
-
-   if ( ret == -EINVAL ) {
-      frame = INREG( RADEON_LAST_FRAME_REG );
-      ret = 0;
-   } 
    if ( ret ) {
       fprintf( stderr, "%s: drm_radeon_getparam_t: %d\n", __FUNCTION__, ret );
       exit(1);
@@ -1039,7 +1027,6 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
    radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
    __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
    drm_radeon_sarea_t *sarea = rmesa->sarea;
-   unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map;
    u_int32_t clear;
    GLuint flags = 0;
    GLuint color_mask = 0;
@@ -1111,29 +1098,17 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
     */
    while ( 1 ) {
       int ret;
+      drm_radeon_getparam_t gp;
 
-      if (rmesa->dri.screen->drmMinor >= 4) {
-       drm_radeon_getparam_t gp;
-
-       gp.param = RADEON_PARAM_LAST_CLEAR;
-       gp.value = (int *)&clear;
-       ret = drmCommandWriteRead( rmesa->dri.fd,
-                                  DRM_RADEON_GETPARAM, &gp, sizeof(gp) );
-      } else
-       ret = -EINVAL;
+      gp.param = RADEON_PARAM_LAST_CLEAR;
+      gp.value = (int *)&clear;
+      ret = drmCommandWriteRead( rmesa->dri.fd,
+                                DRM_RADEON_GETPARAM, &gp, sizeof(gp) );
 
-      if ( ret == -EINVAL ) {
-        clear = INREG( RADEON_LAST_CLEAR_REG );
-        ret = 0;
-      }
       if ( ret ) {
         fprintf( stderr, "%s: drm_radeon_getparam_t: %d\n", __FUNCTION__, ret );
         exit(1);
       }
-      if ( RADEON_DEBUG & DEBUG_IOCTL ) {
-        fprintf( stderr, "%s( %d )\n", __FUNCTION__, (int)clear );
-        if ( ret ) fprintf( stderr, " ( RADEON_LAST_CLEAR register read directly )\n" );
-      }
 
       if ( sarea->last_clear - clear <= RADEON_MAX_CLEARS ) {
         break;
index 335ed77c9ad9b9b1e6d979da559216d1b8687fba..11a7d02b1b7a0b8582adc9f1d36608fe165dbf6a 100644 (file)
@@ -192,8 +192,6 @@ static __inline char *radeonAllocCmdBuf( radeonContextPtr rmesa,
 {
    if (rmesa->store.cmd_used + bytes > RADEON_CMD_BUF_SZ)
       radeonFlushCmdBuf( rmesa, __FUNCTION__ );
-   
-   assert(rmesa->dri.drmMinor >= 3);
 
    {
       char *head = rmesa->store.cmd_buf + rmesa->store.cmd_used;