drm/i915/guc: Extract guc_init from guc_init_hw
authorMichał Winiarski <michal.winiarski@intel.com>
Wed, 13 Dec 2017 22:13:48 +0000 (23:13 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Dec 2017 08:06:56 +0000 (08:06 +0000)
commit61b5c1587dd82a8493d7838bb2f9289fd0903364
treefc0a3a50a3a821953c4fcfc397f2bd5cd7976baa
parent3176ff49bc3e56871ec9f338cac759dacd0135e1
drm/i915/guc: Extract guc_init from guc_init_hw

After GPU reset, GuC HW needs to be reinitialized (with FW reload).
Unfortunately, we're doing some extra work there (mostly allocating stuff),
work that can be moved to guc_init and called once at driver load time.

As a side effect we're no longer hitting an assert in
i915_ggtt_enable_guc on suspend/resume.

v2: Do not duplicate disable_communication / reset_guc_interrupts
v3: Add proper teardown after rebase

References: 04f7b24eccdf ("drm/i915/guc: Assert that we switch between known ggtt->invalidate functions")
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20171213221352.7173-3-michal.winiarski@intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_uc.c
drivers/gpu/drm/i915/intel_uc.h