[PATCH] drm/ttm: fix regression in ttm moves

Dave Airlie airlied at gmail.com
Wed Sep 30 07:09:54 UTC 2020


just FYI I'm seeing a regression on vmwgfx with drm-fixes and drm-next
merged into it.

I'm going take some time to dig through and work out where, the
regression is a command failure and a ioremap failure.

Dave.

On Wed, 30 Sep 2020 at 16:26, Dave Airlie <airlied at gmail.com> wrote:
>
> Uggh this is part of the mess with the revert, I'm not sure how best
> to dig out of this one yet.
>
> Dave.
>
> On Wed, 30 Sep 2020 at 15:55, Dave Airlie <airlied at gmail.com> wrote:
> >
> > From: Dave Airlie <airlied at redhat.com>
> >
> > This fixes a bug introduced in be1213a341a289afc51f89181c310e368fba0b66
> > drm/ttm: remove TTM_MEMTYPE_FLAG_FIXED v2
> >
> > On vmwgfx this causes a Command buffer error WARN to trigger.
> >
> > This is because the old code used to check if bo->ttm was true,
> > and the new code doesn't, fix it code to add back the check resolves
> > the issue.
> >
> > Fixes: be1213a341a2 ("drm/ttm: remove TTM_MEMTYPE_FLAG_FIXED v2")
> > Signed-off-by: Dave Airlie <airlied at redhat.com>
> > ---
> >  drivers/gpu/drm/ttm/ttm_bo.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> > index 70b3bee27850..e8aa2fe8e9d1 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> > @@ -251,9 +251,11 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
> >                 /* Zero init the new TTM structure if the old location should
> >                  * have used one as well.
> >                  */
> > -               ret = ttm_tt_create(bo, old_man->use_tt);
> > -               if (ret)
> > -                       goto out_err;
> > +               if (!bo->ttm) {
> > +                       ret = ttm_tt_create(bo, old_man->use_tt);
> > +                       if (ret)
> > +                               goto out_err;
> > +               }
> >
> >                 ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement);
> >                 if (ret)
> > --
> > 2.20.1
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list