Commit d4b8bb2a authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: kill flags parameter for reset functions

Only half of them even cared, and it's always the same one.
Reviewed-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 2b9dc9a2
...@@ -673,7 +673,7 @@ int i915_resume(struct drm_device *dev) ...@@ -673,7 +673,7 @@ int i915_resume(struct drm_device *dev)
return 0; return 0;
} }
static int i8xx_do_reset(struct drm_device *dev, u8 flags) static int i8xx_do_reset(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -710,7 +710,7 @@ static int i965_reset_complete(struct drm_device *dev) ...@@ -710,7 +710,7 @@ static int i965_reset_complete(struct drm_device *dev)
return gdrst & 0x1; return gdrst & 0x1;
} }
static int i965_do_reset(struct drm_device *dev, u8 flags) static int i965_do_reset(struct drm_device *dev)
{ {
u8 gdrst; u8 gdrst;
...@@ -720,20 +720,22 @@ static int i965_do_reset(struct drm_device *dev, u8 flags) ...@@ -720,20 +720,22 @@ static int i965_do_reset(struct drm_device *dev, u8 flags)
* triggers the reset; when done, the hardware will clear it. * triggers the reset; when done, the hardware will clear it.
*/ */
pci_read_config_byte(dev->pdev, I965_GDRST, &gdrst); pci_read_config_byte(dev->pdev, I965_GDRST, &gdrst);
pci_write_config_byte(dev->pdev, I965_GDRST, gdrst | flags | 0x1); pci_write_config_byte(dev->pdev, I965_GDRST,
gdrst | GRDOM_RENDER | 0x1);
return wait_for(i965_reset_complete(dev), 500); return wait_for(i965_reset_complete(dev), 500);
} }
static int ironlake_do_reset(struct drm_device *dev, u8 flags) static int ironlake_do_reset(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
u32 gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); u32 gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR);
I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, gdrst | flags | 0x1); I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR,
gdrst | GRDOM_RENDER | 0x1);
return wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500); return wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500);
} }
static int gen6_do_reset(struct drm_device *dev, u8 flags) static int gen6_do_reset(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
int ret; int ret;
...@@ -768,7 +770,7 @@ static int gen6_do_reset(struct drm_device *dev, u8 flags) ...@@ -768,7 +770,7 @@ static int gen6_do_reset(struct drm_device *dev, u8 flags)
return ret; return ret;
} }
static int intel_gpu_reset(struct drm_device *dev, u8 flags) static int intel_gpu_reset(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
int ret = -ENODEV; int ret = -ENODEV;
...@@ -776,16 +778,16 @@ static int intel_gpu_reset(struct drm_device *dev, u8 flags) ...@@ -776,16 +778,16 @@ static int intel_gpu_reset(struct drm_device *dev, u8 flags)
switch (INTEL_INFO(dev)->gen) { switch (INTEL_INFO(dev)->gen) {
case 7: case 7:
case 6: case 6:
ret = gen6_do_reset(dev, flags); ret = gen6_do_reset(dev);
break; break;
case 5: case 5:
ret = ironlake_do_reset(dev, flags); ret = ironlake_do_reset(dev);
break; break;
case 4: case 4:
ret = i965_do_reset(dev, flags); ret = i965_do_reset(dev);
break; break;
case 2: case 2:
ret = i8xx_do_reset(dev, flags); ret = i8xx_do_reset(dev);
break; break;
} }
...@@ -806,7 +808,6 @@ static int intel_gpu_reset(struct drm_device *dev, u8 flags) ...@@ -806,7 +808,6 @@ static int intel_gpu_reset(struct drm_device *dev, u8 flags)
/** /**
* i915_reset - reset chip after a hang * i915_reset - reset chip after a hang
* @dev: drm device to reset * @dev: drm device to reset
* @flags: reset domains
* *
* Reset the chip. Useful if a hang is detected. Returns zero on successful * Reset the chip. Useful if a hang is detected. Returns zero on successful
* reset or otherwise an error code. * reset or otherwise an error code.
...@@ -819,7 +820,7 @@ static int intel_gpu_reset(struct drm_device *dev, u8 flags) ...@@ -819,7 +820,7 @@ static int intel_gpu_reset(struct drm_device *dev, u8 flags)
* - re-init interrupt state * - re-init interrupt state
* - re-init display * - re-init display
*/ */
int i915_reset(struct drm_device *dev, u8 flags) int i915_reset(struct drm_device *dev)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
int ret; int ret;
...@@ -838,7 +839,7 @@ int i915_reset(struct drm_device *dev, u8 flags) ...@@ -838,7 +839,7 @@ int i915_reset(struct drm_device *dev, u8 flags)
if (get_seconds() - dev_priv->last_gpu_reset < 5) if (get_seconds() - dev_priv->last_gpu_reset < 5)
DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); DRM_ERROR("GPU hanging too fast, declaring wedged!\n");
else else
ret = intel_gpu_reset(dev, flags); ret = intel_gpu_reset(dev);
dev_priv->last_gpu_reset = get_seconds(); dev_priv->last_gpu_reset = get_seconds();
if (ret) { if (ret) {
......
...@@ -1153,7 +1153,7 @@ extern long i915_compat_ioctl(struct file *filp, unsigned int cmd, ...@@ -1153,7 +1153,7 @@ extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
extern int i915_emit_box(struct drm_device *dev, extern int i915_emit_box(struct drm_device *dev,
struct drm_clip_rect *box, struct drm_clip_rect *box,
int DR1, int DR4); int DR1, int DR4);
extern int i915_reset(struct drm_device *dev, u8 flags); extern int i915_reset(struct drm_device *dev);
extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv); extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv);
......
...@@ -758,7 +758,7 @@ static void i915_error_work_func(struct work_struct *work) ...@@ -758,7 +758,7 @@ static void i915_error_work_func(struct work_struct *work)
if (atomic_read(&dev_priv->mm.wedged)) { if (atomic_read(&dev_priv->mm.wedged)) {
DRM_DEBUG_DRIVER("resetting chip\n"); DRM_DEBUG_DRIVER("resetting chip\n");
kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_event); kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_event);
if (!i915_reset(dev, GRDOM_RENDER)) { if (!i915_reset(dev)) {
atomic_set(&dev_priv->mm.wedged, 0); atomic_set(&dev_priv->mm.wedged, 0);
kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_done_event); kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_done_event);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment