Skip to content

Commit f2f4d82

Browse files
jnikuladanvet
authored andcommitted
drm/i915: give more distinctive names to ring hangcheck action enums
The short lowercase names are bound to collide. The default warnings don't even warn about shadowing. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent c8b5018 commit f2f4d82

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

‎drivers/gpu/drm/i915/i915_gem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ static void i915_set_reset_status(struct intel_ring_buffer *ring,
22142214
offset = i915_gem_obj_offset(request->batch_obj,
22152215
request_to_vm(request));
22162216

2217-
if (ring->hangcheck.action != wait &&
2217+
if (ring->hangcheck.action != HANGCHECK_WAIT &&
22182218
i915_request_guilty(request, acthd, &inside)) {
22192219
DRM_ERROR("%s hung %s bo (0x%lx ctx %d) at 0x%x\n",
22202220
ring->name,

‎drivers/gpu/drm/i915/i915_irq.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,10 +1826,10 @@ ring_stuck(struct intel_ring_buffer *ring, u32 acthd)
18261826
u32 tmp;
18271827

18281828
if (ring->hangcheck.acthd != acthd)
1829-
return active;
1829+
return HANGCHECK_ACTIVE;
18301830

18311831
if (IS_GEN2(dev))
1832-
return hung;
1832+
return HANGCHECK_HUNG;
18331833

18341834
/* Is the chip hanging on a WAIT_FOR_EVENT?
18351835
* If so we can simply poke the RB_WAIT bit
@@ -1841,24 +1841,24 @@ ring_stuck(struct intel_ring_buffer *ring, u32 acthd)
18411841
DRM_ERROR("Kicking stuck wait on %s\n",
18421842
ring->name);
18431843
I915_WRITE_CTL(ring, tmp);
1844-
return kick;
1844+
return HANGCHECK_KICK;
18451845
}
18461846

18471847
if (INTEL_INFO(dev)->gen >= 6 && tmp & RING_WAIT_SEMAPHORE) {
18481848
switch (semaphore_passed(ring)) {
18491849
default:
1850-
return hung;
1850+
return HANGCHECK_HUNG;
18511851
case 1:
18521852
DRM_ERROR("Kicking stuck semaphore on %s\n",
18531853
ring->name);
18541854
I915_WRITE_CTL(ring, tmp);
1855-
return kick;
1855+
return HANGCHECK_KICK;
18561856
case 0:
1857-
return wait;
1857+
return HANGCHECK_WAIT;
18581858
}
18591859
}
18601860

1861-
return hung;
1861+
return HANGCHECK_HUNG;
18621862
}
18631863

18641864
/**
@@ -1926,16 +1926,16 @@ static void i915_hangcheck_elapsed(unsigned long data)
19261926
acthd);
19271927

19281928
switch (ring->hangcheck.action) {
1929-
case wait:
1929+
case HANGCHECK_WAIT:
19301930
score = 0;
19311931
break;
1932-
case active:
1932+
case HANGCHECK_ACTIVE:
19331933
score = BUSY;
19341934
break;
1935-
case kick:
1935+
case HANGCHECK_KICK:
19361936
score = KICK;
19371937
break;
1938-
case hung:
1938+
case HANGCHECK_HUNG:
19391939
score = HUNG;
19401940
stuck[i] = true;
19411941
break;

‎drivers/gpu/drm/i915/intel_ringbuffer.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ struct intel_hw_status_page {
3737
#define I915_READ_SYNC_0(ring) I915_READ(RING_SYNC_0((ring)->mmio_base))
3838
#define I915_READ_SYNC_1(ring) I915_READ(RING_SYNC_1((ring)->mmio_base))
3939

40-
enum intel_ring_hangcheck_action { wait, active, kick, hung };
40+
enum intel_ring_hangcheck_action {
41+
HANGCHECK_WAIT,
42+
HANGCHECK_ACTIVE,
43+
HANGCHECK_KICK,
44+
HANGCHECK_HUNG,
45+
};
4146

4247
struct intel_ring_hangcheck {
4348
bool deadlock;

0 commit comments

Comments
 (0)