aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-08-19 03:19:30 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-08 05:23:55 -0400
commit3bd3c9329973a93fa3ef5e9840f2fd6fa2889e3f (patch)
treeff0f4e7631d46664c5c6b9990a283842b597b8b1 /drivers/gpu/drm
parentb303cf9542b016e2af3b9d17255a7f93cd790ef5 (diff)
drm/i915: Compile out error state without DEBUG_FS
Alexander reported that the compilation of intel_overlay.c was failing due to an inclusion that was only valid with CONFIG_DEBUG_FS. As the whole error reporting is only useful with debugfs enabled, remove all the redundant error state collection code when compiling without CONFIG_DEBUG_FS. Reported-by: Alexander Lam <lambchop468@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h9
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c4
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c55
3 files changed, 42 insertions, 26 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 101607391c4f..634e1c463dec 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -874,7 +874,6 @@ extern void i915_update_gfx_val(struct drm_i915_private *dev_priv);
874 874
875/* i915_irq.c */ 875/* i915_irq.c */
876void i915_hangcheck_elapsed(unsigned long data); 876void i915_hangcheck_elapsed(unsigned long data);
877void i915_destroy_error_state(struct drm_device *dev);
878extern int i915_irq_emit(struct drm_device *dev, void *data, 877extern int i915_irq_emit(struct drm_device *dev, void *data,
879 struct drm_file *file_priv); 878 struct drm_file *file_priv);
880extern int i915_irq_wait(struct drm_device *dev, void *data, 879extern int i915_irq_wait(struct drm_device *dev, void *data,
@@ -911,6 +910,12 @@ i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
911 910
912void intel_enable_asle (struct drm_device *dev); 911void intel_enable_asle (struct drm_device *dev);
913 912
913#ifdef CONFIG_DEBUG_FS
914extern void i915_destroy_error_state(struct drm_device *dev);
915#else
916#define i915_destroy_error_state(x)
917#endif
918
914 919
915/* i915_mem.c */ 920/* i915_mem.c */
916extern int i915_mem_alloc(struct drm_device *dev, void *data, 921extern int i915_mem_alloc(struct drm_device *dev, void *data,
@@ -1091,8 +1096,10 @@ extern void intel_detect_pch (struct drm_device *dev);
1091extern int intel_trans_dp_port_sel (struct drm_crtc *crtc); 1096extern int intel_trans_dp_port_sel (struct drm_crtc *crtc);
1092 1097
1093/* overlay */ 1098/* overlay */
1099#ifdef CONFIG_DEBUG_FS
1094extern struct intel_overlay_error_state *intel_overlay_capture_error_state(struct drm_device *dev); 1100extern struct intel_overlay_error_state *intel_overlay_capture_error_state(struct drm_device *dev);
1095extern void intel_overlay_print_error_state(struct seq_file *m, struct intel_overlay_error_state *error); 1101extern void intel_overlay_print_error_state(struct seq_file *m, struct intel_overlay_error_state *error);
1102#endif
1096 1103
1097/** 1104/**
1098 * Lock test for when it's just for synchronization of ring access. 1105 * Lock test for when it's just for synchronization of ring access.
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e797157f4bb9..080ea3b162cd 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -421,6 +421,7 @@ static void i915_error_work_func(struct work_struct *work)
421 } 421 }
422} 422}
423 423
424#ifdef CONFIG_DEBUG_FS
424static struct drm_i915_error_object * 425static struct drm_i915_error_object *
425i915_error_object_create(struct drm_device *dev, 426i915_error_object_create(struct drm_device *dev,
426 struct drm_gem_object *src) 427 struct drm_gem_object *src)
@@ -744,6 +745,9 @@ void i915_destroy_error_state(struct drm_device *dev)
744 if (error) 745 if (error)
745 i915_error_state_free(dev, error); 746 i915_error_state_free(dev, error);
746} 747}
748#else
749#define i915_capture_error_state(x)
750#endif
747 751
748static void i915_report_and_clear_eir(struct drm_device *dev) 752static void i915_report_and_clear_eir(struct drm_device *dev)
749{ 753{
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index bb2256f9dbc8..743ced7c4ae7 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -190,31 +190,6 @@ struct intel_overlay {
190}; 190};
191 191
192static struct overlay_registers * 192static struct overlay_registers *
193intel_overlay_map_regs_atomic(struct intel_overlay *overlay,
194 int slot)
195{
196 drm_i915_private_t *dev_priv = overlay->dev->dev_private;
197 struct overlay_registers *regs;
198
199 if (OVERLAY_NEEDS_PHYSICAL(overlay->dev))
200 regs = overlay->reg_bo->phys_obj->handle->vaddr;
201 else
202 regs = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping,
203 overlay->reg_bo->gtt_offset,
204 slot);
205
206 return regs;
207}
208
209static void intel_overlay_unmap_regs_atomic(struct intel_overlay *overlay,
210 int slot,
211 struct overlay_registers *regs)
212{
213 if (!OVERLAY_NEEDS_PHYSICAL(overlay->dev))
214 io_mapping_unmap_atomic(regs, slot);
215}
216
217static struct overlay_registers *
218intel_overlay_map_regs(struct intel_overlay *overlay) 193intel_overlay_map_regs(struct intel_overlay *overlay)
219{ 194{
220 drm_i915_private_t *dev_priv = overlay->dev->dev_private; 195 drm_i915_private_t *dev_priv = overlay->dev->dev_private;
@@ -1454,6 +1429,9 @@ void intel_cleanup_overlay(struct drm_device *dev)
1454 kfree(dev_priv->overlay); 1429 kfree(dev_priv->overlay);
1455} 1430}
1456 1431
1432#ifdef CONFIG_DEBUG_FS
1433#include <linux/seq_file.h>
1434
1457struct intel_overlay_error_state { 1435struct intel_overlay_error_state {
1458 struct overlay_registers regs; 1436 struct overlay_registers regs;
1459 unsigned long base; 1437 unsigned long base;
@@ -1461,6 +1439,32 @@ struct intel_overlay_error_state {
1461 u32 isr; 1439 u32 isr;
1462}; 1440};
1463 1441
1442static struct overlay_registers *
1443intel_overlay_map_regs_atomic(struct intel_overlay *overlay,
1444 int slot)
1445{
1446 drm_i915_private_t *dev_priv = overlay->dev->dev_private;
1447 struct overlay_registers *regs;
1448
1449 if (OVERLAY_NEEDS_PHYSICAL(overlay->dev))
1450 regs = overlay->reg_bo->phys_obj->handle->vaddr;
1451 else
1452 regs = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping,
1453 overlay->reg_bo->gtt_offset,
1454 slot);
1455
1456 return regs;
1457}
1458
1459static void intel_overlay_unmap_regs_atomic(struct intel_overlay *overlay,
1460 int slot,
1461 struct overlay_registers *regs)
1462{
1463 if (!OVERLAY_NEEDS_PHYSICAL(overlay->dev))
1464 io_mapping_unmap_atomic(regs, slot);
1465}
1466
1467
1464struct intel_overlay_error_state * 1468struct intel_overlay_error_state *
1465intel_overlay_capture_error_state(struct drm_device *dev) 1469intel_overlay_capture_error_state(struct drm_device *dev)
1466{ 1470{
@@ -1549,3 +1553,4 @@ intel_overlay_print_error_state(struct seq_file *m, struct intel_overlay_error_s
1549 P(UVSCALEV); 1553 P(UVSCALEV);
1550#undef P 1554#undef P
1551} 1555}
1556#endif