|
|
|
@ -160,3 +160,50 @@ cleanup: |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void intel_engine_init_hangcheck(struct intel_engine_cs *engine) |
|
|
|
|
{ |
|
|
|
|
memset(&engine->hangcheck, 0, sizeof(engine->hangcheck)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* intel_engines_setup_common - setup engine state not requiring hw access |
|
|
|
|
* @engine: Engine to setup. |
|
|
|
|
* |
|
|
|
|
* Initializes @engine@ structure members shared between legacy and execlists |
|
|
|
|
* submission modes which do not require hardware access. |
|
|
|
|
* |
|
|
|
|
* Typically done early in the submission mode specific engine setup stage. |
|
|
|
|
*/ |
|
|
|
|
void intel_engine_setup_common(struct intel_engine_cs *engine) |
|
|
|
|
{ |
|
|
|
|
INIT_LIST_HEAD(&engine->active_list); |
|
|
|
|
INIT_LIST_HEAD(&engine->request_list); |
|
|
|
|
INIT_LIST_HEAD(&engine->buffers); |
|
|
|
|
INIT_LIST_HEAD(&engine->execlist_queue); |
|
|
|
|
spin_lock_init(&engine->execlist_lock); |
|
|
|
|
|
|
|
|
|
intel_engine_init_hangcheck(engine); |
|
|
|
|
i915_gem_batch_pool_init(&engine->i915->drm, &engine->batch_pool); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* intel_engines_init_common - initialize cengine state which might require hw access |
|
|
|
|
* @engine: Engine to initialize. |
|
|
|
|
* |
|
|
|
|
* Initializes @engine@ structure members shared between legacy and execlists |
|
|
|
|
* submission modes which do require hardware access. |
|
|
|
|
* |
|
|
|
|
* Typcally done at later stages of submission mode specific engine setup. |
|
|
|
|
* |
|
|
|
|
* Returns zero on success or an error code on failure. |
|
|
|
|
*/ |
|
|
|
|
int intel_engine_init_common(struct intel_engine_cs *engine) |
|
|
|
|
{ |
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
ret = intel_engine_init_breadcrumbs(engine); |
|
|
|
|
if (ret) |
|
|
|
|
return ret; |
|
|
|
|
|
|
|
|
|
return i915_cmd_parser_init_ring(engine); |
|
|
|
|
} |
|
|
|
|