]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe: Ensure XE_BO_FLAG_CPU_ADDR_MIRROR has a unique value
authorMatt Roper <matthew.d.roper@intel.com>
Fri, 4 Apr 2025 22:00:54 +0000 (15:00 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Mon, 7 Apr 2025 13:43:18 +0000 (06:43 -0700)
commitf350747a9935d6c1539684c37f30e45ce9a3319f
treedd7d62f7698298e47850b7154fbf95b30962167c
parentae28e34400aab0dc4876eac83766fa9731f9901c
drm/xe: Ensure XE_BO_FLAG_CPU_ADDR_MIRROR has a unique value

When XE_BO_FLAG_PINNED_NORESTORE and XE_BO_FLAG_PINNED_LATE_RESTORE were
added, they were assigned BO flag values in the middle of the flag
range, requiring renumbering of the higher flags.  In both cases,
XE_BO_FLAG_CPU_ADDR_MIRROR was overlooked during renumbering because it
was defined below XE_BO_FLAG_GGTT_ALL and thus was not immediately
visible in code diffs changing this area of the code; this resulted in
XE_BO_FLAG_CPU_ADDR_MIRROR clashing with another flag.

Assign XE_BO_FLAG_CPU_ADDR_MIRROR a unique value, and also move the
definition of XE_BO_FLAG_GGTT_ALL down below all of the individual flags
so that this kind of mistake is less likely in the future.  Also, while
we're at it, fix up some space vs tab whitespace inconsistency in these
flag definitions.

Fixes: 7f387e6012b6 ("drm/xe: add XE_BO_FLAG_PINNED_LATE_RESTORE")
Fixes: 045448da87bf ("drm/xe: Add XE_BO_FLAG_PINNED_NORESTORE")
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20250404220053.1758356-2-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_bo.h