drm/radeon: add a reset work handler
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2013 13:13:52 +0000 (09:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jun 2013 21:50:21 +0000 (17:50 -0400)
New asics support non-privileged IBs.  This allows us
to skip IB checking in the driver since the hardware
will check the command buffers for us.  When using
non-privileged IBs, if the CP encounters an illegal
register in the command stream, it will halt and generate
an interrupt.  The CP needs to be reset to continue.  For now
just do a full GPU reset when this happens.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_irq_kms.c

index 142ce6cc69f5e3564299102ceaa2982adce628e7..f5fccbbf78a6075574fe499fda8aeeeb11a7de50 100644 (file)
@@ -1691,6 +1691,7 @@ struct radeon_device {
        struct si_rlc rlc;
        struct work_struct hotplug_work;
        struct work_struct audio_work;
+       struct work_struct reset_work;
        int num_crtc; /* number of crtcs */
        struct mutex dc_hw_i2c_mutex; /* display controller hw i2c mutex */
        bool audio_enabled;
index 5a99d433fc35d52f57aa11649b1847ce7c7e7321..dbffecad5a4c50ebf167ae292a6aba2fc4f8def8 100644 (file)
@@ -81,6 +81,23 @@ static void radeon_hotplug_work_func(struct work_struct *work)
        drm_helper_hpd_irq_event(dev);
 }
 
+/**
+ * radeon_irq_reset_work_func - execute gpu reset
+ *
+ * @work: work struct
+ *
+ * Execute scheduled gpu reset (cayman+).
+ * This function is called when the irq handler
+ * thinks we need a gpu reset.
+ */
+static void radeon_irq_reset_work_func(struct work_struct *work)
+{
+       struct radeon_device *rdev = container_of(work, struct radeon_device,
+                                                 reset_work);
+
+       radeon_gpu_reset(rdev);
+}
+
 /**
  * radeon_driver_irq_preinstall_kms - drm irq preinstall callback
  *
@@ -243,6 +260,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
 
        INIT_WORK(&rdev->hotplug_work, radeon_hotplug_work_func);
        INIT_WORK(&rdev->audio_work, r600_audio_update_hdmi);
+       INIT_WORK(&rdev->reset_work, radeon_irq_reset_work_func);
 
        spin_lock_init(&rdev->irq.lock);
        r = drm_vblank_init(rdev->ddev, rdev->num_crtc);
This page took 0.027257 seconds and 5 git commands to generate.