Re: [Nouveau] [Intel-gfx] [PATCH v6 08/17] drm/ttm: use gem vma_node

From: Ilia Mirkin
Date: Sat Sep 07 2019 - 22:01:05 EST


On Wed, Aug 21, 2019 at 7:55 AM Thierry Reding <thierry.reding@xxxxxxxxx> wrote:
>
> On Wed, Aug 21, 2019 at 04:33:58PM +1000, Ben Skeggs wrote:
> > On Wed, 14 Aug 2019 at 20:14, Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote:
> > >
> > > Hi,
> > >
> > > > > Changing the order doesn't look hard. Patch attached (untested, have no
> > > > > test hardware). But maybe I missed some detail ...
> > > >
> > > > I came up with something very similar by splitting up nouveau_bo_new()
> > > > into allocation and initialization steps, so that when necessary the GEM
> > > > object can be initialized in between. I think that's slightly more
> > > > flexible and easier to understand than a boolean flag.
> > >
> > > Yes, that should work too.
> > >
> > > Acked-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
> > Acked-by: Ben Skeggs <bskeggs@xxxxxxxxxx>
>
> Thanks guys, applied to drm-misc-next.

Hi Thierry,

Initial investigations suggest that this commit currently in drm-next

commit 019cbd4a4feb3aa3a917d78e7110e3011bbff6d5
Author: Thierry Reding <treding@xxxxxxxxxx>
Date: Wed Aug 14 11:00:48 2019 +0200

drm/nouveau: Initialize GEM object before TTM object

breaks nouveau userspace which tries to allocate GEM objects with a
non-page-aligned size. Previously nouveau_gem_new would just call
nouveau_bo_init which would call nouveau_bo_fixup_align before
initializing the GEM object. With this change, it is done after. What
do you think -- OK to just move that bit of logic into the new
nouveau_bo_alloc() (and make size/align be pointers so that they can
be fixed up?)

Cheers,

-ilia