Skip to content

Commit

Permalink
drm/i915: Ditch dev_priv->ums.mm_suspend
Browse files Browse the repository at this point in the history
Again just complicates gem init functions and makes a general mess out
of everything.

Good riddance!

v2: In my enthusiasm to start removing dri1/ums crud I went overboard a
bit and killed parts of hangcheck. Resurrect it.

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
  • Loading branch information
Daniel Vetter committed Nov 20, 2014
1 parent 71b14ab commit 8725548
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 46 deletions.
3 changes: 0 additions & 3 deletions drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
DRM_ERROR("failed to init modeset\n");
goto out_power_well;
}
} else {
/* Start out suspended in ums mode. */
dev_priv->ums.mm_suspended = 1;
}

i915_setup_sysfs(dev);
Expand Down
5 changes: 1 addition & 4 deletions drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,7 @@ int i915_reset(struct drm_device *dev)
* was running at the time of the reset (i.e. we weren't VT
* switched away).
*/
if (drm_core_check_feature(dev, DRIVER_MODESET) ||
!dev_priv->ums.mm_suspended) {
dev_priv->ums.mm_suspended = 0;

if (drm_core_check_feature(dev, DRIVER_MODESET)) {
/* Used to prevent gem_check_wedged returning -EAGAIN during gpu reset */
dev_priv->gpu_error.reload_in_reset = true;

Expand Down
15 changes: 0 additions & 15 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1121,18 +1121,6 @@ struct i915_power_domains {
struct i915_power_well *power_wells;
};

struct i915_ums_state {
/**
* Flag if the X Server, and thus DRM, is not currently in
* control of the device.
*
* This is set between LeaveVT and EnterVT. It needs to be
* replaced with a semaphore. It also needs to be
* transitioned away from for kernel modesetting.
*/
int mm_suspended;
};

#define MAX_L3_SLICES 2
struct intel_l3_parity {
u32 *remap_info[MAX_L3_SLICES];
Expand Down Expand Up @@ -1768,9 +1756,6 @@ struct drm_i915_private {

uint32_t bios_vgacntr;

/* Old ums support infrastructure, same warning applies. */
struct i915_ums_state ums;

/* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
struct {
int (*do_execbuf)(struct drm_device *dev, struct drm_file *file,
Expand Down
24 changes: 6 additions & 18 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2501,15 +2501,13 @@ int __i915_add_request(struct intel_engine_cs *ring,
ring->outstanding_lazy_seqno = 0;
ring->preallocated_lazy_request = NULL;

if (!dev_priv->ums.mm_suspended) {
i915_queue_hangcheck(ring->dev);
i915_queue_hangcheck(ring->dev);

cancel_delayed_work_sync(&dev_priv->mm.idle_work);
queue_delayed_work(dev_priv->wq,
&dev_priv->mm.retire_work,
round_jiffies_up_relative(HZ));
intel_mark_busy(dev_priv->dev);
}
cancel_delayed_work_sync(&dev_priv->mm.idle_work);
queue_delayed_work(dev_priv->wq,
&dev_priv->mm.retire_work,
round_jiffies_up_relative(HZ));
intel_mark_busy(dev_priv->dev);

if (out_seqno)
*out_seqno = request->seqno;
Expand Down Expand Up @@ -4651,9 +4649,6 @@ i915_gem_suspend(struct drm_device *dev)
int ret = 0;

mutex_lock(&dev->struct_mutex);
if (dev_priv->ums.mm_suspended)
goto err;

ret = i915_gpu_idle(dev);
if (ret)
goto err;
Expand All @@ -4665,13 +4660,6 @@ i915_gem_suspend(struct drm_device *dev)
i915_gem_evict_everything(dev);

i915_gem_stop_ringbuffers(dev);

/* Hack! Don't let anybody do execbuf while we don't control the chip.
* We need to replace this with a semaphore, or something.
* And not confound ums.mm_suspended!
*/
dev_priv->ums.mm_suspended = !drm_core_check_feature(dev,
DRIVER_MODESET);
mutex_unlock(&dev->struct_mutex);

del_timer_sync(&dev_priv->gpu_error.hangcheck_timer);
Expand Down
6 changes: 0 additions & 6 deletions drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,12 +1338,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
if (ret)
goto pre_mutex_err;

if (dev_priv->ums.mm_suspended) {
mutex_unlock(&dev->struct_mutex);
ret = -EBUSY;
goto pre_mutex_err;
}

ctx = i915_gem_validate_context(dev, file, ring, ctx_id);
if (IS_ERR(ctx)) {
mutex_unlock(&dev->struct_mutex);
Expand Down

0 comments on commit 8725548

Please sign in to comment.