drm/xe/guc: Port over the slow GuC loading support from i915
authorJohn Harrison <John.C.Harrison@Intel.com>
Sat, 18 May 2024 04:36:59 +0000 (21:36 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Thu, 23 May 2024 17:55:31 +0000 (10:55 -0700)
commitb0ac1b42dbdcc990ad32d6f8107a1d5214c33e67
tree35e493b423ad1074f818d315720055b61d313073
parentfcc8f80517ff71fab24f63dcb4bdb43e63b52fbd
drm/xe/guc: Port over the slow GuC loading support from i915

GuC loading can take longer than it is supposed to for various
reasons. So add in the code to cope with that and to report it when it
happens. There are also many different reasons why GuC loading can
fail, so add in the code for checking for those and for reporting
issues in a meaningful manner rather than just hitting a timeout and
saying 'fail: status = %x'.

Also, remove the 'FIXME' comment about an i915 bug that has never been
applicable to Xe!

v2: Actually report the requested and granted frequencies rather than
showing granted twice (review feedback from Badal).
v3: Locally code all the timeout and end condition handling because a
helper function is not allowed (review feedback from Lucas/Rodrigo).
v4: Add more documentation comments and rename a define to add units
(review feedback from Lucas).
v5: Fix copy/paste error in xe_mmio_wait32_not (review feedback from
Lucas) and rebase (no more return value from guc_wait_ucode).

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240518043700.3264362-3-John.C.Harrison@Intel.com
drivers/gpu/drm/xe/abi/guc_errors_abi.h
drivers/gpu/drm/xe/regs/xe_guc_regs.h
drivers/gpu/drm/xe/xe_guc.c
drivers/gpu/drm/xe/xe_mmio.c
drivers/gpu/drm/xe/xe_mmio.h