Hi,

the attached patch enables opengl client side throtteling for r600g that 
recently slipped in as an infrastructure but is just enabled for vmgfx so far.

The benefits of the client side throtteling are great, since a single render 
intensive application is no longer able to just saturate the kernels radeon 
command buffer. In the default dri configuration the X servers swap response 
also helps for this case, but if this type of throtteling is disabled, client 
side throtteling just throttles the right application.
... I had that kind of fence based implementation on my todo for some time now 
but never got to that. Thanks for providing this!

Please review the attached patch.

Thanks

Mathias
From c351ea49d7b8ac76b6d83441fb423940d049ef4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mathias=20Fr=C3=B6hlich?= <[email protected]>
Date: Fri, 14 Oct 2011 16:25:21 +0200
Subject: [PATCH] dri-r600: Hook up a drm_descriptor configuration function

Returns a configuration that makes the dri state-tracker-manager
throttle.
---
 src/gallium/targets/dri-r600/target.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/gallium/targets/dri-r600/target.c b/src/gallium/targets/dri-r600/target.c
index 3b7795b..9bff6f2 100644
--- a/src/gallium/targets/dri-r600/target.c
+++ b/src/gallium/targets/dri-r600/target.c
@@ -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)
-- 
1.7.4.4

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to