summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-09-17 14:10:20 +0200
committerMarek Olšák <maraeo@gmail.com>2011-09-30 23:19:52 +0200
commit90ce3cdde9fb2dd507b4e21c5456a3371f5996bc (patch)
treefe7d128c2cd9efaeba3f93614bd4cc124a43aadb /src/gallium/winsys
parent518557d74abd4ce035dae079ff6eb1b08cc639d0 (diff)
r600g: remove struct radeon (or what's left of it)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/r600/drm/Makefile.sources1
-rw-r--r--src/gallium/winsys/r600/drm/evergreen_hw_context.c5
-rw-r--r--src/gallium/winsys/r600/drm/r600_drm.c49
-rw-r--r--src/gallium/winsys/r600/drm/r600_hw_context.c20
-rw-r--r--src/gallium/winsys/r600/drm/r600_priv.h10
5 files changed, 13 insertions, 72 deletions
diff --git a/src/gallium/winsys/r600/drm/Makefile.sources b/src/gallium/winsys/r600/drm/Makefile.sources
index ce41cc3a8a0..c8a4658324f 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 c9e3c9e27b2..c83560e04ff 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 @@ static int evergreen_loop_const_init(struct r600_context *ctx, u32 offset)
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 @@ int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen,
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 eb2a3514f5d..00000000000
--- 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 cea62e88841..fa7a8b6f841 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 @@ void r600_get_backend_mask(struct r600_context *ctx)
{
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 @@ void r600_context_fini(struct r600_context *ctx)
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 @@ int r600_setup_block_table(struct r600_context *ctx)
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 @@ int r600_context_init(struct r600_context *ctx, struct r600_screen *screen, stru
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 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
/* 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 @@ boolean r600_context_query_result(struct r600_context *ctx,
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 6ca8f7bccc6..f1bbe38f0f7 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 @@ static INLINE unsigned r600_context_bo_reloc(struct r600_context *ctx, struct r6
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)