Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp251346pxu; Wed, 2 Dec 2020 22:01:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUlrJN8Ju5uNmU0/C+aPHMkmQHF8d1HtYiCUsXrdBxcNk5+U42CUmSoqKSMDzcq5LWxhoj X-Received: by 2002:a17:906:f949:: with SMTP id ld9mr1144206ejb.401.1606975273410; Wed, 02 Dec 2020 22:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606975273; cv=none; d=google.com; s=arc-20160816; b=aqKGDoWVzjhBUDnXWCysfKEKBtcQwebhT1LyLpcy3TVhAsc89G4DfHlBBiSTjIcMLx fLlANYKuMkjJy0FnSOiafm2K4do0sdqUygOqoPTQzX1P2L4vakESXcCD9LFS3//VN34C Pp/LJolYy1MeZdPFoXtRRkpR/o96UILRCy9YjZDwaAE2by6wcFwBGQ7p7LvEg7OeIJVv i2/bucObITpgOXIIlMKwSaw02NKDfoHPOgfXRL5pOdUIhAhRyRqXUX6D7jOJw/x02AaF yjuafvY3ZtoZgYEuiC5S1+IqHSOWFiTxCzR1FjrHoT6hl8Fo6VDeO8r4oTULfdh4sXmV SMMg== 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:to:subject; bh=VI+4w2oMQboIpfPfQwqvrc2epfmXVLma1fUAfY41y+4=; b=HKJmgNtrmGM8kj3J9Gfap/LYn1s7/m4kQ6vazJue5gEl91RqOC2Hi11boKNQCMB8Zm 5fxHujY1PlkOC6aPM+YS63Rrz6iBrDAaAuxz/jRf/pFNEIfR80FuBQUQZJDHRhbTAlFw eoAS8HyA3Gp+KkCIw7gklek5/CvxDWS893odrhQeZOQY/agqxjdQcgua4ORAiiYEjj0P bOAT+DPYxYW/9GWtoxRvA5UwXvnoAip21i79/bg5cI2jBa0mxG+uFPCinRY17lW7ZWey I6Pv5q3E/6oldl7GaWRjzZ7a8n51RoYFk9MUjwDdK6thzZZ5fXgcF0hzaCcYvvPAgt1L 57Kw== 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 y9si348925edq.205.2020.12.02.22.00.49; Wed, 02 Dec 2020 22:01:13 -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 S1727729AbgLCF6a (ORCPT + 99 others); Thu, 3 Dec 2020 00:58:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:34420 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbgLCF6a (ORCPT ); Thu, 3 Dec 2020 00:58:30 -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 B6804ABCE; Thu, 3 Dec 2020 05:57:48 +0000 (UTC) Subject: Re: [PATCH] drm/hisilicon: Use managed VRAM-helper initialization To: Tian Tao , airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org References: <1606964953-24309-1-git-send-email-tiantao6@hisilicon.com> From: Thomas Zimmermann Message-ID: <7baf0a61-bef8-e847-afd2-3a1d05875cdf@suse.de> Date: Thu, 3 Dec 2020 06:57:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1606964953-24309-1-git-send-email-tiantao6@hisilicon.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="u1SpjsDYRN3Hc6zNiGVIKjVTnIrTErLNb" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --u1SpjsDYRN3Hc6zNiGVIKjVTnIrTErLNb Content-Type: multipart/mixed; boundary="GOyPcIWYUn6LwumklnAr7qdZcUdyNCe3H"; protected-headers="v1" From: Thomas Zimmermann To: Tian Tao , airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org Message-ID: <7baf0a61-bef8-e847-afd2-3a1d05875cdf@suse.de> Subject: Re: [PATCH] drm/hisilicon: Use managed VRAM-helper initialization References: <1606964953-24309-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1606964953-24309-1-git-send-email-tiantao6@hisilicon.com> --GOyPcIWYUn6LwumklnAr7qdZcUdyNCe3H Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 03.12.20 um 04:09 schrieb Tian Tao: > updated to use drmm_vram_helper_init() >=20 > Signed-off-by: Tian Tao Reviewed-by: Thomas Zimmermann As a good follow-up patch, I would suggest to get rig of the entire file = hibmc_ttm.c. drmm_vram_helper_init() can be called directly from=20 hibmc_load(). hibmc_dumb_create() and hibmc_mode_funcs can go to=20 hibmc_drm_drv.c. Best regards Thomas > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 - > drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 19 +++-------------= --- > 3 files changed, 3 insertions(+), 18 deletions(-) >=20 > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/= gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > index 8020604..5aea2e9 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > @@ -249,7 +249,6 @@ static int hibmc_unload(struct drm_device *dev) > =20 > pci_disable_msi(dev->pdev); > hibmc_kms_fini(priv); > - hibmc_mm_fini(priv); > dev->dev_private =3D NULL; > return 0; > } > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h b/drivers/= gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h > index 7e0c756..2786de5 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h > @@ -64,7 +64,6 @@ int hibmc_de_init(struct hibmc_drm_private *priv); > int hibmc_vdac_init(struct hibmc_drm_private *priv); > =20 > int hibmc_mm_init(struct hibmc_drm_private *hibmc); > -void hibmc_mm_fini(struct hibmc_drm_private *hibmc); > int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, > struct drm_mode_create_dumb *args); > int hibmc_ddc_create(struct drm_device *drm_dev, struct hibmc_connect= or *connector); > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/= drm/hisilicon/hibmc/hibmc_ttm.c > index e84fb81..892d566 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c > @@ -23,15 +23,12 @@ > =20 > int hibmc_mm_init(struct hibmc_drm_private *hibmc) > { > - struct drm_vram_mm *vmm; > int ret; > struct drm_device *dev =3D &hibmc->dev; > =20 > - vmm =3D drm_vram_helper_alloc_mm(dev, > - pci_resource_start(dev->pdev, 0), > - hibmc->fb_size); > - if (IS_ERR(vmm)) { > - ret =3D PTR_ERR(vmm); > + ret =3D drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0), > + hibmc->fb_size); > + if (ret) { > drm_err(dev, "Error initializing VRAM MM; %d\n", ret); > return ret; > } > @@ -39,16 +36,6 @@ int hibmc_mm_init(struct hibmc_drm_private *hibmc) > return 0; > } > =20 > -void hibmc_mm_fini(struct hibmc_drm_private *hibmc) > -{ > - struct drm_device *dev =3D &hibmc->dev; > - > - if (!dev->vram_mm) > - return; > - > - drm_vram_helper_release_mm(dev); > -} > - > int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, > struct drm_mode_create_dumb *args) > { >=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 --GOyPcIWYUn6LwumklnAr7qdZcUdyNCe3H-- --u1SpjsDYRN3Hc6zNiGVIKjVTnIrTErLNb 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+AFAl/IflsFAwAAAAAACgkQlh/E3EQov+CP PQ//cjecoEHrzdZ8LnQJiFRKZf7AbsBkUZ/97lsnbGFBPPHPfls3fG9vW9m4maAn0o1n6esiRMgC 9eB1aA3aZKaw7unXcBCh/8NzfiLDFbihpveV30f584zlU3+cm5MBcfgjb8HTS5ThC3/xPBJ6E1/j L9ClTB2R7YA08JsPn9T+Ge7dujYSg7IJyidWZY4w2vfpl0zFV7qy5W8CyQR9orNxsNCWekGYH02f OnhHnh7u+Iw1ByVFkPxA5vgLiRisl8A/Zfk9MZ41rqz4bQ+qb0Xi5EdhQpufrY2zhnjxj4mmkA2f 2xJmhMRMm5D1OK5R++Rtyu87pvFfcb/omst9WF9SER9axDh8wrD5Ib8u6u2BmvYhwFqoBkdfuQDR IfpoN3aK9do0yGpaV/cl1UO3r7ugWOy/krMiEwT0d5FKgsv+vI7YQX+gWGHFMvLyKUKUJS4l1BEl +hEzKBTh3nmBn2XxzoOFTiJZnBbmiRZkbMCw/+bUY6WXdj0VvLuJrNunbQvyldrg3qLz0flIsj+/ iIxqTo9bAJohL7IHSMCpcoDL7mhXUNrRrqKljVugjtsWcO7YtJtzBsPqoLetUrSU2ljYrEWFGWQJ MqAFYioz7FnsH87aF3Qge5xE3RmUZ4iUoOQ5KDULhwUpTlgtjF6/6bN9XNncepVfrUjESFs7LTkL 7Tg= =BnE5 -----END PGP SIGNATURE----- --u1SpjsDYRN3Hc6zNiGVIKjVTnIrTErLNb--