Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp313168pxb; Wed, 3 Feb 2021 06:18:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmasF/Ug/HAfuDeZ6v3XecGCitR2ielV+eg/9ez2MBbZCPNujtQcF2eKWJ4XRNV4p9A9pe X-Received: by 2002:a17:907:9615:: with SMTP id gb21mr3296778ejc.362.1612361928760; Wed, 03 Feb 2021 06:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612361928; cv=none; d=google.com; s=arc-20160816; b=wHm0fXZdT1YW4J5ojQdSv3+WocBPt619CrHf0OttDZrHtQGN5FY9xmKNDKEUX/JMYy QZiEFPD0cG9eAmdWn1g6fBTX4S29zaK95VDOpzgdJaUadoQjEqLK0sqGkP6/6RtMSxha /ESuWQAy+prX5C1+XzZMVcHVUeoD6wuiIggMU9bTKwZsW0tNbAqr89cTksJIeG9LTZaJ xGOQ37JX0bEjf5zum9XEC7e7VMbXHIeyQZELr0reFPvwzDpnXzIGM4nIEjNUh5mmMLSP WPZIAFy0h74PJZbB7b8H7PMZC+NGWSEqXIMOoLsQT97Wt673Py7cfDx4dTw+npljNMMv z3JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=rPmcJ4Zxx/HCyP0t5GQ5uRCC4bNyrzDRaDxEChdI8hk=; b=cpN4Uz+oKVDN66YCN5+MfWsqYex+5uaCEjL5/rf6FTBaBL9aBQXq0/UUVXh1s2mgqU K5DKgJFcOLrAL5RDtHoDAqyC7PA9fwaFXrRFxJTa3SC7rsZXu1ITTYj9Im0AaXSByXJH qtniigMSLm1n7ROqeKKHuHoAa2r4VW9T7QlwD1dcU1vh97DdtSBeDDjfY+f+3Sj7nLTn pzHzovdtzZQ0K90CPww5ysJm1uznzQzvTue4de7GNopY/UL6oZNy7ydlWqXSp215rEZt JmmulVCCrJpKkkX3D0IYTl1c3EG9fGoQYA++mWCjCpktUdhn2a1dMUOzOHjMIMzXFsyA tT7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si1296553ejc.6.2021.02.03.06.18.20; Wed, 03 Feb 2021 06:18:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232490AbhBCOP2 (ORCPT + 99 others); Wed, 3 Feb 2021 09:15:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:57624 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbhBCOP1 (ORCPT ); Wed, 3 Feb 2021 09:15:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id F4048AC6E; Wed, 3 Feb 2021 14:14:43 +0000 (UTC) Subject: Re: [PATCH v5 6/6] drm/qxl: simplify qxl_fence_wait To: Gerd Hoffmann , dri-devel@lists.freedesktop.org Cc: David Airlie , open list , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , Dave Airlie References: <20210203131615.1714021-1-kraxel@redhat.com> <20210203131615.1714021-7-kraxel@redhat.com> From: Thomas Zimmermann Message-ID: Date: Wed, 3 Feb 2021 15:14:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210203131615.1714021-7-kraxel@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ir8R2lL3gimtGkGvKPcHDJLUdNht2HQZT" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ir8R2lL3gimtGkGvKPcHDJLUdNht2HQZT Content-Type: multipart/mixed; boundary="EUbSlfI9tcSCmBLKUHZFndYW0BhYL0cqh"; protected-headers="v1" From: Thomas Zimmermann To: Gerd Hoffmann , dri-devel@lists.freedesktop.org Cc: David Airlie , open list , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , Dave Airlie Message-ID: Subject: Re: [PATCH v5 6/6] drm/qxl: simplify qxl_fence_wait References: <20210203131615.1714021-1-kraxel@redhat.com> <20210203131615.1714021-7-kraxel@redhat.com> In-Reply-To: <20210203131615.1714021-7-kraxel@redhat.com> --EUbSlfI9tcSCmBLKUHZFndYW0BhYL0cqh Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann > --- > drivers/gpu/drm/qxl/qxl_release.c | 42 +++---------------------------= - > 1 file changed, 4 insertions(+), 38 deletions(-) >=20 > diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qx= l_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 =3D 0, sc =3D 0; > - bool have_drawable_releases; > unsigned long cur, end =3D jiffies + timeout; > =20 > qdev =3D container_of(fence->lock, struct qxl_device, release_lock);= > release =3D container_of(fence, struct qxl_release, base); > - have_drawable_releases =3D release->type =3D=3D QXL_RELEASE_DRAWABLE;= > - > -retry: > - sc++; > =20 > if (dma_fence_is_signaled(fence)) > goto signaled; > =20 > qxl_io_notify_oom(qdev); > - > - for (count =3D 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; > =20 > signaled: > cur =3D jiffies; >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --EUbSlfI9tcSCmBLKUHZFndYW0BhYL0cqh-- --ir8R2lL3gimtGkGvKPcHDJLUdNht2HQZT Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmAar9IFAwAAAAAACgkQlh/E3EQov+Db uA//VwivvYtJ6B2M8UqfwjmwGM7ZAtOmvqs05q/LF/IwsjmdTBNTP+8bdoI/9hIx24a+n7XySfaw pIHBIbboH9Zvbh4CYROcFCGCEsQJ/gSVDMsP/KQT77QTDJxOJFSs+CX+VYCFvTKV7bo3yiqEveYR MBcssEAGAcEglzs1jRq3rx0K94Ffhdf46+LCqWtdUZBh+ALEuR1OEk0IOVFcPToyEmSFXe3FV5Tm JWIWRBFmoLU4wmE5F7pEXMnKRjMpwFifCYr3fM6GMmT1KZK0louM47yzj7NXnT7/l3kGSciC7NJb SZZlyscslpLyYWDyUU5vW+hyWFrR3d0eIJP9Fu/0++S+OKFWLMOav79s9fGpJSVw6dFWyjPwD+x0 u27WufXrRThoSY6GWcAJLGVqTj1oUbCM1v5TgSfOeAEDJD/voQsnuFmjEkvNyoKES8Jig5CFKpNZ oiyg8aIWoRdFabwpbe3Gq66DhpDGbo3uRSKhV/2bTOb8KqqaZ9rsaD1E+fA9xMicqH9PzeUsLPCc fCMkGnhAcjmGth8FBHHjce2JbX5k+WZ5yVwIAu+D1V97Zf/62uxeIoo47X3IR5ph2qwCj3CSplh1 IFwUKmyLCQfMF72sUMbd5JmurlQRrqFNPUqlIi6fkhXZqEvLy3wF1QihdJ/onIc7CumpFJ738wUa 4Jo= =fZEE -----END PGP SIGNATURE----- --ir8R2lL3gimtGkGvKPcHDJLUdNht2HQZT--