[Mesa-dev] [PATCH 08/23] targets/pipe-loader: add driver specific drm_configuration

Emil Velikov emil.l.velikov at gmail.com
Sun May 18 00:07:30 PDT 2014


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/targets/pipe-loader/pipe_nouveau.c  | 25 ++++++++++++++++++++++++-
 src/gallium/targets/pipe-loader/pipe_r300.c     | 25 ++++++++++++++++++++++++-
 src/gallium/targets/pipe-loader/pipe_r600.c     | 25 ++++++++++++++++++++++++-
 src/gallium/targets/pipe-loader/pipe_radeonsi.c | 25 ++++++++++++++++++++++++-
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c   | 25 ++++++++++++++++++++++++-
 5 files changed, 120 insertions(+), 5 deletions(-)

diff --git a/src/gallium/targets/pipe-loader/pipe_nouveau.c b/src/gallium/targets/pipe-loader/pipe_nouveau.c
index 65425e8..825b36f 100644
--- a/src/gallium/targets/pipe-loader/pipe_nouveau.c
+++ b/src/gallium/targets/pipe-loader/pipe_nouveau.c
@@ -17,5 +17,28 @@ create_screen(int fd)
    return screen;
 }
 
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret share_fd_ret = {
+   .type = DRM_CONF_BOOL,
+   .val.val_int = true,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+      return &throttle_ret;
+   case DRM_CONF_SHARE_FD:
+      return &share_fd_ret;
+   default:
+      break;
+   }
+   return NULL;
+}
+
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen, NULL)
+DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen, drm_configuration)
diff --git a/src/gallium/targets/pipe-loader/pipe_r300.c b/src/gallium/targets/pipe-loader/pipe_r300.c
index 6ab7e74..abcade4 100644
--- a/src/gallium/targets/pipe-loader/pipe_r300.c
+++ b/src/gallium/targets/pipe-loader/pipe_r300.c
@@ -13,5 +13,28 @@ create_screen(int fd)
    return sws ? debug_screen_wrap(sws->screen) : NULL;
 }
 
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret share_fd_ret = {
+   .type = DRM_CONF_BOOL,
+   .val.val_int = true,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+      return &throttle_ret;
+   case DRM_CONF_SHARE_FD:
+      return &share_fd_ret;
+   default:
+      break;
+   }
+   return NULL;
+}
+
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen, NULL)
+DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen, drm_configuration)
diff --git a/src/gallium/targets/pipe-loader/pipe_r600.c b/src/gallium/targets/pipe-loader/pipe_r600.c
index 2e6bd42..eb53637 100644
--- a/src/gallium/targets/pipe-loader/pipe_r600.c
+++ b/src/gallium/targets/pipe-loader/pipe_r600.c
@@ -13,5 +13,28 @@ create_screen(int fd)
    return rw ? debug_screen_wrap(rw->screen) : NULL;
 }
 
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret share_fd_ret = {
+   .type = DRM_CONF_BOOL,
+   .val.val_int = true,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+      return &throttle_ret;
+   case DRM_CONF_SHARE_FD:
+      return &share_fd_ret;
+   default:
+      break;
+   }
+   return NULL;
+}
+
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen, NULL)
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen, drm_configuration)
diff --git a/src/gallium/targets/pipe-loader/pipe_radeonsi.c b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
index 9a8feae..1dcd781 100644
--- a/src/gallium/targets/pipe-loader/pipe_radeonsi.c
+++ b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
@@ -13,5 +13,28 @@ create_screen(int fd)
    return rw ? debug_screen_wrap(rw->screen) : NULL;
 }
 
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret share_fd_ret = {
+   .type = DRM_CONF_BOOL,
+   .val.val_int = true,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+      return &throttle_ret;
+   case DRM_CONF_SHARE_FD:
+      return &share_fd_ret;
+   default:
+      break;
+   }
+   return NULL;
+}
+
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("radeonsi", "radeon", create_screen, NULL)
+DRM_DRIVER_DESCRIPTOR("radeonsi", "radeon", create_screen, drm_configuration)
diff --git a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
index 0e6cb3a..d31797f 100644
--- a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
+++ b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
@@ -26,5 +26,28 @@ create_screen(int fd)
    return screen;
 }
 
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret share_fd_ret = {
+   .type = DRM_CONF_BOOL,
+   .val.val_int = true,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+      return &throttle_ret;
+   case DRM_CONF_SHARE_FD:
+      return &share_fd_ret;
+   default:
+      break;
+   }
+   return NULL;
+}
+
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen, NULL)
+DRM_DRIVER_DESCRIPTOR("vmwgfx", "vmwgfx", create_screen, drm_configuration)
-- 
1.9.2



More information about the mesa-dev mailing list