summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-04-27 15:17:39 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-05 19:46:16 +0200
commit742cbee8049f434d8ae7908ee56fe4cad3db2658 (patch)
tree513e556a980b4cd53b08a5cf90815288d9b34c81 /drivers/gpu/drm/i915/i915_drv.h
parente5eb3d63c6182d3f21fbfc836ded748d49d521f9 (diff)
downloadlwn-742cbee8049f434d8ae7908ee56fe4cad3db2658.tar.gz
lwn-742cbee8049f434d8ae7908ee56fe4cad3db2658.zip
drm/i915: rework dev->first_error locking
- reduce the irq disabled section, even for a debugfs file this was way too long. - always disable irqs when taking the lock. v2: Thou shalt not mistake locking for reference counting, so: - reference count the error_state to protect from concurent freeeing. This will be only really used in the next patch. Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 090ec20293f2..c070a2b3f049 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -39,6 +39,7 @@
#include <drm/intel-gtt.h>
#include <linux/backlight.h>
#include <linux/intel-iommu.h>
+#include <linux/kref.h>
/* General customization:
*/
@@ -171,6 +172,7 @@ struct sdvo_device_mapping {
struct intel_display_error_state;
struct drm_i915_error_state {
+ struct kref ref;
u32 eir;
u32 pgtbl_er;
u32 ier;
@@ -465,6 +467,7 @@ typedef struct drm_i915_private {
unsigned int fsb_freq, mem_freq, is_ddr3;
spinlock_t error_lock;
+ /* Protected by dev->error_lock. */
struct drm_i915_error_state *first_error;
struct work_struct error_work;
struct completion error_completion;
@@ -1163,6 +1166,8 @@ void i915_handle_error(struct drm_device *dev, bool wedged);
extern void intel_irq_init(struct drm_device *dev);
+void i915_error_state_free(struct kref *error_ref);
+
void
i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);