Commit 33adf482 authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Jani Nikula

drm/i915/selftests: eliminate use of gen_mask

Remove the remaining uses of INTEL_GEN_MASK() and the correspondent
gen_mask in struct intel_device_info. This will allow the removal of
gen_mask later since it's incompatible with the new per-IP versioning
scheme.
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210413051002.92589-8-lucas.demarchi@intel.com
parent 3e6e4c21
...@@ -2008,12 +2008,14 @@ void intel_uncore_fini_mmio(struct intel_uncore *uncore) ...@@ -2008,12 +2008,14 @@ void intel_uncore_fini_mmio(struct intel_uncore *uncore)
static const struct reg_whitelist { static const struct reg_whitelist {
i915_reg_t offset_ldw; i915_reg_t offset_ldw;
i915_reg_t offset_udw; i915_reg_t offset_udw;
u16 gen_mask; u8 min_graphics_ver;
u8 max_graphics_ver;
u8 size; u8 size;
} reg_read_whitelist[] = { { } reg_read_whitelist[] = { {
.offset_ldw = RING_TIMESTAMP(RENDER_RING_BASE), .offset_ldw = RING_TIMESTAMP(RENDER_RING_BASE),
.offset_udw = RING_TIMESTAMP_UDW(RENDER_RING_BASE), .offset_udw = RING_TIMESTAMP_UDW(RENDER_RING_BASE),
.gen_mask = INTEL_GEN_MASK(4, 12), .min_graphics_ver = 4,
.max_graphics_ver = 12,
.size = 8 .size = 8
} }; } };
...@@ -2038,7 +2040,7 @@ int i915_reg_read_ioctl(struct drm_device *dev, ...@@ -2038,7 +2040,7 @@ int i915_reg_read_ioctl(struct drm_device *dev,
GEM_BUG_ON(entry->size > 8); GEM_BUG_ON(entry->size > 8);
GEM_BUG_ON(entry_offset & (entry->size - 1)); GEM_BUG_ON(entry_offset & (entry->size - 1));
if (INTEL_INFO(i915)->gen_mask & entry->gen_mask && if (IS_GRAPHICS_VER(i915, entry->min_graphics_ver, entry->max_graphics_ver) &&
entry_offset == (reg->offset & -entry->size)) entry_offset == (reg->offset & -entry->size))
break; break;
entry++; entry++;
......
...@@ -125,17 +125,19 @@ static int live_forcewake_ops(void *arg) ...@@ -125,17 +125,19 @@ static int live_forcewake_ops(void *arg)
{ {
static const struct reg { static const struct reg {
const char *name; const char *name;
u8 min_graphics_ver;
u8 max_graphics_ver;
unsigned long platforms; unsigned long platforms;
unsigned int offset; unsigned int offset;
} registers[] = { } registers[] = {
{ {
"RING_START", "RING_START",
INTEL_GEN_MASK(6, 7), 6, 7,
0x38, 0x38,
}, },
{ {
"RING_MI_MODE", "RING_MI_MODE",
INTEL_GEN_MASK(8, BITS_PER_LONG), 8, U8_MAX,
0x9c, 0x9c,
} }
}; };
...@@ -170,7 +172,7 @@ static int live_forcewake_ops(void *arg) ...@@ -170,7 +172,7 @@ static int live_forcewake_ops(void *arg)
/* We have to pick carefully to get the exact behaviour we need */ /* We have to pick carefully to get the exact behaviour we need */
for (r = registers; r->name; r++) for (r = registers; r->name; r++)
if (r->platforms & INTEL_INFO(gt->i915)->gen_mask) if (IS_GRAPHICS_VER(gt->i915, r->min_graphics_ver, r->max_graphics_ver))
break; break;
if (!r->name) { if (!r->name) {
pr_debug("Forcewaked register not known for %s; skipping\n", pr_debug("Forcewaked register not known for %s; skipping\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment