Merge branch '7.8'
authorMichel Dänzer <daenzer@vmware.com>
Fri, 23 Apr 2010 09:18:29 +0000 (11:18 +0200)
committerMichel Dänzer <michel@daenzer.net>
Fri, 23 Apr 2010 09:18:29 +0000 (11:18 +0200)
1  2 
src/glx/dri2_glx.c
src/mesa/drivers/dri/radeon/radeon_screen.c

diff --combined src/glx/dri2_glx.c
index 1faaf08f36606c6b4ed24f49ac202719c8d02426,fa2b98785376c4c2f43143dcdf25a24f8d05568c..9347611e7d8b5fb4de65d249c70dc9feb8d471e8
  #include "xf86drm.h"
  #include "dri2.h"
  #include "dri_common.h"
 -#include "../../mesa/drivers/dri/common/dri_util.h"
 +
 +/* From xmlpool/options.h, user exposed so should be stable */
 +#define DRI_CONF_VBLANK_NEVER 0
 +#define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
 +#define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
 +#define DRI_CONF_VBLANK_ALWAYS_SYNC 3
  
  #undef DRI2_MINOR
  #define DRI2_MINOR 1
@@@ -182,7 -177,6 +182,7 @@@ dri2CreateDrawable(__GLXscreenConfigs 
     __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
     __GLXdisplayPrivate *dpyPriv;
     __GLXDRIdisplayPrivate *pdp;
 +   GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
  
     pdraw = Xmalloc(sizeof(*pdraw));
     if (!pdraw)
     pdraw->base.drawable = drawable;
     pdraw->base.psc = psc;
     pdraw->bufferCount = 0;
 -   pdraw->swap_interval = 1;
 +   pdraw->swap_interval = 1; /* default may be overridden below */
 +
 +   if (psc->config)
 +      psc->config->configQueryi(psc->__driScreen, "vblank_mode", &vblank_mode);
 +
 +   switch (vblank_mode) {
 +   case DRI_CONF_VBLANK_NEVER:
 +   case DRI_CONF_VBLANK_DEF_INTERVAL_0:
 +      pdraw->swap_interval = 0;
 +      break;
 +   case DRI_CONF_VBLANK_DEF_INTERVAL_1:
 +   case DRI_CONF_VBLANK_ALWAYS_SYNC:
 +   default:
 +      pdraw->swap_interval = 1;
 +      break;
 +   }
  
     DRI2CreateDrawable(psc->dpy, xDrawable);
  
        return NULL;
     }
  
+ #ifdef X_DRI2SwapInterval
     /*
      * Make sure server has the same swap interval we do for the new
      * drawable.
      */
     if (pdp->swapAvailable)
        DRI2SwapInterval(psc->dpy, xDrawable, pdraw->swap_interval);
+ #endif
  
     return &pdraw->base;
  }
@@@ -495,23 -476,7 +497,23 @@@ dri2GetBuffersWithFormat(__DRIdrawable 
  static void
  dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
  {
 +   __GLXscreenConfigs *psc = pdraw->psc;
     __GLXDRIdrawablePrivate *priv =  (__GLXDRIdrawablePrivate *) pdraw;
 +   GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
 +
 +   if (psc->config)
 +      psc->config->configQueryi(psc->__driScreen, "vblank_mode", &vblank_mode);
 +
 +   switch (vblank_mode) {
 +   case DRI_CONF_VBLANK_NEVER:
 +      return;
 +   case DRI_CONF_VBLANK_ALWAYS_SYNC:
 +      if (interval <= 0)
 +       return;
 +      break;
 +   default:
 +      break;
 +   }
  
     DRI2SwapInterval(priv->base.psc->dpy, pdraw->xDrawable, interval);
     priv->swap_interval = interval;
index f8dc814ff0127892ad2f8f6db3b5646897202450,f2a51868b255a2dd95d7c42abd22fca6e63e4d77..4f59511a528218684bd3f3dffc2341835ee190e8
@@@ -516,7 -516,6 +516,7 @@@ static int radeon_set_screen_flags(rade
     case PCI_CHIP_RV380_3150:
     case PCI_CHIP_RV380_3152:
     case PCI_CHIP_RV380_3154:
 +   case PCI_CHIP_RV380_3155:
     case PCI_CHIP_RV380_3E50:
     case PCI_CHIP_RV380_3E54:
        screen->chip_family = CHIP_FAMILY_RV380;
@@@ -1137,6 -1136,7 +1137,7 @@@ radeonCreateScreen( __DRIscreen *sPriv 
         /* pipe overrides */
         switch (dri_priv->deviceID) {
         case PCI_CHIP_R300_AD: /* 9500 with 1 quadpipe verified by: Reid Linnemann <lreid@cs.okstate.edu> */
+        case PCI_CHIP_R350_AH: /* 9800 SE only have 1 quadpipe */
         case PCI_CHIP_RV410_5E4C: /* RV410 SE only have 1 quadpipe */
         case PCI_CHIP_RV410_5E4F: /* RV410 SE only have 1 quadpipe */
           screen->num_gb_pipes = 1;
     screen->extensions[i++] = &r600texOffsetExtension.base;
  #endif
  
 +   screen->extensions[i++] = &dri2ConfigQueryExtension.base;
 +
     screen->extensions[i++] = NULL;
     sPriv->extensions = screen->extensions;
  
@@@ -1346,6 -1344,7 +1347,7 @@@ radeonCreateScreen2(__DRIscreen *sPriv
         /* pipe overrides */
         switch (device_id) {
         case PCI_CHIP_R300_AD: /* 9500 with 1 quadpipe verified by: Reid Linnemann <lreid@cs.okstate.edu> */
+        case PCI_CHIP_R350_AH: /* 9800 SE only have 1 quadpipe */
         case PCI_CHIP_RV410_5E4C: /* RV410 SE only have 1 quadpipe */
         case PCI_CHIP_RV410_5E4F: /* RV410 SE only have 1 quadpipe */
           screen->num_gb_pipes = 1;