diff options
Diffstat (limited to 'r600_batch.c')
-rw-r--r-- | r600_batch.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/r600_batch.c b/r600_batch.c index b6432d5..a322430 100644 --- a/r600_batch.c +++ b/r600_batch.c @@ -15,7 +15,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "radeon_device.h" -#include "r600_atom.h" +#include "r600_winsys.h" #include "r600d.h" /* state creation functions prototype */ @@ -205,8 +205,9 @@ out_err: return r; } -int r600_batches_queue(struct radeon_device *rdev, struct drm_r600_batch *batch) +int r600_batches_queue(struct radeon_device *rdev, struct r600_request *rq) { + struct drm_r600_batch *batch = rq->data; struct r600_batch *rbatch; struct r600_batches *batches = &rdev->batches; int r, i, j; @@ -303,7 +304,7 @@ reprocess: batches->last_id[i] = rbatch->atoms[i]->id; } } - radeon_device_set_bo_list(rdev, rbatch->inputs.nbo, rbatch->inputs.bo); + radeon_device_set_bo_list(rdev, rq->nbo, rq->bo); for (i = 0; i < rbatch->inputs.drm.nbuffers; i++) { if (rbatch->inputs.drm.buffers[i].resource_id == -1) { r = r600_batches_fs_resource_add(rdev, batches, &rbatch->inputs.drm.buffers[i]); @@ -394,36 +395,32 @@ static struct r600_atom_funcs _r600_atom_funcs[] = { &r600_ps_shader_create, &r600_ps_shader_emit}, }; - -struct radeon_atom *r600_atom_create(struct radeon_device *rdev, struct drm_radeon_atom *patom) +struct radeon_atom *r600_atom_create(struct radeon_device *rdev, struct r600_request *rq) { struct radeon_atom *atom; - struct r600_state_container *cont; int r; - if (!patom->type || patom->type >= R600_BATCH_NATOMS) { + if (!rq->type || rq->type >= R600_BATCH_NATOMS) { fprintf(stderr, "%s %d invalid atom type %d\n", __func__, __LINE__); return NULL; } - if (_r600_atom_funcs[patom->type].type != patom->type) { + if (_r600_atom_funcs[rq->type].type != rq->type) { fprintf(stderr, "%s %d mismatch for type %d have %d\n", - __func__, __LINE__, _r600_atom_funcs[patom->type].type, patom->type); + __func__, __LINE__, _r600_atom_funcs[rq->type].type, rq->type); return NULL; } - cont = patom->data; - radeon_device_set_bo_list(rdev, cont->nbo, cont->bo); + radeon_device_set_bo_list(rdev, rq->nbo, rq->bo); /* create the atom */ atom = malloc(sizeof(struct radeon_atom)); if (atom == NULL) return NULL; memset(atom, 0, sizeof(struct radeon_atom)); - INIT_LIST_HEAD(&atom->list); kref_init(&atom->kref); - atom->emit = _r600_atom_funcs[patom->type].emit; + atom->emit = _r600_atom_funcs[rq->type].emit; atom->nflushes = 0; - atom->id = crc_64(cont->data, _r600_atom_funcs[patom->type].size); - atom->type = patom->type; - r = _r600_atom_funcs[patom->type].create(rdev, atom, cont->data); + atom->id = crc_64(rq->data, _r600_atom_funcs[rq->type].size); + atom->type = rq->type; + r = _r600_atom_funcs[rq->type].create(rdev, atom, rq->data); if (r) { radeon_atom_put(atom); return NULL; |