r600g: remove struct radeon (or what's left of it)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
diff --git a/src/gallium/winsys/r600/drm/Makefile.sources b/src/gallium/winsys/r600/drm/Makefile.sources
index ce41cc3..c8a4658 100644
--- a/src/gallium/winsys/r600/drm/Makefile.sources
+++ b/src/gallium/winsys/r600/drm/Makefile.sources
@@ -1,4 +1,3 @@
 C_SOURCES := \
 	evergreen_hw_context.c \
-	r600_drm.c \
 	r600_hw_context.c
diff --git a/src/gallium/winsys/r600/drm/evergreen_hw_context.c b/src/gallium/winsys/r600/drm/evergreen_hw_context.c
index c9e3c9e..c83560e 100644
--- a/src/gallium/winsys/r600/drm/evergreen_hw_context.c
+++ b/src/gallium/winsys/r600/drm/evergreen_hw_context.c
@@ -898,12 +898,11 @@
 	return r600_context_add_block(ctx, r600_loop_consts, nreg, PKT3_SET_LOOP_CONST, EVERGREEN_LOOP_CONST_OFFSET);
 }
 
-int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen, struct radeon *radeon)
+int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen)
 {
 	int r;
 
 	memset(ctx, 0, sizeof(struct r600_context));
-	ctx->radeon = radeon;
 	ctx->screen = screen;
 
 	LIST_INITHEAD(&ctx->query_list);
@@ -989,7 +988,7 @@
 	if (r)
 		goto out_err;
 
-	ctx->cs = radeon->ws->cs_create(radeon->ws);
+	ctx->cs = screen->ws->cs_create(screen->ws);
 
 	/* allocate cs variables */
 	ctx->bo = calloc(RADEON_MAX_CMDBUF_DWORDS, sizeof(void *));
diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c
deleted file mode 100644
index eb2a351..0000000
--- a/src/gallium/winsys/r600/drm/r600_drm.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- *      Jerome Glisse
- *      Corbin Simpson <MostAwesomeDude@gmail.com>
- *      Joakim Sindholt <opensource@zhasha.com>
- */
-
-#include "r600_priv.h"
-#include "util/u_memory.h"
-#include <errno.h>
-
-struct radeon *radeon_create(struct radeon_winsys *ws)
-{
-	struct radeon *radeon = CALLOC_STRUCT(radeon);
-	if (radeon == NULL) {
-		return NULL;
-	}
-
-	radeon->ws = ws;
-	ws->query_info(ws, &radeon->info);
-
-	return radeon;
-}
-
-void radeon_destroy(struct radeon *radeon)
-{
-	FREE(radeon);
-}
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index cea62e8..fa7a8b6 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -36,13 +36,13 @@
 {
 	struct r600_resource *buffer;
 	u32 *results;
-	unsigned num_backends = ctx->radeon->info.r600_num_backends;
+	unsigned num_backends = ctx->screen->info.r600_num_backends;
 	unsigned i, mask = 0;
 
 	/* if backend_map query is supported by the kernel */
-	if (ctx->radeon->info.r600_backend_map_valid) {
-		unsigned num_tile_pipes = ctx->radeon->info.r600_num_tile_pipes;
-		unsigned backend_map = ctx->radeon->info.r600_backend_map;
+	if (ctx->screen->info.r600_backend_map_valid) {
+		unsigned num_tile_pipes = ctx->screen->info.r600_num_tile_pipes;
+		unsigned backend_map = ctx->screen->info.r600_backend_map;
 		unsigned item_width, item_mask;
 
 		if (ctx->screen->chip_class >= EVERGREEN) {
@@ -776,7 +776,7 @@
 	free(ctx->range);
 	free(ctx->blocks);
 	free(ctx->bo);
-	ctx->radeon->ws->cs_destroy(ctx->cs);
+	ctx->screen->ws->cs_destroy(ctx->cs);
 
 	memset(ctx, 0, sizeof(struct r600_context));
 }
@@ -828,12 +828,11 @@
 	return 0;
 }
 
-int r600_context_init(struct r600_context *ctx, struct r600_screen *screen, struct radeon *radeon)
+int r600_context_init(struct r600_context *ctx, struct r600_screen *screen)
 {
 	int r;
 
 	memset(ctx, 0, sizeof(struct r600_context));
-	ctx->radeon = radeon;
 	ctx->screen = screen;
 
 	LIST_INITHEAD(&ctx->query_list);
@@ -911,7 +910,7 @@
 	if (r)
 		goto out_err;
 
-	ctx->cs = radeon->ws->cs_create(radeon->ws);
+	ctx->cs = screen->ws->cs_create(screen->ws);
 
 	/* allocate cs variables */
 	ctx->bo = calloc(RADEON_MAX_CMDBUF_DWORDS, sizeof(void *));
@@ -1506,7 +1505,7 @@
 
 	/* Flush the CS. */
 	ctx->cs->cdw = ctx->pm4_cdwords;
-	ctx->radeon->ws->cs_flush(ctx->cs, flags);
+	ctx->screen->ws->cs_flush(ctx->cs, flags);
 
 	/* We need to get the pointer to the other CS,
 	 * the command streams are double-buffered. */
@@ -1833,13 +1832,12 @@
 	if (!r600_query_result(ctx, query, wait))
 		return FALSE;
 
-
 	switch (query->type) {
 	case PIPE_QUERY_OCCLUSION_COUNTER:
 		*result = query->result;
 		break;
 	case PIPE_QUERY_TIME_ELAPSED:
-		*result = (1000000 * query->result) / ctx->radeon->info.r600_clock_crystal_freq;
+		*result = (1000000 * query->result) / ctx->screen->info.r600_clock_crystal_freq;
 		break;
 	default:
 		assert(0);
diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h
index 6ca8f7b..f1bbe38 100644
--- a/src/gallium/winsys/r600/drm/r600_priv.h
+++ b/src/gallium/winsys/r600/drm/r600_priv.h
@@ -26,19 +26,13 @@
 #ifndef R600_PRIV_H
 #define R600_PRIV_H
 
-#include "r600.h"
-#include "../../radeon/drm/radeon_winsys.h"
+#include "r600_pipe.h"
 #include "util/u_hash_table.h"
 #include "os/os_thread.h"
 
 #define PKT_COUNT_C                     0xC000FFFF
 #define PKT_COUNT_S(x)                  (((x) & 0x3FFF) << 16)
 
-struct radeon {
-	struct radeon_winsys		*ws;
-	struct radeon_info		info;
-};
-
 /* these flags are used in register flags and added into block flags */
 #define REG_FLAG_NEED_BO 1
 #define REG_FLAG_DIRTY_ALWAYS 2
@@ -86,7 +80,7 @@
 	assert(usage);
 
 	unsigned reloc_index =
-		ctx->radeon->ws->cs_add_reloc(ctx->cs, rbo->cs_buf,
+		ctx->screen->ws->cs_add_reloc(ctx->cs, rbo->cs_buf,
 					      rd, wd);
 
 	if (reloc_index >= ctx->creloc)