targets/pipe-loader: add driver specific drm_configuration
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 17 May 2014 17:53:36 +0000 (18:53 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 19 Jun 2014 11:37:14 +0000 (12:37 +0100)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gallium/targets/pipe-loader/pipe_nouveau.c
src/gallium/targets/pipe-loader/pipe_r300.c
src/gallium/targets/pipe-loader/pipe_r600.c
src/gallium/targets/pipe-loader/pipe_radeonsi.c
src/gallium/targets/pipe-loader/pipe_vmwgfx.c

index 65425e8d45694797d671df1d46df9b6eebb57c9c..825b36f602e1856bc32726649938e5c8cd268e5f 100644 (file)
@@ -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)
index 6ab7e7491f983bf5470f0d9b4669c24ef2ce0a4b..abcade462399d324a39cbd33464c5e465f624250 100644 (file)
@@ -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)
index 2e6bd42c22d2fc88981862bba01f565689b6a9aa..eb53637d489157e7aefd52d8e96d354f220f6335 100644 (file)
@@ -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)
index 9a8feae0f0083dfe89bad8af77474847b330f3e1..1dcd781e63afcd418542675123970797e6fe6cb7 100644 (file)
@@ -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)
index bfe665be6eb703869825f15c1749d8fc80dbc843..71015dfadb79aaab965a4deb66bafdbcd13391ae 100644 (file)
@@ -23,5 +23,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)