ilo: harware contexts are only for the render ring

The hardware context should not be passed for bo execution when the ring is
not the render ring.  Rename hw_ctx to render_ctx for clarity.
This commit is contained in:
Chia-I Wu 2013-05-17 16:10:11 +08:00
parent 1ed7b825cf
commit a04d8574c6
5 changed files with 12 additions and 8 deletions

View file

@ -250,7 +250,7 @@ ilo_3d_new_cp_batch(struct ilo_3d *hw3d)
ilo_3d_pipeline_invalidate(hw3d->pipeline,
ILO_3D_PIPELINE_INVALIDATE_BATCH_BO |
ILO_3D_PIPELINE_INVALIDATE_STATE_BO);
if (!hw3d->cp->hw_ctx) {
if (!hw3d->cp->render_ctx) {
ilo_3d_pipeline_invalidate(hw3d->pipeline,
ILO_3D_PIPELINE_INVALIDATE_HW);
}

View file

@ -402,7 +402,7 @@ gen7_pipeline_sol(struct ilo_3d_pipeline *p,
int base = 0;
/* reset HW write offsets and offset buffer base */
if (!p->cp->hw_ctx) {
if (!p->cp->render_ctx) {
ilo_cp_set_one_off_flags(p->cp, INTEL_EXEC_GEN7_SOL_RESET);
base += p->state.so_num_vertices * stride;
}

View file

@ -176,17 +176,21 @@ static int
ilo_cp_exec_bo(struct ilo_cp *cp)
{
const bool do_exec = !(ilo_debug & ILO_DEBUG_NOHW);
struct intel_context *ctx;
unsigned long flags;
int err;
switch (cp->ring) {
case ILO_CP_RING_RENDER:
ctx = cp->render_ctx;
flags = INTEL_EXEC_RENDER;
break;
case ILO_CP_RING_BLT:
ctx = NULL;
flags = INTEL_EXEC_BLT;
break;
default:
ctx = NULL;
flags = 0;
break;
}
@ -194,7 +198,7 @@ ilo_cp_exec_bo(struct ilo_cp *cp)
flags |= cp->one_off_flags;
if (likely(do_exec))
err = cp->bo->exec(cp->bo, cp->used * 4, cp->hw_ctx, flags);
err = cp->bo->exec(cp->bo, cp->used * 4, ctx, flags);
else
err = 0;
@ -274,8 +278,8 @@ ilo_cp_destroy(struct ilo_cp *cp)
{
if (cp->bo)
cp->bo->unreference(cp->bo);
if (cp->hw_ctx)
cp->winsys->destroy_context(cp->winsys, cp->hw_ctx);
if (cp->render_ctx)
cp->winsys->destroy_context(cp->winsys, cp->render_ctx);
FREE(cp->sys);
FREE(cp);
@ -294,7 +298,7 @@ ilo_cp_create(struct intel_winsys *winsys, bool direct_map)
return NULL;
cp->winsys = winsys;
cp->hw_ctx = winsys->create_context(winsys);
cp->render_ctx = winsys->create_context(winsys);
cp->ring = ILO_CP_RING_RENDER;
cp->no_implicit_flush = false;

View file

@ -56,7 +56,7 @@ typedef void (*ilo_cp_hook_func)(struct ilo_cp *cp, void *data);
*/
struct ilo_cp {
struct intel_winsys *winsys;
struct intel_context *hw_ctx;
struct intel_context *render_ctx;
enum ilo_cp_ring ring;
bool no_implicit_flush;

View file

@ -76,7 +76,7 @@ is_bo_busy(struct ilo_context *ilo, struct intel_bo *bo, bool *need_flush)
* without being referenced by ilo->cp->bo. We have to flush
* unconditionally, and that is bad.
*/
if (ilo->cp->hw_ctx)
if (ilo->cp->render_ctx)
ilo_cp_flush(ilo->cp);
return intel_bo_is_busy(bo);