diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index a000cf028826..53d544552625 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -713,18 +713,18 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data, | |||
713 | mutex_unlock(&dev->struct_mutex); | 713 | mutex_unlock(&dev->struct_mutex); |
714 | if (ret) { | 714 | if (ret) { |
715 | DRM_ERROR("i915_dispatch_cmdbuffer failed\n"); | 715 | DRM_ERROR("i915_dispatch_cmdbuffer failed\n"); |
716 | goto fail_batch_free; | 716 | goto fail_clip_free; |
717 | } | 717 | } |
718 | 718 | ||
719 | if (sarea_priv) | 719 | if (sarea_priv) |
720 | sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); | 720 | sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); |
721 | 721 | ||
722 | fail_batch_free: | ||
723 | drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); | ||
724 | fail_clip_free: | 722 | fail_clip_free: |
725 | drm_free(cliprects, | 723 | drm_free(cliprects, |
726 | cmdbuf->num_cliprects * sizeof(struct drm_clip_rect), | 724 | cmdbuf->num_cliprects * sizeof(struct drm_clip_rect), |
727 | DRM_MEM_DRIVER); | 725 | DRM_MEM_DRIVER); |
726 | fail_batch_free: | ||
727 | drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); | ||
728 | 728 | ||
729 | return ret; | 729 | return ret; |
730 | } | 730 | } |
@@ -1011,8 +1011,16 @@ static int i915_load_modeset_init(struct drm_device *dev) | |||
1011 | /* Basic memrange allocator for stolen space (aka vram) */ | 1011 | /* Basic memrange allocator for stolen space (aka vram) */ |
1012 | drm_mm_init(&dev_priv->vram, 0, prealloc_size); | 1012 | drm_mm_init(&dev_priv->vram, 0, prealloc_size); |
1013 | 1013 | ||
1014 | /* Let GEM Manage from end of prealloc space to end of aperture */ | 1014 | /* Let GEM Manage from end of prealloc space to end of aperture. |
1015 | i915_gem_do_init(dev, prealloc_size, agp_size); | 1015 | * |
1016 | * However, leave one page at the end still bound to the scratch page. | ||
1017 | * There are a number of places where the hardware apparently | ||
1018 | * prefetches past the end of the object, and we've seen multiple | ||
1019 | * hangs with the GPU head pointer stuck in a batchbuffer bound | ||
1020 | * at the last page of the aperture. One page should be enough to | ||
1021 | * keep any prefetching inside of the aperture. | ||
1022 | */ | ||
1023 | i915_gem_do_init(dev, prealloc_size, agp_size - 4096); | ||
1016 | 1024 | ||
1017 | ret = i915_gem_init_ringbuffer(dev); | 1025 | ret = i915_gem_init_ringbuffer(dev); |
1018 | if (ret) | 1026 | if (ret) |
@@ -1232,7 +1240,7 @@ int i915_driver_unload(struct drm_device *dev) | |||
1232 | if (dev_priv->regs != NULL) | 1240 | if (dev_priv->regs != NULL) |
1233 | iounmap(dev_priv->regs); | 1241 | iounmap(dev_priv->regs); |
1234 | 1242 | ||
1235 | intel_opregion_free(dev); | 1243 | intel_opregion_free(dev, 0); |
1236 | 1244 | ||
1237 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 1245 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
1238 | intel_modeset_cleanup(dev); | 1246 | intel_modeset_cleanup(dev); |
@@ -1350,6 +1358,7 @@ struct drm_ioctl_desc i915_ioctls[] = { | |||
1350 | DRM_IOCTL_DEF(DRM_I915_GEM_SET_TILING, i915_gem_set_tiling, 0), | 1358 | DRM_IOCTL_DEF(DRM_I915_GEM_SET_TILING, i915_gem_set_tiling, 0), |
1351 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_TILING, i915_gem_get_tiling, 0), | 1359 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_TILING, i915_gem_get_tiling, 0), |
1352 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_APERTURE, i915_gem_get_aperture_ioctl, 0), | 1360 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_APERTURE, i915_gem_get_aperture_ioctl, 0), |
1361 | DRM_IOCTL_DEF(DRM_I915_GET_PIPE_FROM_CRTC_ID, intel_get_pipe_from_crtc_id, 0), | ||
1353 | }; | 1362 | }; |
1354 | 1363 | ||
1355 | int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); | 1364 | int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); |