i965g: Rename winsys file
authorJakob Bornecrantz <jakob@vmware.com>
Wed, 23 Jun 2010 00:41:49 +0000 (02:41 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Wed, 23 Jun 2010 01:20:45 +0000 (03:20 +0200)
src/gallium/winsys/i965/drm/Makefile
src/gallium/winsys/i965/drm/SConscript
src/gallium/winsys/i965/drm/i965_drm_api.c [deleted file]
src/gallium/winsys/i965/drm/i965_drm_winsys.c [new file with mode: 0644]

index bbb71e25d84ed184696883e4f3613c0595c2163b..46f98d7a24afa0f6a1cefe12abc75f8365c8d777 100644 (file)
@@ -5,7 +5,7 @@ LIBNAME = i965drm
 
 C_SOURCES = \
        i965_drm_buffer.c \
-       i965_drm_api.c
+       i965_drm_winsys.c
 
 LIBRARY_INCLUDES = $(shell pkg-config libdrm --cflags-only-I)
 
index abf9aac5c012fa088c62505fa557bba07860cc95..785be449f70ea50d91b54540e4d7a013f888eba1 100644 (file)
@@ -5,8 +5,8 @@ env = env.Clone()
 env.ParseConfig('pkg-config --cflags libdrm')
 
 i965drm_sources = [
-    'i965_drm_api.c',
     'i965_drm_buffer.c',
+    'i965_drm_winsys.c',
 ]
 
 i965drm = env.ConvenienceLibrary(
diff --git a/src/gallium/winsys/i965/drm/i965_drm_api.c b/src/gallium/winsys/i965/drm/i965_drm_api.c
deleted file mode 100644 (file)
index 124dc26..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-
-#include <stdio.h>
-#include "state_tracker/drm_api.h"
-
-#include "i965_drm_winsys.h"
-#include "util/u_memory.h"
-
-#include "i965/brw_context.h"        /* XXX: shouldn't be doing this */
-#include "i965/brw_screen.h"         /* XXX: shouldn't be doing this */
-
-#include "trace/tr_drm.h"
-
-#include "../../sw/drm/sw_drm_api.h"
-
-/*
- * Helper functions
- */
-
-
-static void
-i965_libdrm_get_device_id(unsigned int *device_id)
-{
-   char path[512];
-   FILE *file;
-   void *shutup_gcc;
-
-   /*
-    * FIXME: Fix this up to use a drm ioctl or whatever.
-    */
-
-   snprintf(path, sizeof(path), "/sys/class/drm/card0/device/device");
-   file = fopen(path, "r");
-   if (!file) {
-      return;
-   }
-
-   shutup_gcc = fgets(path, sizeof(path), file);
-   sscanf(path, "%x", device_id);
-   fclose(file);
-}
-
-static void
-i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws)
-{
-   struct i965_libdrm_winsys *idws = i965_libdrm_winsys(iws);
-
-   if (BRW_DUMP)
-      debug_printf("%s\n", __FUNCTION__);
-
-   drm_intel_bufmgr_destroy(idws->gem);
-
-   FREE(idws);
-}
-
-static struct pipe_screen *
-i965_libdrm_create_screen(struct drm_api *api, int drmFD)
-{
-   struct i965_libdrm_winsys *idws;
-
-   debug_printf("%s\n", __FUNCTION__);
-
-   idws = CALLOC_STRUCT(i965_libdrm_winsys);
-   if (!idws)
-      return NULL;
-
-   i965_libdrm_get_device_id(&idws->base.pci_id);
-
-   i965_libdrm_winsys_init_buffer_functions(idws);
-
-   idws->fd = drmFD;
-
-   idws->base.destroy = i965_libdrm_winsys_destroy;
-
-   idws->gem = drm_intel_bufmgr_gem_init(idws->fd, BRW_BATCH_SIZE);
-   drm_intel_bufmgr_gem_enable_reuse(idws->gem);
-
-   idws->send_cmd = !debug_get_bool_option("BRW_NO_HW", FALSE);
-
-   return brw_create_screen(&idws->base);
-}
-
-struct drm_api i965_libdrm_api =
-{
-   .name = "i965",
-   .driver_name = "i915",
-   .create_screen = i965_libdrm_create_screen,
-   .destroy = NULL,
-};
-
-struct drm_api *
-drm_api_create()
-{
-   struct drm_api *api = NULL;
-
-   if (api == NULL && debug_get_bool_option("BRW_SOFTPIPE", FALSE))
-      api = sw_drm_api_create(&i965_libdrm_api);
-
-   if (api == NULL)
-      api = &i965_libdrm_api;
-
-   return trace_drm_create(api);
-}
diff --git a/src/gallium/winsys/i965/drm/i965_drm_winsys.c b/src/gallium/winsys/i965/drm/i965_drm_winsys.c
new file mode 100644 (file)
index 0000000..124dc26
--- /dev/null
@@ -0,0 +1,102 @@
+
+#include <stdio.h>
+#include "state_tracker/drm_api.h"
+
+#include "i965_drm_winsys.h"
+#include "util/u_memory.h"
+
+#include "i965/brw_context.h"        /* XXX: shouldn't be doing this */
+#include "i965/brw_screen.h"         /* XXX: shouldn't be doing this */
+
+#include "trace/tr_drm.h"
+
+#include "../../sw/drm/sw_drm_api.h"
+
+/*
+ * Helper functions
+ */
+
+
+static void
+i965_libdrm_get_device_id(unsigned int *device_id)
+{
+   char path[512];
+   FILE *file;
+   void *shutup_gcc;
+
+   /*
+    * FIXME: Fix this up to use a drm ioctl or whatever.
+    */
+
+   snprintf(path, sizeof(path), "/sys/class/drm/card0/device/device");
+   file = fopen(path, "r");
+   if (!file) {
+      return;
+   }
+
+   shutup_gcc = fgets(path, sizeof(path), file);
+   sscanf(path, "%x", device_id);
+   fclose(file);
+}
+
+static void
+i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws)
+{
+   struct i965_libdrm_winsys *idws = i965_libdrm_winsys(iws);
+
+   if (BRW_DUMP)
+      debug_printf("%s\n", __FUNCTION__);
+
+   drm_intel_bufmgr_destroy(idws->gem);
+
+   FREE(idws);
+}
+
+static struct pipe_screen *
+i965_libdrm_create_screen(struct drm_api *api, int drmFD)
+{
+   struct i965_libdrm_winsys *idws;
+
+   debug_printf("%s\n", __FUNCTION__);
+
+   idws = CALLOC_STRUCT(i965_libdrm_winsys);
+   if (!idws)
+      return NULL;
+
+   i965_libdrm_get_device_id(&idws->base.pci_id);
+
+   i965_libdrm_winsys_init_buffer_functions(idws);
+
+   idws->fd = drmFD;
+
+   idws->base.destroy = i965_libdrm_winsys_destroy;
+
+   idws->gem = drm_intel_bufmgr_gem_init(idws->fd, BRW_BATCH_SIZE);
+   drm_intel_bufmgr_gem_enable_reuse(idws->gem);
+
+   idws->send_cmd = !debug_get_bool_option("BRW_NO_HW", FALSE);
+
+   return brw_create_screen(&idws->base);
+}
+
+struct drm_api i965_libdrm_api =
+{
+   .name = "i965",
+   .driver_name = "i915",
+   .create_screen = i965_libdrm_create_screen,
+   .destroy = NULL,
+};
+
+struct drm_api *
+drm_api_create()
+{
+   struct drm_api *api = NULL;
+
+   if (api == NULL && debug_get_bool_option("BRW_SOFTPIPE", FALSE))
+      api = sw_drm_api_create(&i965_libdrm_api);
+
+   if (api == NULL)
+      api = &i965_libdrm_api;
+
+   return trace_drm_create(api);
+}