All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Karol Herbst <kherbst@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>, Ben Skeggs <bskeggs@redhat.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	nouveau <nouveau@lists.freedesktop.org>
Subject: Re: [Nouveau] [PATCH 5/9] drm/nouveau: stop using ttm_bo_wait
Date: Wed, 18 Jan 2023 15:15:39 +0100	[thread overview]
Message-ID: <144efbc1-7604-c2ab-0612-dfcb223f7c00@gmail.com> (raw)
In-Reply-To: <CACO55tsVW9EVdK9TWVMx-v=0YNyMmRAVdBLYGoBOmBKATPO4Gw@mail.gmail.com>

Am 18.01.23 um 14:01 schrieb Karol Herbst:
> On Wed, Jan 18, 2023 at 10:04 AM Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Hi guys,
>>
>> another ping for this. It's just a minor cleanup.
>>
> Acked-by: Karol Herbst <kherbst@redhat.com>

Thanks!

>
> Though I'd say that having a wrapper function like that isn't
> pointless on its own and I kind of fail to see the reason it gets
> removed in the first place.
>
> Also.. I wouldn't call this a "cleanup" because it actually removes
> something useful. Yes, it's only calling one function, but it's more
> of a pain to use the wrapped one than the outer one.

The problem is that it's hiding the timeout.

Just read up what discussion this triggered within the Intel driver.

Christian.

>
>> Dave/Daniel can you help me out here?
>>
>> Thanks,
>> Christian.
>>
>> Am 11.01.23 um 10:52 schrieb Christian König:
>>> Hi guys,
>>>
>>> can I get a quick ack for this?
>>>
>>> The patch has no functional change and is just a cleanup.
>>>
>>> Thanks,
>>> Christian.
>>>
>>> Am 25.11.22 um 11:21 schrieb Christian König:
>>>> TTM is just wrapping core DMA functionality here, remove the mid-layer.
>>>> No functional change.
>>>>
>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>>> ---
>>>>    drivers/gpu/drm/nouveau/nouveau_bo.c  |  6 +++++-
>>>>    drivers/gpu/drm/nouveau/nouveau_gem.c | 11 ++++++++---
>>>>    2 files changed, 13 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> b/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> index 335fa91ca4ad..288eebc70a67 100644
>>>> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> @@ -922,6 +922,7 @@ static void nouveau_bo_move_ntfy(struct
>>>> ttm_buffer_object *bo,
>>>>        struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL;
>>>>        struct nouveau_bo *nvbo = nouveau_bo(bo);
>>>>        struct nouveau_vma *vma;
>>>> +    long ret;
>>>>          /* ttm can now (stupidly) pass the driver bos it didn't
>>>> create... */
>>>>        if (bo->destroy != nouveau_bo_del_ttm)
>>>> @@ -936,7 +937,10 @@ static void nouveau_bo_move_ntfy(struct
>>>> ttm_buffer_object *bo,
>>>>            }
>>>>        } else {
>>>>            list_for_each_entry(vma, &nvbo->vma_list, head) {
>>>> -            WARN_ON(ttm_bo_wait(bo, false, false));
>>>> +            ret = dma_resv_wait_timeout(bo->base.resv,
>>>> +                            DMA_RESV_USAGE_BOOKKEEP,
>>>> +                            false, 15 * HZ);
>>>> +            WARN_ON(ret <= 0);
>>>>                nouveau_vma_unmap(vma);
>>>>            }
>>>>        }
>>>> diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c
>>>> b/drivers/gpu/drm/nouveau/nouveau_gem.c
>>>> index ac5793c96957..f77e44958037 100644
>>>> --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
>>>> +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
>>>> @@ -645,7 +645,7 @@ nouveau_gem_pushbuf_reloc_apply(struct
>>>> nouveau_cli *cli,
>>>>                    struct drm_nouveau_gem_pushbuf_reloc *reloc,
>>>>                    struct drm_nouveau_gem_pushbuf_bo *bo)
>>>>    {
>>>> -    int ret = 0;
>>>> +    long ret = 0;
>>>>        unsigned i;
>>>>          for (i = 0; i < req->nr_relocs; i++) {
>>>> @@ -703,9 +703,14 @@ nouveau_gem_pushbuf_reloc_apply(struct
>>>> nouveau_cli *cli,
>>>>                    data |= r->vor;
>>>>            }
>>>>    -        ret = ttm_bo_wait(&nvbo->bo, false, false);
>>>> +        ret = dma_resv_wait_timeout(nvbo->bo.base.resv,
>>>> +                        DMA_RESV_USAGE_BOOKKEEP,
>>>> +                        false, 15 * HZ);
>>>> +        if (ret == 0)
>>>> +            ret = -EBUSY;
>>>>            if (ret) {
>>>> -            NV_PRINTK(err, cli, "reloc wait_idle failed: %d\n", ret);
>>>> +            NV_PRINTK(err, cli, "reloc wait_idle failed: %ld\n",
>>>> +                  ret);
>>>>                break;
>>>>            }


  reply	other threads:[~2023-01-18 14:15 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 10:21 [PATCH 1/9] drm/amdgpu: generally allow over-commit during BO allocation Christian König
2022-11-25 10:21 ` [Intel-gfx] " Christian König
2022-11-25 10:21 ` [PATCH 2/9] drm/ttm: remove ttm_bo_(un)lock_delayed_workqueue Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2022-11-25 10:21 ` [PATCH 3/9] drm/ttm: use per BO cleanup workers Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2022-11-29 21:14   ` Felix Kuehling
2022-11-29 21:14     ` [Intel-gfx] " Felix Kuehling
2022-12-05 13:39     ` Christian König
2022-12-05 13:39       ` [Intel-gfx] " Christian König
2023-06-13 13:05       ` Karol Herbst
2023-06-13 13:05         ` [Intel-gfx] " Karol Herbst
2023-06-13 13:59         ` Christian König
2023-06-13 13:59           ` [Intel-gfx] " Christian König
2023-06-13 14:18           ` Karol Herbst
2023-06-13 14:18             ` [Intel-gfx] " Karol Herbst
2023-06-15 11:19             ` Christian König
2023-06-15 11:19               ` [Intel-gfx] " Christian König
2023-06-15 12:04               ` Karol Herbst
2023-06-15 12:04                 ` [Intel-gfx] " Karol Herbst
2022-11-25 10:21 ` [PATCH 4/9] drm/ttm: merge ttm_bo_api.h and ttm_bo_driver.h Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2022-11-25 12:43   ` kernel test robot
2022-11-25 12:43     ` [Intel-gfx] " kernel test robot
2022-11-25 21:19   ` kernel test robot
2022-11-25 21:19     ` [Intel-gfx] " kernel test robot
2022-11-25 10:21 ` [PATCH 5/9] drm/nouveau: stop using ttm_bo_wait Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2023-01-11  9:52   ` [Nouveau] " Christian König
2023-01-18  9:04     ` Christian König
2023-01-18  9:42       ` Christian König
2023-01-18 13:01       ` Karol Herbst
2023-01-18 14:15         ` Christian König [this message]
2023-01-18 15:44           ` Danilo Krummrich
2022-11-25 10:21 ` [PATCH 6/9] drm/qxl: " Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2022-12-15 14:19   ` Christian König
2022-12-15 14:19     ` [Intel-gfx] " Christian König
2022-12-15 20:09     ` Dave Airlie
2022-12-15 20:09       ` Dave Airlie
2022-12-15 20:09       ` [Intel-gfx] " Dave Airlie
2022-11-25 10:21 ` [PATCH 7/9] drm/i915: " Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2022-11-25 11:14   ` Tvrtko Ursulin
2022-11-25 12:46     ` Christian König
2022-11-29 18:05     ` Matthew Auld
2022-11-30 13:02       ` Tvrtko Ursulin
2022-11-30 14:06         ` Daniel Vetter
2022-11-30 14:06           ` Daniel Vetter
2022-12-05 19:58           ` Christian König
2022-12-05 19:58             ` Christian König
2022-12-06 18:03             ` Matthew Auld
2022-12-06 18:03               ` Matthew Auld
2022-12-06 18:06               ` Christian König
2022-12-06 18:06                 ` Christian König
2022-11-25 10:21 ` [PATCH 8/9] drm/ttm: use ttm_bo_wait_ctx instead of ttm_bo_wait Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2022-11-25 10:21 ` [PATCH 9/9] drm/ttm: move ttm_bo_wait into VMWGFX Christian König
2022-11-25 10:21   ` [Intel-gfx] " Christian König
2022-11-25 11:17 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/9] drm/amdgpu: generally allow over-commit during BO allocation Patchwork
2022-11-25 11:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-11-25 11:18 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-11-25 11:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-25 18:18 ` [PATCH 1/9] " Alex Deucher
2022-11-25 18:18   ` [Intel-gfx] " Alex Deucher
2022-12-05 13:41   ` Christian König
2022-12-05 13:41     ` [Intel-gfx] " Christian König
2022-11-28  6:00 ` Arunpravin Paneer Selvam
2022-11-28  6:00   ` [Intel-gfx] " Arunpravin Paneer Selvam
2022-12-10  6:15 ` Felix Kuehling
2022-12-10  6:15   ` [Intel-gfx] " Felix Kuehling
2022-12-10 14:12   ` Christian König
2022-12-10 14:12     ` [Intel-gfx] " Christian König
2022-12-11  1:13     ` Felix Kuehling
2022-12-11  1:13       ` [Intel-gfx] " Felix Kuehling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=144efbc1-7604-c2ab-0612-dfcb223f7c00@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=airlied@redhat.com \
    --cc=bskeggs@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=kherbst@redhat.com \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.