Re: [Intel-gfx] [PATCH] drm/i915: Force relocations via cpu if we run out of idle aperture

2016-10-06 Thread Joonas Lahtinen
On to, 2016-10-06 at 08:41 +0100, Chris Wilson wrote:
> If we run out of enough aperture space to fit the entire object, we
> fallback to trying to insert a single page. However, if that also fails,
> we currently fail to userspace with an unexpected ENOSPC. (ENOSPC means
> to userspace that their batch could not be fitted within the GTT.) Prior
> to commit e8cb909ac3ab ("drm/i915: Fallback to single page GTT
> mmappings for relocations") the approach is to fallback to using the
> slow CPU relocation path in case of iomapping failure, and that is the
> behaviour we need to restore.
> 
> Fixes: e8cb909ac3ab ("drm/i915: Fallback to single page GTT mmappings...")
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98101
> Signed-off-by: Chris Wilson 
> Cc: Joonas Lahtinen 

Reviewed-by: Joonas Lahtinen 

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Force relocations via cpu if we run out of idle aperture

2016-10-06 Thread Chris Wilson
If we run out of enough aperture space to fit the entire object, we
fallback to trying to insert a single page. However, if that also fails,
we currently fail to userspace with an unexpected ENOSPC. (ENOSPC means
to userspace that their batch could not be fitted within the GTT.) Prior
to commit e8cb909ac3ab ("drm/i915: Fallback to single page GTT
mmappings for relocations") the approach is to fallback to using the
slow CPU relocation path in case of iomapping failure, and that is the
behaviour we need to restore.

Fixes: e8cb909ac3ab ("drm/i915: Fallback to single page GTT mmappings...")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98101
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 8c0cf1417e79..cdcdab2b0370 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -461,8 +461,8 @@ static void *reloc_iomap(struct drm_i915_gem_object *obj,
 0, ggtt->mappable_end,
 DRM_MM_SEARCH_DEFAULT,
 DRM_MM_CREATE_DEFAULT);
-   if (ret)
-   return ERR_PTR(ret);
+   if (ret) /* no inactive aperture space, use cpu reloc */
+   return NULL;
} else {
ret = i915_vma_put_fence(vma);
if (ret) {
-- 
2.9.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx