[Intel-gfx] [CI 6/7] drm/i915: Eliminate superfluous i915_ggtt_view_rotated

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 23 14:44:59 UTC 2017


On Mon, Jan 23, 2017 at 02:39:03PM +0000, Chris Wilson wrote:
> On Mon, Jan 23, 2017 at 02:22:38PM +0000, Matthew Auld wrote:
> > On 23 January 2017 at 14:02, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > > On Mon, Jan 23, 2017 at 01:51:54PM +0000, Matthew Auld wrote:
> > >> On 14 January 2017 at 00:28, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > >> > It is only being used to clear a struct and set the type, after which it
> > >> > is overwritten. Since we no longer check the unset bits of the union,
> > >> > skipping the clear is permissible.
> > >> >
> > >> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > >> > Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> > >> My machine is all of a sudden hanging just after boot and bisection
> > >> points to this as the culprit. When I revert back to the old behaviour
> > >> of copying from the zeroed struct for the normal case, then the issue
> > >> disappears, which doesn't make any sense. Any ideas?
> > >
> > > Quick diff of which clear you need?
> > 
> > -       view->type = I915_GGTT_VIEW_NORMAL;
> >         if (drm_rotation_90_or_270(rotation)) {
> >                 view->type = I915_GGTT_VIEW_ROTATED;
> >                 view->rotated = to_intel_framebuffer(fb)->rot_info;
> > +       } else {
> > +               *view = i915_ggtt_view_normal;
> >         }
> >  }
> 
> For no good reason, perhaps?
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 307b22ae7791..155906e84812 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -91,7 +91,7 @@ vma_create(struct drm_i915_gem_object *obj,
>         vma->size = obj->base.size;
>         vma->display_alignment = I915_GTT_MIN_ALIGNMENT;
>  
> -       if (view) {
> +       if (view && view->type != I915_GGTT_VIEW_NORMAL) {

Found reason.

i915_gem_fault:
        ret = remap_io_mapping(area,
                               area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT),
                               (ggtt->mappable_base + vma->node.start) >> PAGE_SHIFT,
                               min_t(u64, vma->size, area->vm_end - area->vm_start),
                               &ggtt->mappable);

So we depend upon ggtt_view being cleared for normal. Patch works, but we
still have a subtlety in that ROTATED cannot be mapped.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list