mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Gerd Hoffmann <kraxel@redhat.com>, dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:DRM DRIVER FOR QXL VIRTUAL GPU" 
	<virtualization@lists.linux-foundation.org>,
	"open list:DRM DRIVER FOR QXL VIRTUAL GPU" 
	<spice-devel@lists.freedesktop.org>,
	Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH v5 6/6] drm/qxl: simplify qxl_fence_wait
Date: Wed, 3 Feb 2021 15:14:42 +0100	[thread overview]
Message-ID: <d00b212a-84dd-e75c-e362-f6b849e2103f@suse.de> (raw)
In-Reply-To: <20210203131615.1714021-7-kraxel@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2439 bytes --]



Am 03.02.21 um 14:16 schrieb Gerd Hoffmann:
> Now that we have the new release_event wait queue we can just
> use that in qxl_fence_wait() and simplify the code alot.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/qxl/qxl_release.c | 42 +++----------------------------
>   1 file changed, 4 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c
> index 43a5436853b7..b6f4b8dcf228 100644
> --- a/drivers/gpu/drm/qxl/qxl_release.c
> +++ b/drivers/gpu/drm/qxl/qxl_release.c
> @@ -59,53 +59,19 @@ static long qxl_fence_wait(struct dma_fence *fence, bool intr,
>   {
>   	struct qxl_device *qdev;
>   	struct qxl_release *release;
> -	int count = 0, sc = 0;
> -	bool have_drawable_releases;
>   	unsigned long cur, end = jiffies + timeout;
>   
>   	qdev = container_of(fence->lock, struct qxl_device, release_lock);
>   	release = container_of(fence, struct qxl_release, base);
> -	have_drawable_releases = release->type == QXL_RELEASE_DRAWABLE;
> -
> -retry:
> -	sc++;
>   
>   	if (dma_fence_is_signaled(fence))
>   		goto signaled;
>   
>   	qxl_io_notify_oom(qdev);
> -
> -	for (count = 0; count < 11; count++) {
> -		if (!qxl_queue_garbage_collect(qdev, true))
> -			break;
> -
> -		if (dma_fence_is_signaled(fence))
> -			goto signaled;
> -	}
> -
> -	if (dma_fence_is_signaled(fence))
> -		goto signaled;
> -
> -	if (have_drawable_releases || sc < 4) {
> -		if (sc > 2)
> -			/* back off */
> -			usleep_range(500, 1000);
> -
> -		if (time_after(jiffies, end))
> -			return 0;
> -
> -		if (have_drawable_releases && sc > 300) {
> -			DMA_FENCE_WARN(fence, "failed to wait on release %llu "
> -				       "after spincount %d\n",
> -				       fence->context & ~0xf0000000, sc);
> -			goto signaled;
> -		}
> -		goto retry;
> -	}
> -	/*
> -	 * yeah, original sync_obj_wait gave up after 3 spins when
> -	 * have_drawable_releases is not set.
> -	 */
> +	if (!wait_event_timeout(qdev->release_event,
> +				dma_fence_is_signaled(fence),
> +				timeout))
> +		return 0;
>   
>   signaled:
>   	cur = jiffies;
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2021-02-03 14:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210203131615.1714021-1-kraxel@redhat.com>
2021-02-03 13:16 ` [PATCH v5 1/6] drm/qxl: use drmm_mode_config_init Gerd Hoffmann
2021-02-03 13:16 ` [PATCH v5 2/6] drm/qxl: unpin release objects Gerd Hoffmann
2021-02-03 14:00   ` Thomas Zimmermann
2021-02-03 13:16 ` [PATCH v5 3/6] drm/qxl: release shadow on shutdown Gerd Hoffmann
2021-02-03 14:05   ` Thomas Zimmermann
2021-02-03 13:16 ` [PATCH v5 4/6] drm/qxl: handle shadow in primary destroy Gerd Hoffmann
2021-02-03 14:07   ` Thomas Zimmermann
2021-02-03 13:16 ` [PATCH v5 5/6] drm/qxl: properly free qxl releases Gerd Hoffmann
2021-02-03 14:12   ` Thomas Zimmermann
2021-02-03 13:16 ` [PATCH v5 6/6] drm/qxl: simplify qxl_fence_wait Gerd Hoffmann
2021-02-03 14:14   ` Thomas Zimmermann [this message]
2021-02-03 15:16   ` kernel test robot

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=d00b212a-84dd-e75c-e362-f6b849e2103f@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spice-devel@lists.freedesktop.org \
    --cc=virtualization@lists.linux-foundation.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

all inboxes | Powered by JetHome®