(struct radeon_winsys_priv*)winsys->radeon_winsys;
struct radeon_cs_space_check* sc = priv->sc;
- retval = radeon_cs_space_check(winsys->cs, sc, priv->bo_count);
+ retval = radeon_cs_space_check(priv->cs, sc, priv->bo_count);
if (retval == RADEON_CS_SPACE_OP_TO_BIG) {
/* XXX we need to failover here */
const char* function,
int line)
{
- radeon_cs_begin(winsys->cs, size, file, function, line);
+ struct radeon_winsys_priv* priv =
+ (struct radeon_winsys_priv*)winsys->radeon_winsys;
+
+ radeon_cs_begin(priv->cs, size, file, function, line);
}
static void radeon_r300_write_cs_dword(struct r300_winsys* winsys,
uint32_t dword)
{
- radeon_cs_write_dword(winsys->cs, dword);
+ struct radeon_winsys_priv* priv =
+ (struct radeon_winsys_priv*)winsys->radeon_winsys;
+
+ radeon_cs_write_dword(priv->cs, dword);
}
static void radeon_r300_write_cs_reloc(struct r300_winsys* winsys,
uint32_t wd,
uint32_t flags)
{
- radeon_cs_write_reloc(winsys->cs,
+ struct radeon_winsys_priv* priv =
+ (struct radeon_winsys_priv*)winsys->radeon_winsys;
+
+ radeon_cs_write_reloc(priv->cs,
((struct radeon_pipe_buffer*)pbuffer)->bo, rd, wd, flags);
}
const char* function,
int line)
{
- radeon_cs_end(winsys->cs, file, function, line);
+ struct radeon_winsys_priv* priv =
+ (struct radeon_winsys_priv*)winsys->radeon_winsys;
+
+ radeon_cs_end(priv->cs, file, function, line);
}
static void radeon_r300_flush_cs(struct r300_winsys* winsys)
{
+ struct radeon_winsys_priv* priv =
+ (struct radeon_winsys_priv*)winsys->radeon_winsys;
int retval = 0;
- retval = radeon_cs_emit(winsys->cs);
+ retval = radeon_cs_emit(priv->cs);
if (retval) {
debug_printf("radeon: Bad CS, dumping...\n");
- radeon_cs_print(winsys->cs, stderr);
+ radeon_cs_print(priv->cs, stderr);
}
- radeon_cs_erase(winsys->cs);
+ radeon_cs_erase(priv->cs);
}
/* Helper function to do the ioctls needed for setup and init. */
radeon_create_r300_winsys(int fd, struct radeon_winsys* old_winsys)
{
struct r300_winsys* winsys = CALLOC_STRUCT(r300_winsys);
- struct radeon_cs_manager* csm;
+ struct radeon_winsys_priv* priv;
if (winsys == NULL) {
return NULL;
}
+ priv = old_winsys->priv;
+
do_ioctls(winsys, fd);
- csm = radeon_cs_manager_gem_ctor(fd);
+ priv->csm = radeon_cs_manager_gem_ctor(fd);
- winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4);
- radeon_cs_set_limit(winsys->cs,
+ priv->cs = radeon_cs_create(priv->csm, 1024 * 64 / 4);
+ radeon_cs_set_limit(priv->cs,
RADEON_GEM_DOMAIN_GTT, winsys->gart_size);
- radeon_cs_set_limit(winsys->cs,
+ radeon_cs_set_limit(priv->cs,
RADEON_GEM_DOMAIN_VRAM, winsys->vram_size);
winsys->add_buffer = radeon_r300_add_buffer;