lkml.org 
[lkml]   [2009]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 42/43] drm/i915: Dont allow objects to get bound while VT switched.
    2.6.28-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Eric Anholt <eric@anholt.net>

    commit 9bb2d6f94aeb9a185d69aedbd19421b6da4e3309 upstream.

    This avoids a BUG_ON in the enter_vt path due to objects being in the GTT
    when we shouldn't have ever let them be (as we're not supposed to touch the
    device during that time).

    This was triggered by a change in the 2D driver to use the GTT mapping of
    objects after pinning them to improve software fallback performance.

    Signed-off-by: Eric Anholt <eric@anholt.net>
    Signed-off-by: Dave Airlie <airlied@linux.ie>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/gpu/drm/i915/i915_gem.c | 15 +++++++++------
    1 file changed, 9 insertions(+), 6 deletions(-)

    --- a/drivers/gpu/drm/i915/i915_gem.c
    +++ b/drivers/gpu/drm/i915/i915_gem.c
    @@ -1161,6 +1161,8 @@ i915_gem_object_bind_to_gtt(struct drm_g
    struct drm_mm_node *free_space;
    int page_count, ret;

    + if (dev_priv->mm.suspended)
    + return -EBUSY;
    if (alignment == 0)
    alignment = PAGE_SIZE;
    if (alignment & (PAGE_SIZE - 1)) {
    @@ -2180,7 +2182,7 @@ i915_gem_object_pin(struct drm_gem_objec
    if (obj_priv->gtt_space == NULL) {
    ret = i915_gem_object_bind_to_gtt(obj, alignment);
    if (ret != 0) {
    - if (ret != -ERESTARTSYS)
    + if (ret != -EBUSY && ret != -ERESTARTSYS)
    DRM_ERROR("Failure to bind: %d", ret);
    return ret;
    }
    @@ -2703,20 +2705,21 @@ i915_gem_entervt_ioctl(struct drm_device
    dev_priv->mm.wedged = 0;
    }

    - ret = i915_gem_init_ringbuffer(dev);
    - if (ret != 0)
    - return ret;
    -
    dev_priv->mm.gtt_mapping = io_mapping_create_wc(dev->agp->base,
    dev->agp->agp_info.aper_size
    * 1024 * 1024);

    mutex_lock(&dev->struct_mutex);
    + dev_priv->mm.suspended = 0;
    +
    + ret = i915_gem_init_ringbuffer(dev);
    + if (ret != 0)
    + return ret;
    +
    BUG_ON(!list_empty(&dev_priv->mm.active_list));
    BUG_ON(!list_empty(&dev_priv->mm.flushing_list));
    BUG_ON(!list_empty(&dev_priv->mm.inactive_list));
    BUG_ON(!list_empty(&dev_priv->mm.request_list));
    - dev_priv->mm.suspended = 0;
    mutex_unlock(&dev->struct_mutex);

    drm_irq_install(dev);



    \
     
     \ /
      Last update: 2009-03-21 00:45    [W:3.357 / U:0.312 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site