From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59B6AC433E4 for ; Thu, 13 Aug 2020 13:57:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D7FA20791 for ; Thu, 13 Aug 2020 13:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726224AbgHMN5k (ORCPT ); Thu, 13 Aug 2020 09:57:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:43800 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgHMN5k (ORCPT ); Thu, 13 Aug 2020 09:57:40 -0400 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 3F49EB18A; Thu, 13 Aug 2020 13:57:59 +0000 (UTC) Subject: Re: [PATCH 19/20] drm/xlnx: Initialize DRM driver instance with CMA helper macro To: Laurent Pinchart Cc: hamohammed.sa@gmail.com, airlied@linux.ie, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, michal.simek@xilinx.com, thierry.reding@gmail.com, krzk@kernel.org, sam@ravnborg.org, emil.velikov@collabora.com, abdiel.janulgue@linux.intel.com, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, oleksandr_andrushchenko@epam.com, tomi.valkeinen@ti.com, linux-tegra@vger.kernel.org, linux@armlinux.org.uk, jonathanh@nvidia.com, linux-rockchip@lists.infradead.org, kgene@kernel.org, bskeggs@redhat.com, xen-devel@lists.xenproject.org, intel-gfx@lists.freedesktop.org, matthew.auld@intel.com, chunkuang.hu@kernel.org, andi.shyti@intel.com, linux-arm-msm@vger.kernel.org, marek.olsak@amd.com, tianci.yin@amd.com, etnaviv@lists.freedesktop.org, hdegoede@redhat.com, linux-mediatek@lists.infradead.org, rodrigo.vivi@intel.com, matthias.bgg@gmail.com, evan.quan@amd.com, sean@poorly.run, linux-arm-kernel@lists.infradead.org, tvrtko.ursulin@linux.intel.com, amd-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk, hyun.kwon@xilinx.com, rodrigosiqueiramelo@gmail.com, aaron.liu@amd.com, Felix.Kuehling@amd.com, xinhui.pan@amd.com, sw0312.kim@samsung.com, hjc@rock-chips.com, miaoqinglang@huawei.com, kyungmin.park@samsung.com, nirmoy.das@amd.com, alexander.deucher@amd.com, Hawking.Zhang@amd.com, freedreno@lists.freedesktop.org, christian.koenig@amd.com References: <20200813083644.31711-1-tzimmermann@suse.de> <20200813083644.31711-20-tzimmermann@suse.de> <20200813133605.GJ6057@pendragon.ideasonboard.com> From: Thomas Zimmermann Message-ID: Date: Thu, 13 Aug 2020 15:57:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200813133605.GJ6057@pendragon.ideasonboard.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tbCt2o5uFn9Z4Xo4P1cpCcyhXosV08OH6" Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tbCt2o5uFn9Z4Xo4P1cpCcyhXosV08OH6 Content-Type: multipart/mixed; boundary="Orz2ZqpSWnksEfl2yo6RF3aBwExLujGG6"; protected-headers="v1" From: Thomas Zimmermann To: Laurent Pinchart Cc: hamohammed.sa@gmail.com, airlied@linux.ie, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, michal.simek@xilinx.com, thierry.reding@gmail.com, krzk@kernel.org, sam@ravnborg.org, emil.velikov@collabora.com, abdiel.janulgue@linux.intel.com, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, oleksandr_andrushchenko@epam.com, tomi.valkeinen@ti.com, linux-tegra@vger.kernel.org, linux@armlinux.org.uk, jonathanh@nvidia.com, linux-rockchip@lists.infradead.org, kgene@kernel.org, bskeggs@redhat.com, xen-devel@lists.xenproject.org, intel-gfx@lists.freedesktop.org, matthew.auld@intel.com, chunkuang.hu@kernel.org, andi.shyti@intel.com, linux-arm-msm@vger.kernel.org, marek.olsak@amd.com, tianci.yin@amd.com, etnaviv@lists.freedesktop.org, hdegoede@redhat.com, linux-mediatek@lists.infradead.org, rodrigo.vivi@intel.com, matthias.bgg@gmail.com, evan.quan@amd.com, sean@poorly.run, linux-arm-kernel@lists.infradead.org, tvrtko.ursulin@linux.intel.com, amd-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk, hyun.kwon@xilinx.com, rodrigosiqueiramelo@gmail.com, aaron.liu@amd.com, Felix.Kuehling@amd.com, xinhui.pan@amd.com, sw0312.kim@samsung.com, hjc@rock-chips.com, miaoqinglang@huawei.com, kyungmin.park@samsung.com, nirmoy.das@amd.com, alexander.deucher@amd.com, Hawking.Zhang@amd.com, freedreno@lists.freedesktop.org, christian.koenig@amd.com Message-ID: Subject: Re: [PATCH 19/20] drm/xlnx: Initialize DRM driver instance with CMA helper macro References: <20200813083644.31711-1-tzimmermann@suse.de> <20200813083644.31711-20-tzimmermann@suse.de> <20200813133605.GJ6057@pendragon.ideasonboard.com> In-Reply-To: <20200813133605.GJ6057@pendragon.ideasonboard.com> --Orz2ZqpSWnksEfl2yo6RF3aBwExLujGG6 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 13.08.20 um 15:36 schrieb Laurent Pinchart: > Hi Thomas, >=20 > Thank you for the patch. >=20 > On Thu, Aug 13, 2020 at 10:36:43AM +0200, Thomas Zimmermann wrote: >> The xlnx driver uses CMA helpers with default callback functions. >> Initialize the driver structure with the rsp CMA helper macro. The >> driver is being converted to use GEM object functions as part of >> this change. >> >> Two callbacks, .dumb_destroy and .gem_prime_import, were initialized >> to their default implementations, so they are just kept empty now. >> >> Signed-off-by: Thomas Zimmermann >> --- >> drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 14 +------------- >> 1 file changed, 1 insertion(+), 13 deletions(-) >> >> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xln= x/zynqmp_dpsub.c >> index 26328c76305b..058044dcc062 100644 >> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c >> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c >> @@ -80,19 +80,7 @@ static struct drm_driver zynqmp_dpsub_drm_driver =3D= { >> .driver_features =3D DRIVER_MODESET | DRIVER_GEM | >> DRIVER_ATOMIC, >> =20 >> - .prime_handle_to_fd =3D drm_gem_prime_handle_to_fd, >> - .prime_fd_to_handle =3D drm_gem_prime_fd_to_handle, >> - .gem_prime_export =3D drm_gem_prime_export, >> - .gem_prime_import =3D drm_gem_prime_import, >> - .gem_prime_get_sg_table =3D drm_gem_cma_prime_get_sg_table, >> - .gem_prime_import_sg_table =3D drm_gem_cma_prime_import_sg_table, >> - .gem_prime_vmap =3D drm_gem_cma_prime_vmap, >> - .gem_prime_vunmap =3D drm_gem_cma_prime_vunmap, >> - .gem_prime_mmap =3D drm_gem_cma_prime_mmap, >> - .gem_free_object_unlocked =3D drm_gem_cma_free_object, >> - .gem_vm_ops =3D &drm_gem_cma_vm_ops, >> - .dumb_create =3D zynqmp_dpsub_dumb_create, >> - .dumb_destroy =3D drm_gem_dumb_destroy, >> + DRM_GEM_CMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(zynqmp_dpsub_dumb_creat= e), >=20 > The only effective change here is >=20 > - .gem_prime_import_sg_table =3D drm_gem_cma_prime_import_sg_table, > - .gem_prime_mmap =3D drm_gem_cma_prime_mmap, > + .gem_prime_import_sg_table =3D drm_gem_cma_prime_import_sg_table_vmap= , > + .gem_prime_mmap =3D drm_gem_prime_mmap, >=20 > The change is significant, and I have a hard time following the code to= > verify that it's correct, or if it's an undesired side effect. If it's > correct, could the change be mentioned in the commit message, with at > least a brief explanation of why this is correct, and what the > consequences here ? I think this is a mistake that I didn't notice. Thanks for spotting it. Initializing the driver structure DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE should fix it. I'll change this for the patch's next revision. Best regards Thomas >=20 >> =20 >> .fops =3D &zynqmp_dpsub_drm_fops, >> =20 >=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 --Orz2ZqpSWnksEfl2yo6RF3aBwExLujGG6-- --tbCt2o5uFn9Z4Xo4P1cpCcyhXosV08OH6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl81RswUHHR6aW1tZXJt YW5uQHN1c2UuZGUACgkQaA3BHVMLeiPfqAgAoOYcX5UFEbejKi/wGBq3HxlV2lCp 5M6+u8OsIfDWcmroBE+YK419eRwDbsNeDSbzHs7GVQ7SOEeltGdgRpf7QuaUgupn VJmuMSjAwqbV0l5nyd5DD0Tr2Z/QOxaLAguvxUcSTOdYWAuqLwTo6X5+butu86YB tEBhKOk6Vzm8C5KA3Loy27We59QzBmDHJ+cdzEhsM1AG0SPJ5sePjMiKFMM3Mo4u 8+HQ3wVLzYAQVhK7Q8bUM/6yIv+AQaAfoNtG3zPI7q9FKKKMbBbTVQV0YeZUKC4T kIHdnG+dlK834qYxJmlxWwcU8XjHoiAbQYJDfpmjeYw++Xz1MePDB6MG2g== =PGhi -----END PGP SIGNATURE----- --tbCt2o5uFn9Z4Xo4P1cpCcyhXosV08OH6--