From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Zimmermann Subject: Re: [PATCH v3 3/3] drm/vram: Implement lazy unmapping for GEM VRAM buffers Date: Fri, 6 Sep 2019 12:37:47 +0200 Message-ID: References: <20190906085214.11677-1-tzimmermann@suse.de> <20190906085214.11677-4-tzimmermann@suse.de> <20190906093905.umz4wkwn4lukg2jg@sirius.home.kraxel.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2038427415==" Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA5316E23D for ; Fri, 6 Sep 2019 10:37:56 +0000 (UTC) In-Reply-To: <20190906093905.umz4wkwn4lukg2jg@sirius.home.kraxel.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Gerd Hoffmann Cc: feng.tang@intel.com, dave@stgolabs.net, rong.a.chen@intel.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, maxime.ripard@bootlin.com, ying.huang@intel.com, sean@poorly.run List-Id: dri-devel@lists.freedesktop.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============2038427415== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KbGkBz2cXDsSyBMU4xnQzHqlGmT45kCVN" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KbGkBz2cXDsSyBMU4xnQzHqlGmT45kCVN Content-Type: multipart/mixed; boundary="IGrERSsklhk7podfx9WPZXD7OhFRAwY0w"; protected-headers="v1" From: Thomas Zimmermann To: Gerd Hoffmann Cc: daniel@ffwll.ch, noralf@tronnes.org, airlied@linux.ie, rong.a.chen@intel.com, feng.tang@intel.com, ying.huang@intel.com, sean@poorly.run, maxime.ripard@bootlin.com, maarten.lankhorst@linux.intel.com, dave@stgolabs.net, dri-devel@lists.freedesktop.org Message-ID: Subject: Re: [PATCH v3 3/3] drm/vram: Implement lazy unmapping for GEM VRAM buffers References: <20190906085214.11677-1-tzimmermann@suse.de> <20190906085214.11677-4-tzimmermann@suse.de> <20190906093905.umz4wkwn4lukg2jg@sirius.home.kraxel.org> In-Reply-To: <20190906093905.umz4wkwn4lukg2jg@sirius.home.kraxel.org> --IGrERSsklhk7podfx9WPZXD7OhFRAwY0w Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 06.09.19 um 11:39 schrieb Gerd Hoffmann: >> +void drm_gem_vram_bo_driver_move_notify(struct ttm_buffer_object *bo,= >> + bool evict, >> + struct ttm_mem_reg *new_mem) >> +{ > [ ... ] >> + if (!kmap->virtual) >> + return; >> + ttm_bo_kunmap(kmap); >> + kmap->virtual =3D NULL; >> +} >=20 > I think ttm_buffer_object_destroy() needs "if (kmap->virtual) > ttm_bo_kunmap()" too, due to the lazy unmap you can land there > with an active mapping. Hmm, from my understanding, that final call to move_notify() is done by ttm_bo_cleanup_memtype_use(), which is called from within ttm_bo_put(). If we want to add a final kunmap, There's also the release_notify() callback, which is probably the right place to put it. Best regards Thomas >=20 > cheers, > Gerd >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imend=C3=B6rffer, Mary Higgins, Sri Rasiah HRB 21284 (AG N=C3=BCrnberg) --IGrERSsklhk7podfx9WPZXD7OhFRAwY0w-- --KbGkBz2cXDsSyBMU4xnQzHqlGmT45kCVN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl1yNvsACgkQaA3BHVML eiOTtggAwIvAfzrcu4oOVwANg8JYjwybLVaPOUeieD/CkpmENz7P5JHgOUk6FrQS 8SVgiV064aXp3wLjwC6GSUkfqtU8aYvYMzYXSl+aHGtjBLlVe1d+3uLXd+Z9fcRJ iXzfUIU1rz9cRI6DcuDWlBJty7YbYHpkqpSPoI6DK/JeU5g7pG53gk64+Yswvpfh SzhhNfQt+mHUK/fTti8/0elhcy6RrgDeGxaFg2bpYBaAJcU2ASsLyuU1SxPIc07d WsYMCD6NXnnBzu+vRBcS0OidPwrU/84riSGu2KyqCO26+YqVeegCdRpIloQTwv4M YBWfVwDcIWBDQ4kS5HcfzqD4TKXU5w== =ep8q -----END PGP SIGNATURE----- --KbGkBz2cXDsSyBMU4xnQzHqlGmT45kCVN-- --===============2038427415== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============2038427415==--