summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJohn Doe <[email protected]>2010-09-15 11:47:32 -0400
committerJohn Doe <[email protected]>2010-09-15 11:48:34 -0400
commite0b6df4fcce0964ea7930efeb40cb487b4c53337 (patch)
tree3ddfbc8e750d004391ad94a595c59bd437203485 /src/gallium
parent26fe16a99b762d27e8f499c2e02116e9c4b7a6bb (diff)
r600g: misc cleanup
Avoid using r600_screen structure to get ptr to radeon winsys structure. Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r600/eg_asm.c1
-rw-r--r--src/gallium/drivers/r600/r600_asm.c4
-rw-r--r--src/gallium/drivers/r600/r600_asm.h50
-rw-r--r--src/gallium/drivers/r600/r600_shader.c3
-rw-r--r--src/gallium/drivers/r600/r600_shader.h6
-rw-r--r--src/gallium/drivers/r600/r600_texture.c26
-rw-r--r--src/gallium/drivers/r600/r700_asm.c3
7 files changed, 47 insertions, 46 deletions
diff --git a/src/gallium/drivers/r600/eg_asm.c b/src/gallium/drivers/r600/eg_asm.c
index bc5dda43ed0..769f5508744 100644
--- a/src/gallium/drivers/r600/eg_asm.c
+++ b/src/gallium/drivers/r600/eg_asm.c
@@ -20,6 +20,7 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include "radeon.h"
#include "r600_asm.h"
#include "r600_context.h"
#include "util/u_memory.h"
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 662b9b9115d..0d17f75da7e 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -20,11 +20,12 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "r600_asm.h"
+#include "radeon.h"
#include "r600_context.h"
#include "util/u_memory.h"
#include "r600_sq.h"
#include "r600_opcodes.h"
+#include "r600_asm.h"
#include <stdio.h>
#include <errno.h>
@@ -71,7 +72,6 @@ static inline unsigned int r600_bc_get_num_operands(struct r600_bc_alu *alu)
case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SIN:
case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_COS:
return 1;
-
default: R600_ERR(
"Need instruction operand number for 0x%x.\n", alu->inst);
};
diff --git a/src/gallium/drivers/r600/r600_asm.h b/src/gallium/drivers/r600/r600_asm.h
index cc62535e5cd..62a46cb0e1e 100644
--- a/src/gallium/drivers/r600/r600_asm.h
+++ b/src/gallium/drivers/r600/r600_asm.h
@@ -23,7 +23,6 @@
#ifndef R600_ASM_H
#define R600_ASM_H
-#include "radeon.h"
#include "util/u_double_list.h"
#define NUM_OF_CYCLES 3
@@ -53,11 +52,11 @@ struct r600_bc_alu {
unsigned inst;
unsigned last;
unsigned is_op3;
- unsigned predicate;
+ unsigned predicate;
unsigned nliteral;
unsigned literal_added;
- unsigned bank_swizzle;
- unsigned bank_swizzle_force;
+ unsigned bank_swizzle;
+ unsigned bank_swizzle_force;
u32 value[4];
int hw_gpr[NUM_OF_CYCLES][NUM_OF_COMPONENTS];
};
@@ -124,15 +123,15 @@ struct r600_bc_cf {
unsigned addr;
unsigned ndw;
unsigned id;
- unsigned cond;
- unsigned pop_count;
- unsigned cf_addr; /* control flow addr */
- unsigned kcache0_mode;
+ unsigned cond;
+ unsigned pop_count;
+ unsigned cf_addr; /* control flow addr */
+ unsigned kcache0_mode;
struct list_head alu;
struct list_head tex;
struct list_head vtx;
struct r600_bc_output output;
- struct r600_bc_alu *curr_bs_head;
+ struct r600_bc_alu *curr_bs_head;
};
#define FC_NONE 0
@@ -143,39 +142,37 @@ struct r600_bc_cf {
#define FC_PUSH_WQM 5
struct r600_cf_stack_entry {
- int type;
- struct r600_bc_cf *start;
- struct r600_bc_cf **mid; /* used to store the else point */
- int num_mid;
+ int type;
+ struct r600_bc_cf *start;
+ struct r600_bc_cf **mid; /* used to store the else point */
+ int num_mid;
};
#define SQ_MAX_CALL_DEPTH 0x00000020
struct r600_cf_callstack {
- unsigned fc_sp_before_entry;
- int sub_desc_index;
- int current;
- int max;
+ unsigned fc_sp_before_entry;
+ int sub_desc_index;
+ int current;
+ int max;
};
struct r600_bc {
enum radeon_family family;
- int chiprev; /* 0 - r600, 1 - r700, 2 - evergreen */
- unsigned use_mem_constant;
+ int chiprev; /* 0 - r600, 1 - r700, 2 - evergreen */
+ unsigned use_mem_constant;
struct list_head cf;
struct r600_bc_cf *cf_last;
unsigned ndw;
unsigned ncf;
unsigned ngpr;
- unsigned nstack;
+ unsigned nstack;
unsigned nresource;
unsigned force_add_cf;
u32 *bytecode;
-
- u32 fc_sp;
- struct r600_cf_stack_entry fc_stack[32];
-
- unsigned call_sp;
- struct r600_cf_callstack callstack[SQ_MAX_CALL_DEPTH];
+ u32 fc_sp;
+ struct r600_cf_stack_entry fc_stack[32];
+ unsigned call_sp;
+ struct r600_cf_callstack callstack[SQ_MAX_CALL_DEPTH];
};
int r600_bc_init(struct r600_bc *bc, enum radeon_family family);
@@ -187,4 +184,5 @@ int r600_bc_add_output(struct r600_bc *bc, const struct r600_bc_output *output);
int r600_bc_build(struct r600_bc *bc);
int r600_bc_add_cfinst(struct r600_bc *bc, int inst);
int r600_bc_add_alu_type(struct r600_bc *bc, const struct r600_bc_alu *alu, int type);
+
#endif
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index f12dbd37d38..0453138d2ba 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -51,7 +51,7 @@ struct r600_shader_ctx {
u32 value[4];
u32 *literals;
u32 nliterals;
- u32 max_driver_temp_used;
+ u32 max_driver_temp_used;
};
struct r600_shader_tgsi_instruction {
@@ -62,7 +62,6 @@ struct r600_shader_tgsi_instruction {
};
static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[], eg_shader_tgsi_instruction[];
-static int r600_shader_from_tgsi(const struct tgsi_token *tokens, struct r600_shader *shader);
static int tgsi_helper_tempx_replicate(struct r600_shader_ctx *ctx);
static int r600_shader_update(struct pipe_context *ctx, struct r600_shader *shader)
diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h
index fba4a2b3b8a..06dd65038d5 100644
--- a/src/gallium/drivers/r600/r600_shader.h
+++ b/src/gallium/drivers/r600/r600_shader.h
@@ -42,8 +42,10 @@ struct r600_shader {
struct r600_shader_io input[32];
struct r600_shader_io output[32];
enum radeon_family family;
- boolean uses_kill;
- boolean use_mem_constant;
+ boolean uses_kill;
+ boolean use_mem_constant;
};
+int r600_shader_from_tgsi(const struct tgsi_token *tokens, struct r600_shader *shader);
+
#endif
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 37907ef0e9a..6c21abd95ae 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -73,7 +73,7 @@ static unsigned long r600_texture_get_offset(struct r600_resource_texture *rtex,
}
}
-static void r600_setup_miptree(struct r600_screen *rscreen, struct r600_resource_texture *rtex)
+static void r600_setup_miptree(struct r600_resource_texture *rtex)
{
struct pipe_resource *ptex = &rtex->resource.base.b;
unsigned long w, h, pitch, size, layer_size, i, offset;
@@ -105,7 +105,7 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
{
struct r600_resource_texture *rtex;
struct r600_resource *resource;
- struct r600_screen *rscreen = r600_screen(screen);
+ struct radeon *radeon = (struct radeon *)screen->winsys;
rtex = CALLOC_STRUCT(r600_resource_texture);
if (!rtex) {
@@ -116,11 +116,11 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
resource->base.vtbl = &r600_texture_vtbl;
pipe_reference_init(&resource->base.b.reference, 1);
resource->base.b.screen = screen;
- r600_setup_miptree(rscreen, rtex);
+ r600_setup_miptree(rtex);
/* FIXME alignment 4096 enought ? too much ? */
resource->domain = r600_domain_from_usage(resource->base.b.bind);
- resource->bo = radeon_bo(rscreen->rw, 0, rtex->size, 4096, NULL);
+ resource->bo = radeon_bo(radeon, 0, rtex->size, 4096, NULL);
if (resource->bo == NULL) {
FREE(rtex);
return NULL;
@@ -146,13 +146,13 @@ static void r600_texture_destroy(struct pipe_screen *screen,
{
struct r600_resource_texture *rtex = (struct r600_resource_texture*)ptex;
struct r600_resource *resource = &rtex->resource;
- struct r600_screen *rscreen = r600_screen(screen);
+ struct radeon *radeon = (struct radeon *)screen->winsys;
if (resource->bo) {
- radeon_bo_decref(rscreen->rw, resource->bo);
+ radeon_bo_decref(radeon, resource->bo);
}
if (rtex->uncompressed) {
- radeon_bo_decref(rscreen->rw, rtex->uncompressed);
+ radeon_bo_decref(radeon, rtex->uncompressed);
}
r600_texture_destroy_state(ptex);
FREE(rtex);
@@ -317,7 +317,7 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
struct radeon_bo *bo;
enum pipe_format format = transfer->resource->format;
- struct r600_screen *rscreen = r600_screen(ctx->screen);
+ struct radeon *radeon = (struct radeon *)ctx->screen->winsys;
struct r600_resource_texture *rtex;
unsigned long offset = 0;
char *map;
@@ -342,10 +342,10 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
transfer->box.y / util_format_get_blockheight(format) * transfer->stride +
transfer->box.x / util_format_get_blockwidth(format) * util_format_get_blocksize(format);
}
- if (radeon_bo_map(rscreen->rw, bo)) {
+ if (radeon_bo_map(radeon, bo)) {
return NULL;
}
- radeon_bo_wait(rscreen->rw, bo);
+ radeon_bo_wait(radeon, bo);
map = bo->data;
return map + offset;
@@ -355,7 +355,7 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx,
struct pipe_transfer* transfer)
{
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
- struct r600_screen *rscreen = r600_screen(ctx->screen);
+ struct radeon *radeon = (struct radeon *)ctx->screen->winsys;
struct r600_resource_texture *rtex;
struct radeon_bo *bo;
@@ -369,7 +369,7 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx,
bo = ((struct r600_resource *)transfer->resource)->bo;
}
}
- radeon_bo_unmap(rscreen->rw, bo);
+ radeon_bo_unmap(radeon, bo);
}
struct u_resource_vtbl r600_texture_vtbl =
@@ -495,7 +495,7 @@ uint32_t r600_translate_texformat(enum pipe_format format,
default:
break;
}
-
+
/* S3TC formats. TODO */
if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) {
goto out_unknown;
diff --git a/src/gallium/drivers/r600/r700_asm.c b/src/gallium/drivers/r600/r700_asm.c
index e754d733afc..a78cf0ce950 100644
--- a/src/gallium/drivers/r600/r700_asm.c
+++ b/src/gallium/drivers/r600/r700_asm.c
@@ -20,8 +20,9 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "r600_asm.h"
+#include "radeon.h"
#include "r600_context.h"
+#include "r600_asm.h"
#include "util/u_memory.h"
#include "r700_sq.h"
#include <stdio.h>