From: Thomas Zimmermann Subject: Re: [PATCH 1/4] drm/vram: Set GEM object functions for PRIME Date: Mon, 1 Jul 2019 16:45:56 +0200 Message-ID: <546746eb-b8bc-dbd9-d712-3fdef01f14d0@suse.de> References: <20190628122659.31887-1-tzimmermann@suse.de> <20190628122659.31887-2-tzimmermann@suse.de> <20190701063232.pnc7ziq7tg4yqyqp@sirius.home.kraxel.org> <216c9142-ca8e-50ae-cb0b-f63a8b57addf@suse.de> <20190701084857.k7m3ysz47oes3mwj@sirius.home.kraxel.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0284683170==" Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id E165F89623 for ; Mon, 1 Jul 2019 14:46:02 +0000 (UTC) In-Reply-To: <20190701084857.k7m3ysz47oes3mwj@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: sam@ravnborg.org, maxime.ripard@bootlin.com, puck.chen@hisilicon.com, dri-devel@lists.freedesktop.org, z.liuxinliang@hisilicon.com, kong.kongxinwei@hisilicon.com, zourongrong@gmail.com, airlied@redhat.com, sean@poorly.run List-Id: dri-devel@lists.freedesktop.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============0284683170== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HomHapCYcot4TJhIPObYyPz084rh1Bp5x" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HomHapCYcot4TJhIPObYyPz084rh1Bp5x Content-Type: multipart/mixed; boundary="59iSinSflC2eALYAW8aRTT2eaYESanQuc"; protected-headers="v1" From: Thomas Zimmermann To: Gerd Hoffmann Cc: sean@poorly.run, maxime.ripard@bootlin.com, puck.chen@hisilicon.com, dri-devel@lists.freedesktop.org, z.liuxinliang@hisilicon.com, kong.kongxinwei@hisilicon.com, zourongrong@gmail.com, airlied@redhat.com, sam@ravnborg.org Message-ID: <546746eb-b8bc-dbd9-d712-3fdef01f14d0@suse.de> Subject: Re: [PATCH 1/4] drm/vram: Set GEM object functions for PRIME References: <20190628122659.31887-1-tzimmermann@suse.de> <20190628122659.31887-2-tzimmermann@suse.de> <20190701063232.pnc7ziq7tg4yqyqp@sirius.home.kraxel.org> <216c9142-ca8e-50ae-cb0b-f63a8b57addf@suse.de> <20190701084857.k7m3ysz47oes3mwj@sirius.home.kraxel.org> In-Reply-To: <20190701084857.k7m3ysz47oes3mwj@sirius.home.kraxel.org> --59iSinSflC2eALYAW8aRTT2eaYESanQuc Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 01.07.19 um 10:48 schrieb Gerd Hoffmann: > On Mon, Jul 01, 2019 at 09:28:59AM +0200, Thomas Zimmermann wrote: >> Hi >> >> Am 01.07.19 um 08:32 schrieb Gerd Hoffmann: >>> On Fri, Jun 28, 2019 at 02:26:56PM +0200, Thomas Zimmermann wrote: >>>> PRIME functionality is now provided via the callback functions in >>>> struct drm_gem_object_funcs. The driver-structure functions are obso= lete. >>>> As a side effect of this patch, VRAM-based drivers get basic PRIME >>>> support automatically without having to set any flags or additional >>>> fields. >>> >>>> +static void drm_gem_vram_object_free(struct drm_gem_object *gem) >>>> +static int drm_gem_vram_object_funcs_pin(struct drm_gem_object *gem= ) >>>> +static void drm_gem_vram_object_funcs_unpin(struct drm_gem_object *= gem) >>>> +static void *drm_gem_vram_object_funcs_vmap(struct drm_gem_object *= gem) >>>> +static void drm_gem_vram_object_funcs_vunmap(struct drm_gem_object = *gem, >>>> + void *vaddr) >>> >>>> +static const struct drm_gem_object_funcs drm_gem_vram_object_funcs = =3D { >>>> + .free =3D drm_gem_vram_object_free, >>>> + .pin =3D drm_gem_vram_object_funcs_pin, >>>> + .unpin =3D drm_gem_vram_object_funcs_unpin, >>>> + .vmap =3D drm_gem_vram_object_funcs_vmap, >>>> + .vunmap =3D drm_gem_vram_object_funcs_vunmap >>>> +}; >>> >>> Why new functions? Can't you just hook up the existing prime functio= ns? >> >> The final patch will remove the existing functions, so drivers won't u= se >> them accidentally. >=20 > But the new and the old ones are identical, right? So why add/remove? > Why not just rename them? Hmm, OK. Does that somehow make a difference (e.g., easier backporting or maintenance)? > I'd also suggest to name them consistently (free has no _funcs, all > others have). I'd drop _funcs from all function names. This inconsistency is actually an error in the patch. Thanks Best regards Thomas > cheers, > Gerd >=20 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >=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) --59iSinSflC2eALYAW8aRTT2eaYESanQuc-- --HomHapCYcot4TJhIPObYyPz084rh1Bp5x Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl0aHKgACgkQaA3BHVML eiOtsgf/SSSjpPeDPrGTttv2vzvdz9amfnPli/EfvTi+5fZ9WEFFH90FFMzL8CPX EVeVzFAMUMs+fny/jz7Nf6JPRQAgzFo/OFK+sE8VC7zAwXJwIYTG0fhDnU4G3j08 Qd672+LFRjlqIXem8eYx9lddSexpXkdX3JpoeUvGUMynzN2wOG9LfH6KpRMBlK/N LmHlyH4aKdRdLmRMZtS2OqizhL6mTS0w0keTnOUURHGqCZD/ZPEqv/CcDsp6IDLG mrbOMPl5FXm8xPZTTXwCZS0SyoGl+uW9RTTpLa4hQgp+lJYVIozZeLlUSbR08py6 UyqL29JFepWFiJrO6wCRCzINmdSAmQ== =4Q5g -----END PGP SIGNATURE----- --HomHapCYcot4TJhIPObYyPz084rh1Bp5x-- --===============0284683170== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0284683170==--