Mesa (master): dri-vmwgfx: Hook up a drm_descriptor configuration function

Thomas Hellstrom thomash at kemper.freedesktop.org
Fri Oct 14 00:55:39 PDT 2011


Module: Mesa
Branch: master
Commit: 83d57635bc7b8f837add26322da04e3d93da2c55
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=83d57635bc7b8f837add26322da04e3d93da2c55

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Wed Oct 12 10:44:37 2011 +0200

dri-vmwgfx: Hook up a drm_descriptor configuration function

Returns a configuration that makes the dri state-tracker-manager
throttle.
Also disable kernel-based throttling.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

---

 src/gallium/targets/dri-vmwgfx/target.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/gallium/targets/dri-vmwgfx/target.c b/src/gallium/targets/dri-vmwgfx/target.c
index fe3f8fd..442e31b 100644
--- a/src/gallium/targets/dri-vmwgfx/target.c
+++ b/src/gallium/targets/dri-vmwgfx/target.c
@@ -19,7 +19,7 @@ create_screen(int fd)
    if (!screen)
       return NULL;
 
-   vmw_winsys_screen_set_throttling(screen, 10);
+   vmw_winsys_screen_set_throttling(screen, 0);
    screen = sw_screen_wrap(screen);
 
    screen = debug_screen_wrap(screen);
@@ -27,4 +27,20 @@ create_screen(int fd)
    return screen;
 }
 
-DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", 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("vmwgfx", "vmwgfx", create_screen, drm_configuration)



More information about the mesa-commit mailing list