summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-03-03 21:14:33 -0800
committerCorbin Simpson <[email protected]>2009-03-03 22:16:24 -0800
commit9e67b0a1745e50fe34efedb0a3191b4a27e10724 (patch)
tree8179c969551ccc59b0402bd4ac8d558fb43734d2 /src/gallium/drivers/r300
parenta255472ee789d13c07174e385c7d40f965916e7b (diff)
r300-gallium, radeon-gallium: Begin migration to DRI2 state tracker, part 1.
s/migration/migrane/ , actually. Anyway, this has working glxinfo...
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_context.c7
-rw-r--r--src/gallium/drivers/r300/r300_context.h1
-rw-r--r--src/gallium/drivers/r300/r300_screen.c5
-rw-r--r--src/gallium/drivers/r300/r300_screen.h3
-rw-r--r--src/gallium/drivers/r300/r300_winsys.h11
5 files changed, 13 insertions, 14 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index a9811501435..653d919ef1d 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -103,7 +103,6 @@ static void r300_destroy_context(struct pipe_context* context) {
}
struct pipe_context* r300_create_context(struct pipe_screen* screen,
- struct pipe_winsys* winsys,
struct r300_winsys* r300_winsys)
{
struct r300_context* r300 = CALLOC_STRUCT(r300_context);
@@ -111,9 +110,11 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
if (!r300)
return NULL;
+ /* XXX this could be refactored now? */
r300->winsys = r300_winsys;
- r300->context.winsys = winsys;
- r300->context.screen = r300_create_screen(winsys, r300_winsys);
+
+ r300->context.winsys = (struct pipe_winsys*)r300_winsys;
+ r300->context.screen = r300_screen(screen);
r300->context.destroy = r300_destroy_context;
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 5247901be5b..2be9e2eb333 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -268,7 +268,6 @@ void r300_init_surface_functions(struct r300_context* r300);
* We'll just step out in that case... */
#ifndef R300_WINSYS_H
struct pipe_context* r300_create_context(struct pipe_screen* screen,
- struct pipe_winsys* winsys,
struct r300_winsys* r300_winsys);
#endif
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 2fcd5048128..e97334463a3 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -337,8 +337,7 @@ static void r300_destroy_screen(struct pipe_screen* pscreen)
FREE(r300screen);
}
-struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys,
- struct r300_winsys* r300_winsys)
+struct pipe_screen* r300_create_screen(struct r300_winsys* r300_winsys)
{
struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen);
struct r300_capabilities* caps = CALLOC_STRUCT(r300_capabilities);
@@ -352,7 +351,7 @@ struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys,
r300_parse_chipset(caps);
r300screen->caps = caps;
- r300screen->screen.winsys = winsys;
+ r300screen->screen.winsys = (struct pipe_winsys*)r300_winsys;
r300screen->screen.destroy = r300_destroy_screen;
r300screen->screen.get_name = r300_get_name;
r300screen->screen.get_vendor = r300_get_vendor;
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
index 6c845144cb3..3f52dbc3bea 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -61,7 +61,6 @@ r300_transfer(struct pipe_transfer* transfer)
}
/* Creates a new r300 screen. */
-struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys,
- struct r300_winsys* r300_winsys);
+struct pipe_screen* r300_create_screen(struct r300_winsys* r300_winsys);
#endif /* R300_SCREEN_H */
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index 5a3a2128927..b7341c4f3ad 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -33,10 +33,16 @@ extern "C" {
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
+#include "pipe/internal/p_winsys_screen.h"
struct radeon_cs;
struct r300_winsys {
+ /* Parent class */
+ struct pipe_winsys base;
+
+ /* Opaque Radeon-specific winsys object. */
+ void* radeon_winsys;
/* PCI ID */
uint32_t pci_id;
@@ -47,10 +53,6 @@ struct r300_winsys {
/* CS object. This is very much like Intel's batchbuffer.
* Fill it full of dwords and relocs and then submit.
* Repeat as needed. */
- /* Note: Unlike Mesa's version of this, we don't keep a copy of the CSM
- * that was used to create this CS. Is this a good idea? */
- /* Note: The pipe driver doesn't know how to use this. This is purely
- * for the winsys. */
struct radeon_cs* cs;
/* Check to see if there's room for commands. */
@@ -84,7 +86,6 @@ struct r300_winsys {
};
struct pipe_context* r300_create_context(struct pipe_screen* screen,
- struct pipe_winsys* winsys,
struct r300_winsys* r300_winsys);
#ifdef __cplusplus