From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
Dave Airlie <airlied@redhat.com>, Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH 6/9] drm/qxl: stop using ttm_bo_wait
Date: Thu, 15 Dec 2022 15:19:55 +0100 [thread overview]
Message-ID: <0169e3dd-c705-175d-9045-2baf0cbabb78@gmail.com> (raw)
In-Reply-To: <20221125102137.1801-6-christian.koenig@amd.com>
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.
Any objections to this guys?
I'm basically just following a suggestion from Daniel here and it
already triggered a discussion about the timeout for i915.
Thanks,
Christian.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/qxl/qxl_cmd.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c
> index 63aa96a69752..281edab518cd 100644
> --- a/drivers/gpu/drm/qxl/qxl_cmd.c
> +++ b/drivers/gpu/drm/qxl/qxl_cmd.c
> @@ -579,7 +579,7 @@ void qxl_surface_evict(struct qxl_device *qdev, struct qxl_bo *surf, bool do_upd
>
> static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stall)
> {
> - int ret;
> + long ret;
>
> ret = qxl_bo_reserve(surf);
> if (ret)
> @@ -588,7 +588,19 @@ static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stal
> if (stall)
> mutex_unlock(&qdev->surf_evict_mutex);
>
> - ret = ttm_bo_wait(&surf->tbo, true, !stall);
> + if (stall) {
> + ret = dma_resv_wait_timeout(surf->tbo.base.resv,
> + DMA_RESV_USAGE_BOOKKEEP, true,
> + 15 * HZ);
> + if (ret > 0)
> + ret = 0;
> + else if (ret == 0)
> + ret = -EBUSY;
> + } else {
> + ret = dma_resv_test_signaled(surf->tbo.base.resv,
> + DMA_RESV_USAGE_BOOKKEEP);
> + ret = ret ? -EBUSY : 0;
> + }
>
> if (stall)
> mutex_lock(&qdev->surf_evict_mutex);
next prev parent reply other threads:[~2022-12-15 14:20 UTC|newest]
Thread overview: 34+ 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 ` [PATCH 2/9] drm/ttm: remove ttm_bo_(un)lock_delayed_workqueue Christian König
2022-11-25 10:21 ` [PATCH 3/9] drm/ttm: use per BO cleanup workers Christian König
2022-11-29 21:14 ` Felix Kuehling
2022-12-05 13:39 ` Christian König
2023-06-13 13:05 ` Karol Herbst
2023-06-13 13:59 ` Christian König
2023-06-13 14:18 ` Karol Herbst
2023-06-15 11:19 ` Christian König
2023-06-15 12:04 ` 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 12:43 ` kernel test robot
2022-11-25 21:19 ` 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 ` [PATCH 6/9] drm/qxl: " Christian König
2022-12-15 14:19 ` Christian König [this message]
2022-12-15 20:09 ` Dave Airlie
2022-11-25 10:21 ` [PATCH 7/9] drm/i915: " Christian König
2022-11-25 11:14 ` [Intel-gfx] " 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-12-05 19:58 ` Christian König
2022-12-06 18:03 ` Matthew Auld
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 ` [PATCH 9/9] drm/ttm: move ttm_bo_wait into VMWGFX Christian König
2022-11-25 18:18 ` [PATCH 1/9] drm/amdgpu: generally allow over-commit during BO allocation Alex Deucher
2022-12-05 13:41 ` Christian König
2022-11-28 6:00 ` Arunpravin Paneer Selvam
2022-12-10 6:15 ` Felix Kuehling
2022-12-10 14:12 ` Christian König
2022-12-11 1:13 ` 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=0169e3dd-c705-175d-9045-2baf0cbabb78@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=airlied@redhat.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox