Skip to content

Commit 265b5ee

Browse files
committed
drm/i915/gt: rename legacy engine->hw_id to engine->gen6_hw_id
We kept adding new engines and for that increasing hw_id unnecessarily: it's not used since GRAPHICS_VER == 8. Prepend "gen6" to the field and try to pack it in the structs to give a hint this field is actually not used in recent platforms. Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent f9be300 commit 265b5ee

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/gpu/drm/i915/gt/intel_engine_cs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
#define MAX_MMIO_BASES 3
4444
struct engine_info {
45-
unsigned int hw_id;
45+
u8 gen6_hw_id;
4646
u8 class;
4747
u8 instance;
4848
/* mmio bases table *must* be sorted in reverse graphics_ver order */
@@ -54,23 +54,23 @@ struct engine_info {
5454

5555
static const struct engine_info intel_engines[] = {
5656
[RCS0] = {
57-
.hw_id = RCS0_HW,
57+
.gen6_hw_id = RCS0_HW,
5858
.class = RENDER_CLASS,
5959
.instance = 0,
6060
.mmio_bases = {
6161
{ .graphics_ver = 1, .base = RENDER_RING_BASE }
6262
},
6363
},
6464
[BCS0] = {
65-
.hw_id = BCS0_HW,
65+
.gen6_hw_id = BCS0_HW,
6666
.class = COPY_ENGINE_CLASS,
6767
.instance = 0,
6868
.mmio_bases = {
6969
{ .graphics_ver = 6, .base = BLT_RING_BASE }
7070
},
7171
},
7272
[VCS0] = {
73-
.hw_id = VCS0_HW,
73+
.gen6_hw_id = VCS0_HW,
7474
.class = VIDEO_DECODE_CLASS,
7575
.instance = 0,
7676
.mmio_bases = {
@@ -102,7 +102,7 @@ static const struct engine_info intel_engines[] = {
102102
},
103103
},
104104
[VECS0] = {
105-
.hw_id = VECS0_HW,
105+
.gen6_hw_id = VECS0_HW,
106106
.class = VIDEO_ENHANCEMENT_CLASS,
107107
.instance = 0,
108108
.mmio_bases = {
@@ -290,7 +290,7 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id)
290290
engine->i915 = i915;
291291
engine->gt = gt;
292292
engine->uncore = gt->uncore;
293-
engine->hw_id = info->hw_id;
293+
engine->gen6_hw_id = info->gen6_hw_id;
294294
guc_class = engine_class_to_guc_class(info->class);
295295
engine->guc_id = MAKE_GUC_ID(guc_class, info->instance);
296296
engine->mmio_base = __engine_mmio_base(i915, info->mmio_bases);

drivers/gpu/drm/i915/gt/intel_engine_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ struct intel_engine_cs {
264264
enum intel_engine_id id;
265265
enum intel_engine_id legacy_idx;
266266

267-
unsigned int hw_id;
268267
unsigned int guc_id;
269268

270269
intel_engine_mask_t mask;
271270

271+
u8 gen6_hw_id;
272272
u8 class;
273273
u8 instance;
274274

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
25722572
#define ARB_MODE_BWGTLB_DISABLE (1 << 9)
25732573
#define ARB_MODE_SWIZZLE_BDW (1 << 1)
25742574
#define RENDER_HWS_PGA_GEN7 _MMIO(0x04080)
2575-
#define RING_FAULT_REG(engine) _MMIO(0x4094 + 0x100 * (engine)->hw_id)
2575+
#define RING_FAULT_REG(engine) _MMIO(0x4094 + 0x100 * (engine)->gen6_hw_id)
25762576
#define GEN8_RING_FAULT_REG _MMIO(0x4094)
25772577
#define GEN12_RING_FAULT_REG _MMIO(0xcec4)
25782578
#define GEN8_RING_FAULT_ENGINE_ID(x) (((x) >> 12) & 0x7)

0 commit comments

Comments
 (0)