summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-06-23 02:28:47 +0200
committerJakob Bornecrantz <jakob@vmware.com>2010-06-23 03:20:45 +0200
commit2b15e37348ca234c5a3352db55babb7bd293b708 (patch)
tree0f057262c74b92f9a4965f7885575127a6453233
parentbd739e95763d8051679649cc44d16d4fcbb0fec1 (diff)
i965g: Moved pci_id to winsys struct
-rw-r--r--src/gallium/drivers/i965/brw_screen.c8
-rw-r--r--src/gallium/drivers/i965/brw_winsys.h3
-rw-r--r--src/gallium/winsys/i965/drm/i965_drm_api.c6
-rw-r--r--src/gallium/winsys/i965/drm/i965_drm_buffer.c4
-rw-r--r--src/gallium/winsys/i965/drm/i965_drm_winsys.h2
-rw-r--r--src/gallium/winsys/i965/xlib/xlib_i965.c3
6 files changed, 12 insertions, 14 deletions
diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c
index 50a446db91..eb75427eb4 100644
--- a/src/gallium/drivers/i965/brw_screen.c
+++ b/src/gallium/drivers/i965/brw_screen.c
@@ -350,7 +350,7 @@ brw_destroy_screen(struct pipe_screen *screen)
* Create a new brw_screen object
*/
struct pipe_screen *
-brw_create_screen(struct brw_winsys_screen *sws, uint pci_id)
+brw_create_screen(struct brw_winsys_screen *sws)
{
struct brw_screen *bscreen;
struct brw_chipset chipset;
@@ -365,9 +365,9 @@ brw_create_screen(struct brw_winsys_screen *sws, uint pci_id)
memset(&chipset, 0, sizeof chipset);
- chipset.pci_id = pci_id;
+ chipset.pci_id = sws->pci_id;
- switch (pci_id) {
+ switch (chipset.pci_id) {
case PCI_CHIP_I965_G:
case PCI_CHIP_I965_Q:
case PCI_CHIP_I965_G_1:
@@ -393,7 +393,7 @@ brw_create_screen(struct brw_winsys_screen *sws, uint pci_id)
default:
debug_printf("%s: unknown pci id 0x%x, cannot create screen\n",
- __FUNCTION__, pci_id);
+ __FUNCTION__, chipset.pci_id);
return NULL;
}
diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h
index f30c7f1813..adb0006c38 100644
--- a/src/gallium/drivers/i965/brw_winsys.h
+++ b/src/gallium/drivers/i965/brw_winsys.h
@@ -147,6 +147,7 @@ static INLINE void make_reloc(struct brw_winsys_reloc *reloc,
struct brw_winsys_screen {
+ unsigned pci_id;
/**
* Buffer functions.
@@ -264,7 +265,7 @@ bo_reference(struct brw_winsys_buffer **ptr, struct brw_winsys_buffer *buf)
/**
* Create brw pipe_screen.
*/
-struct pipe_screen *brw_create_screen(struct brw_winsys_screen *iws, unsigned pci_id);
+struct pipe_screen *brw_create_screen(struct brw_winsys_screen *iws);
diff --git a/src/gallium/winsys/i965/drm/i965_drm_api.c b/src/gallium/winsys/i965/drm/i965_drm_api.c
index 87ee8070b1..124dc26606 100644
--- a/src/gallium/winsys/i965/drm/i965_drm_api.c
+++ b/src/gallium/winsys/i965/drm/i965_drm_api.c
@@ -56,7 +56,6 @@ static struct pipe_screen *
i965_libdrm_create_screen(struct drm_api *api, int drmFD)
{
struct i965_libdrm_winsys *idws;
- unsigned int deviceID;
debug_printf("%s\n", __FUNCTION__);
@@ -64,12 +63,11 @@ i965_libdrm_create_screen(struct drm_api *api, int drmFD)
if (!idws)
return NULL;
- i965_libdrm_get_device_id(&deviceID);
+ i965_libdrm_get_device_id(&idws->base.pci_id);
i965_libdrm_winsys_init_buffer_functions(idws);
idws->fd = drmFD;
- idws->id = deviceID;
idws->base.destroy = i965_libdrm_winsys_destroy;
@@ -78,7 +76,7 @@ i965_libdrm_create_screen(struct drm_api *api, int drmFD)
idws->send_cmd = !debug_get_bool_option("BRW_NO_HW", FALSE);
- return brw_create_screen(&idws->base, deviceID);
+ return brw_create_screen(&idws->base);
}
struct drm_api i965_libdrm_api =
diff --git a/src/gallium/winsys/i965/drm/i965_drm_buffer.c b/src/gallium/winsys/i965/drm/i965_drm_buffer.c
index fb5e50ce81..9e9d59d5b4 100644
--- a/src/gallium/winsys/i965/drm/i965_drm_buffer.c
+++ b/src/gallium/winsys/i965/drm/i965_drm_buffer.c
@@ -322,7 +322,7 @@ i965_libdrm_bo_subdata(struct brw_winsys_buffer *buffer,
nr_reloc);
if (BRW_DUMP)
- brw_dump_data( idws->id,
+ brw_dump_data( idws->base.pci_id,
data_type,
buf->bo->offset + offset,
data, size );
@@ -460,7 +460,7 @@ i965_libdrm_bo_flush_range(struct brw_winsys_buffer *buffer,
offset, length);
if (BRW_DUMP)
- brw_dump_data( idws->id,
+ brw_dump_data( idws->base.pci_id,
buf->data_type,
buf->bo->offset + offset,
(char*)buf->bo->virtual + offset,
diff --git a/src/gallium/winsys/i965/drm/i965_drm_winsys.h b/src/gallium/winsys/i965/drm/i965_drm_winsys.h
index c6a7d4a8c5..3856e1c87f 100644
--- a/src/gallium/winsys/i965/drm/i965_drm_winsys.h
+++ b/src/gallium/winsys/i965/drm/i965_drm_winsys.h
@@ -22,8 +22,6 @@ struct i965_libdrm_winsys
boolean send_cmd;
int fd; /**< Drm file discriptor */
-
- unsigned id;
};
static INLINE struct i965_libdrm_winsys *
diff --git a/src/gallium/winsys/i965/xlib/xlib_i965.c b/src/gallium/winsys/i965/xlib/xlib_i965.c
index 063e9f600b..baadd6e89c 100644
--- a/src/gallium/winsys/i965/xlib/xlib_i965.c
+++ b/src/gallium/winsys/i965/xlib/xlib_i965.c
@@ -395,6 +395,7 @@ xlib_create_brw_winsys_screen( void )
return NULL;
ws->used = 0;
+ ws->base.pci_id = PCI_CHIP_GM45_GM;
ws->base.destroy = xlib_brw_winsys_destroy;
ws->base.bo_alloc = xlib_brw_bo_alloc;
@@ -452,7 +453,7 @@ xlib_create_i965_screen( void )
if (winsys == NULL)
return NULL;
- screen = brw_create_screen(winsys, PCI_CHIP_GM45_GM);
+ screen = brw_create_screen(winsys);
if (screen == NULL)
goto fail;