summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/r600/drm/r600_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/r600/drm/r600_priv.h')
-rw-r--r--src/gallium/winsys/r600/drm/r600_priv.h67
1 files changed, 21 insertions, 46 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h
index 41c5ee0..ed0f3e5 100644
--- a/src/gallium/winsys/r600/drm/r600_priv.h
+++ b/src/gallium/winsys/r600/drm/r600_priv.h
@@ -32,9 +32,13 @@
#include <assert.h>
#include <util/u_double_list.h>
#include <util/u_inlines.h>
+#include "util/u_hash_table.h"
#include <os/os_thread.h>
#include "r600.h"
+#define PKT_COUNT_C 0xC000FFFF
+#define PKT_COUNT_S(x) (((x) & 0x3FFF) << 16)
+
struct r600_bomgr;
struct r600_bo;
@@ -52,13 +56,20 @@ struct radeon {
unsigned clock_crystal_freq;
unsigned num_backends;
unsigned minor_version;
+
+ /* List of buffer handles and its mutex. */
+ struct util_hash_table *bo_handles;
+ pipe_mutex bo_handles_mutex;
};
+#define REG_FLAG_NEED_BO 1
+#define REG_FLAG_DIRTY_ALWAYS 2
+
struct r600_reg {
unsigned opcode;
unsigned offset_base;
unsigned offset;
- unsigned need_bo;
+ unsigned flags;
unsigned flush_flags;
unsigned flush_mask;
};
@@ -77,6 +88,7 @@ struct radeon_bo {
struct r600_reloc *reloc;
unsigned reloc_id;
unsigned last_flush;
+ unsigned name;
};
struct r600_bo {
@@ -142,7 +154,14 @@ void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
unsigned flush_mask, struct r600_bo *rbo);
struct r600_bo *r600_context_reg_bo(struct r600_context *ctx, unsigned offset);
int r600_context_add_block(struct r600_context *ctx, const struct r600_reg *reg, unsigned nreg);
-
+void r600_context_pipe_state_set_resource(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset);
+void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block);
+void r600_context_dirty_block(struct r600_context *ctx, struct r600_block *block,
+ int dirty, int index);
+
+void r600_context_reg(struct r600_context *ctx,
+ unsigned offset, unsigned value,
+ unsigned mask);
/*
* r600_bo.c
*/
@@ -167,50 +186,6 @@ struct r600_bo *r600_bomgr_bo_create(struct r600_bomgr *mgr,
#define CTX_RANGE_ID(ctx, offset) (((offset) >> (ctx)->hash_shift) & 255)
#define CTX_BLOCK_ID(ctx, offset) ((offset) & ((1 << (ctx)->hash_shift) - 1))
-static void inline r600_context_reg(struct r600_context *ctx,
- unsigned offset, unsigned value,
- unsigned mask)
-{
- struct r600_range *range;
- struct r600_block *block;
- unsigned id;
-
- range = &ctx->range[CTX_RANGE_ID(ctx, offset)];
- block = range->blocks[CTX_BLOCK_ID(ctx, offset)];
- id = (offset - block->start_offset) >> 2;
- block->reg[id] &= ~mask;
- block->reg[id] |= value;
- if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
- ctx->pm4_dirty_cdwords += block->pm4_ndwords;
- block->status |= R600_BLOCK_STATUS_ENABLED;
- block->status |= R600_BLOCK_STATUS_DIRTY;
- LIST_ADDTAIL(&block->list,&ctx->dirty);
- }
-}
-
-static inline void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block)
-{
- int id;
-
- for (int j = 0; j < block->nreg; j++) {
- if (block->pm4_bo_index[j]) {
- /* find relocation */
- id = block->pm4_bo_index[j];
- r600_context_bo_reloc(ctx,
- &block->pm4[block->reloc[id].bo_pm4_index],
- block->reloc[id].bo);
- r600_context_bo_flush(ctx,
- block->reloc[id].flush_flags,
- block->reloc[id].flush_mask,
- block->reloc[id].bo);
- }
- }
- memcpy(&ctx->pm4[ctx->pm4_cdwords], block->pm4, block->pm4_ndwords * 4);
- ctx->pm4_cdwords += block->pm4_ndwords;
- block->status ^= R600_BLOCK_STATUS_DIRTY;
- LIST_DELINIT(&block->list);
-}
-
/*
* radeon_bo.c
*/