#include "../../radeon/drm/radeon_winsys.h"
#include "util/u_hash_table.h"
#include "os/os_thread.h"
+#include "radeon_drm.h"
#define PKT_COUNT_C 0xC000FFFF
#define PKT_COUNT_S(x) (((x) & 0x3FFF) << 16)
unsigned family;
enum chip_class chip_class;
struct r600_tiling_info tiling_info;
- unsigned num_tile_pipes;
- unsigned backend_map;
- boolean backend_map_valid;
};
/* these flags are used in register flags and added into block flags */
int map_count;
void *data;
- struct r600_reloc *reloc;
- unsigned reloc_id;
unsigned last_flush;
unsigned binding;
};
* r600_hw_context.c
*/
int r600_context_init_fence(struct r600_context *ctx);
-void r600_context_get_reloc(struct r600_context *ctx, struct r600_bo *rbo);
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);
void r600_init_cs(struct r600_context *ctx);
int r600_resource_init(struct r600_context *ctx, struct r600_range *range, unsigned offset, unsigned nblocks, unsigned stride, struct r600_reg *reg, int nreg, unsigned offset_base);
-static INLINE void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *rbo)
+static INLINE unsigned r600_context_bo_reloc(struct r600_context *ctx, struct r600_bo *rbo)
{
struct radeon_bo *bo = rbo->bo;
+ unsigned reloc_index;
assert(bo != NULL);
- if (!bo->reloc)
- r600_context_get_reloc(ctx, rbo);
+ reloc_index =
+ ctx->radeon->ws->cs_add_reloc(ctx->cs, bo->cs_buf, rbo->domains, rbo->domains);
- /* set PKT3 to point to proper reloc */
- *pm4 = bo->reloc_id;
+ if (reloc_index >= ctx->creloc)
+ ctx->creloc = reloc_index+1;
+
+ radeon_bo_reference(ctx->radeon, &ctx->bo[reloc_index], bo);
+ return reloc_index * 4;
}
/*