diff options
author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-01-12 17:25:09 -0500 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-12 14:05:59 -0500 |
commit | b56d208273bf5be6593d0dcd2d471f771c08a805 (patch) | |
tree | 5a519be03b3aa08711ed6330b000676a7f3e2555 /drivers/gpu/drm/xe/xe_wopcm.c | |
parent | b6f468b847d09ca1fe5cea2606a323be892f8893 (diff) | |
download | lwn-b56d208273bf5be6593d0dcd2d471f771c08a805.tar.gz lwn-b56d208273bf5be6593d0dcd2d471f771c08a805.zip |
drm/xe: Stop using i915_utils in xe_wopcm.
We don't need any macro for a simple check we can do explicitly
and clear.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_wopcm.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_wopcm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_wopcm.c b/drivers/gpu/drm/xe/xe_wopcm.c index e4a8d4a1899e..8fe182afa06c 100644 --- a/drivers/gpu/drm/xe/xe_wopcm.c +++ b/drivers/gpu/drm/xe/xe_wopcm.c @@ -11,8 +11,6 @@ #include "xe_uc_fw.h" #include "xe_wopcm.h" -#include "i915_utils.h" - /** * DOC: Write Once Protected Content Memory (WOPCM) Layout * @@ -92,7 +90,8 @@ static bool __check_layout(struct xe_device *xe, u32 wopcm_size, u32 size; size = wopcm_size - ctx_rsvd; - if (unlikely(range_overflows(guc_wopcm_base, guc_wopcm_size, size))) { + if (unlikely(guc_wopcm_base >= size || + guc_wopcm_size > size - guc_wopcm_base)) { drm_err(&xe->drm, "WOPCM: invalid GuC region layout: %uK + %uK > %uK\n", guc_wopcm_base / SZ_1K, guc_wopcm_size / SZ_1K, |