aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-10-17 17:41:03 -0400
committerDave Airlie <airlied@redhat.com>2008-10-22 23:42:27 -0400
commita2d44cca4fc9ae04ed2c9fc2ef16b6989eeae218 (patch)
tree61bc40b8367f8afefc1217f3b10fb1abf8500dc3 /drivers/gpu
parent053d7f244a8739d96d316c77a97cd063804c8e35 (diff)
i915: Don't dereference HWS in /proc debug files when it isn't initialized.
Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_proc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_proc.c b/drivers/gpu/drm/i915/i915_gem_proc.c
index 15d4160415b0..93de15b4c9a7 100644
--- a/drivers/gpu/drm/i915/i915_gem_proc.c
+++ b/drivers/gpu/drm/i915/i915_gem_proc.c
@@ -192,7 +192,12 @@ static int i915_gem_seqno_info(char *buf, char **start, off_t offset,
192 192
193 *start = &buf[offset]; 193 *start = &buf[offset];
194 *eof = 0; 194 *eof = 0;
195 DRM_PROC_PRINT("Current sequence: %d\n", i915_get_gem_seqno(dev)); 195 if (dev_priv->hw_status_page != NULL) {
196 DRM_PROC_PRINT("Current sequence: %d\n",
197 i915_get_gem_seqno(dev));
198 } else {
199 DRM_PROC_PRINT("Current sequence: hws uninitialized\n");
200 }
196 DRM_PROC_PRINT("Waiter sequence: %d\n", 201 DRM_PROC_PRINT("Waiter sequence: %d\n",
197 dev_priv->mm.waiting_gem_seqno); 202 dev_priv->mm.waiting_gem_seqno);
198 DRM_PROC_PRINT("IRQ sequence: %d\n", dev_priv->mm.irq_gem_seqno); 203 DRM_PROC_PRINT("IRQ sequence: %d\n", dev_priv->mm.irq_gem_seqno);
@@ -230,8 +235,12 @@ static int i915_interrupt_info(char *buf, char **start, off_t offset,
230 I915_READ(PIPEBSTAT)); 235 I915_READ(PIPEBSTAT));
231 DRM_PROC_PRINT("Interrupts received: %d\n", 236 DRM_PROC_PRINT("Interrupts received: %d\n",
232 atomic_read(&dev_priv->irq_received)); 237 atomic_read(&dev_priv->irq_received));
233 DRM_PROC_PRINT("Current sequence: %d\n", 238 if (dev_priv->hw_status_page != NULL) {
234 i915_get_gem_seqno(dev)); 239 DRM_PROC_PRINT("Current sequence: %d\n",
240 i915_get_gem_seqno(dev));
241 } else {
242 DRM_PROC_PRINT("Current sequence: hws uninitialized\n");
243 }
235 DRM_PROC_PRINT("Waiter sequence: %d\n", 244 DRM_PROC_PRINT("Waiter sequence: %d\n",
236 dev_priv->mm.waiting_gem_seqno); 245 dev_priv->mm.waiting_gem_seqno);
237 DRM_PROC_PRINT("IRQ sequence: %d\n", 246 DRM_PROC_PRINT("IRQ sequence: %d\n",