drm/i915: Reject huge tiled objects
Subsystems (2)
Joonas Lahtinen
maintainerPATCH 1/1 drm/i915: Reject huge tiled objects
We do not yet support tiled objects bigger than the mappable aperture size so reject them.
--- drivers/gpu/drm/i915/i915_gem.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_gem.c +5 -0
@@ -1670,6 +1670,11 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)/* Use a partial view if the object is bigger than the aperture. */ if (obj->base.size >= dev_priv->gtt.mappable_end) { +if (obj->tiling_mode !=I915_TILING_NONE ) { + ret = -ENOSPC ; + goto unlock; + } +static const unsigned int chunk_size =256 ;// 1 MiB memset (&view,0 ,sizeof (view)); view.type =I915_GGTT_VIEW_PARTIAL ;
Signature · 8 lines
1.9.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 5 lines · Joonas Lahtinen
We do not yet support tiled objects bigger than the mappable aperture size so reject them.
Reported-by Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>
This still turns the EINVAL into a SIGBUS. There is only one client that I know of that is prepared to handle SIGBUS here...
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerQuoted 9 lines · Chris Wilson
Quoted 5 lines · Joonas Lahtinen
We do not yet support tiled objects bigger than the mappable aperture size so reject them.
Reported-by Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>This still turns the EINVAL into a SIGBUS. There is only one client that I know of that is prepared to handle SIGBUS here...
Whatever BO passed the mmap early rejection and ended up failing due to low aperture space, produced this same result previously (that would be any object that was of size mappable_aperture_size - framebuffer_size). So it should not be unseen in the clients?
I was very much disturbed by the error handling method when I first discovered it while making the huge BO testcases (I-G-T doesn't handle SIGBUS gracefully either, the process terminates), but didn't want to change it either without knowing the bigger context.
Regards, Joonas
Quoted 2 lines
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Task id: 6355 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV 276/276 276/276 ILK 302/302 302/302 SNB 316/316 316/316 IVB 342/342 342/342 BYT 286/286 286/286 BDW 321/321 321/321
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx