summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-05-29 13:29:44 +0200
committerJakob Bornecrantz <[email protected]>2010-05-29 13:30:25 +0200
commit835f5a65a11ae9ca9f4b36ceb6656c77041ec901 (patch)
tree4b81ca16c858b9e61a70f9a05e2b067ce3d72f60
parentbbaaf823fa98c5c978aa10d61000485c10275f5a (diff)
i915g: Move pci id to winsys struct
-rw-r--r--src/gallium/drivers/i915/i915_screen.c9
-rw-r--r--src/gallium/drivers/i915/i915_screen.h1
-rw-r--r--src/gallium/drivers/i915/i915_winsys.h4
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_api.c4
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_winsys.h2
-rw-r--r--src/gallium/winsys/i915/sw/i915_sw_winsys.c4
-rw-r--r--src/gallium/winsys/i915/sw/i915_sw_winsys.h2
7 files changed, 11 insertions, 15 deletions
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 0897a863dbd..62b064ccf81 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -55,7 +55,7 @@ i915_get_name(struct pipe_screen *screen)
static char buffer[128];
const char *chipset;
- switch (i915_screen(screen)->pci_id) {
+ switch (i915_screen(screen)->iws->pci_id) {
case PCI_CHIP_I915_G:
chipset = "915G";
break;
@@ -271,14 +271,14 @@ i915_destroy_screen(struct pipe_screen *screen)
* Create a new i915_screen object
*/
struct pipe_screen *
-i915_create_screen(struct i915_winsys *iws, uint pci_id)
+i915_screen_create(struct i915_winsys *iws)
{
struct i915_screen *is = CALLOC_STRUCT(i915_screen);
if (!is)
return NULL;
- switch (pci_id) {
+ switch (iws->pci_id) {
case PCI_CHIP_I915_G:
case PCI_CHIP_I915_GM:
is->is_i945 = FALSE;
@@ -295,12 +295,11 @@ i915_create_screen(struct i915_winsys *iws, uint pci_id)
default:
debug_printf("%s: unknown pci id 0x%x, cannot create screen\n",
- __FUNCTION__, pci_id);
+ __FUNCTION__, iws->pci_id);
FREE(is);
return NULL;
}
- is->pci_id = pci_id;
is->iws = iws;
is->base.winsys = NULL;
diff --git a/src/gallium/drivers/i915/i915_screen.h b/src/gallium/drivers/i915/i915_screen.h
index 7f9e02fc0f6..0c4186c68ee 100644
--- a/src/gallium/drivers/i915/i915_screen.h
+++ b/src/gallium/drivers/i915/i915_screen.h
@@ -45,7 +45,6 @@ struct i915_screen
struct i915_winsys *iws;
boolean is_i945;
- uint pci_id;
};
/**
diff --git a/src/gallium/drivers/i915/i915_winsys.h b/src/gallium/drivers/i915/i915_winsys.h
index 8a6f579ad97..3aba19fe6a3 100644
--- a/src/gallium/drivers/i915/i915_winsys.h
+++ b/src/gallium/drivers/i915/i915_winsys.h
@@ -81,6 +81,8 @@ struct i915_winsys_batchbuffer {
struct i915_winsys {
+ unsigned pci_id; /**< PCI ID for the device */
+
/**
* Batchbuffer functions.
*/
@@ -224,7 +226,7 @@ struct i915_winsys {
/**
* Create i915 pipe_screen.
*/
-struct pipe_screen *i915_create_screen(struct i915_winsys *iws, unsigned pci_id);
+struct pipe_screen *i915_screen_create(struct i915_winsys *iws);
#endif
diff --git a/src/gallium/winsys/i915/drm/i915_drm_api.c b/src/gallium/winsys/i915/drm/i915_drm_api.c
index b95df40e86c..5a6b45e6c9f 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_api.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_api.c
@@ -65,7 +65,7 @@ i915_drm_create_screen(struct drm_api *api, int drmFD)
i915_drm_winsys_init_fence_functions(idws);
idws->fd = drmFD;
- idws->id = deviceID;
+ idws->base.pci_id = deviceID;
idws->max_batch_size = 16 * 4096;
idws->base.destroy = i915_drm_winsys_destroy;
@@ -75,7 +75,7 @@ i915_drm_create_screen(struct drm_api *api, int drmFD)
idws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE);
- return i915_create_screen(&idws->base, deviceID);
+ return i915_screen_create(&idws->base);
}
static struct drm_api i915_drm_api =
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.h b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
index 217c4a7eafb..99667bde4ef 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.h
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
@@ -21,8 +21,6 @@ struct i915_drm_winsys
int fd; /**< Drm file discriptor */
- unsigned id;
-
size_t max_batch_size;
struct {
diff --git a/src/gallium/winsys/i915/sw/i915_sw_winsys.c b/src/gallium/winsys/i915/sw/i915_sw_winsys.c
index a03875be5b3..bb1c107c056 100644
--- a/src/gallium/winsys/i915/sw/i915_sw_winsys.c
+++ b/src/gallium/winsys/i915/sw/i915_sw_winsys.c
@@ -46,11 +46,11 @@ i915_sw_create_screen()
isws->base.destroy = i915_sw_destroy;
- isws->id = deviceID;
+ isws->base.pci_id = deviceID;
isws->max_batch_size = 16 * 4096;
isws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE);
/* XXX so this will leak winsys:es */
- return i915_create_screen(&isws->base, deviceID);
+ return i915_screen_create(&isws->base);
}
diff --git a/src/gallium/winsys/i915/sw/i915_sw_winsys.h b/src/gallium/winsys/i915/sw/i915_sw_winsys.h
index 92e7c36fd8c..b8aa9ef4ac5 100644
--- a/src/gallium/winsys/i915/sw/i915_sw_winsys.h
+++ b/src/gallium/winsys/i915/sw/i915_sw_winsys.h
@@ -16,8 +16,6 @@ struct i915_sw_winsys
boolean dump_cmd;
- unsigned id;
-
size_t max_batch_size;
};