dri-r600: Hook up a drm_descriptor configuration function
authorMathias Fröhlich <Mathias.Froehlich@gmx.net>
Fri, 14 Oct 2011 14:25:21 +0000 (16:25 +0200)
committerMathias Fröhlich <Mathias.Froehlich@web.de>
Sun, 23 Oct 2011 07:08:18 +0000 (09:08 +0200)
Returns a configuration that makes the dri state-tracker-manager
throttle.

src/gallium/targets/dri-r600/target.c

index 3b7795b35076025d1f661952129f3f514b8f794b..9bff6f2058a14b254e5670cb0eefb5a5fd0cb0f9 100644 (file)
@@ -21,4 +21,20 @@ static struct pipe_screen *create_screen(int fd)
    return screen;
 }
 
-DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen, NULL)
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+      return &throttle_ret;
+   default:
+      break;
+   }
+   return NULL;
+}
+
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen, drm_configuration)