diff options
author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-01-12 17:25:07 -0500 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-12 14:05:59 -0500 |
commit | eb04985d7211a5fc651f8cca588b2d78d3a36cee (patch) | |
tree | 9fbbfefe7c0e9c987651b38b61db4c3eb776879b | |
parent | 2e5be5d57dbe5e04a5abbd01417fc098f8925a35 (diff) |
drm/xe: Wait for success on guc done.
Rather than a constant check on proto and wait not busy,
let's wait for the expected success and then check the
protocol afterwards.
With this, we can now use the regular xe_mmio_wait32
and kill this local need for the wait_for.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c index 7e8451e60d2d..6ecf493c26b5 100644 --- a/drivers/gpu/drm/xe/xe_guc.c +++ b/drivers/gpu/drm/xe/xe_guc.c @@ -22,13 +22,6 @@ #include "i915_reg_defs.h" #include "gt/intel_gt_regs.h" -#include <linux/delay.h> -/* - * FIXME: This header has been deemed evil and we need to kill it. Temporarily - * including so we can use 'wait_for'. - */ -#include "i915_utils.h" - /* TODO: move to common file */ #define GUC_PVC_MOCS_INDEX_MASK REG_GENMASK(25, 24) #define PVC_MOCS_UC_INDEX 1 @@ -688,19 +681,17 @@ timeout: header = xe_mmio_read32(gt, reply_reg); if (FIELD_GET(GUC_HXG_MSG_0_TYPE, header) == GUC_HXG_TYPE_NO_RESPONSE_BUSY) { -#define done ({ header = xe_mmio_read32(gt, reply_reg); \ - FIELD_GET(GUC_HXG_MSG_0_ORIGIN, header) != \ - GUC_HXG_ORIGIN_GUC || \ - FIELD_GET(GUC_HXG_MSG_0_TYPE, header) != \ - GUC_HXG_TYPE_NO_RESPONSE_BUSY; }) - ret = wait_for(done, 1000); - if (unlikely(ret)) - goto timeout; + ret = xe_mmio_wait32(gt, reply_reg, + FIELD_PREP(GUC_HXG_MSG_0_TYPE, + GUC_HXG_TYPE_RESPONSE_SUCCESS), + GUC_HXG_MSG_0_TYPE, 1000, &header); + if (unlikely(FIELD_GET(GUC_HXG_MSG_0_ORIGIN, header) != - GUC_HXG_ORIGIN_GUC)) + GUC_HXG_ORIGIN_GUC)) goto proto; -#undef done + if (unlikely(ret)) + goto timeout; } if (FIELD_GET(GUC_HXG_MSG_0_TYPE, header) == |