Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2255752pxu; Mon, 7 Dec 2020 01:25:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIKS8JLmuh7uOzcMWtR32XUtuTcuc2b3if+QpJN5HJa9bYnQ2u72Qd9q0vmHIhQ7MPVYyI X-Received: by 2002:a17:906:dd3:: with SMTP id p19mr17675820eji.221.1607333120094; Mon, 07 Dec 2020 01:25:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607333120; cv=none; d=google.com; s=arc-20160816; b=bkCLZR502t7jEFmvwiDlgkSCQi8NWFg/ibgvuiDUXjH5xQEAj2ns4dvEXYDvrkAg+e kyeVI+nmZaGpLSyPU+ykuKymvpKgK3p6JPM+0XbJCC4Jhi6J/6qK5bxihTU+jBIV4x4w NBWjuiyXF1Ji4ACLvPyKCy9KJtAmdS8ANEGTY/q48FlTUDcgyqgixx9wu9TKpLDoIw1Y b5E5qDVkcYwEJN+uEUOL+gZ8OZkfJTcpQSWjOvMC9QM9u/PJNuYdWMsvJiwTJ4SRAYb2 rC+GiMveNwYL/blAOpSjLcsLcMgBfwrBgSmuRXQ4OBQIEK8zZQ1tdVaXi12yAql+mIUy PHCg== 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=kFNXwtaQbZO6vp6ABafJ5h5vHf1LpsIg/NRJA1G4C4k=; b=AYUmGCx4QqyLBJhcpdzK/DDwcWGrU6yTL8/KsY/tsXtZI4nVogfMHgnyT/qYoPCOws K/lhOHk1MheCpoEvH086z5Gwm131gEwGbyOF2dWrTiYx6/1NoHyPhleEtgSA86YVhIHb G2vU1/P1f9xq7hH/P0cJPAFLQbb6WqYUnvzCZ5ORomIZSgt6gsod1cfUHd26qSVReCwM LqZ7UeOGV6+hS8afmrt/W2P6jZcQ3T/2i2kEHGnLqXLW+AO9T1YqsbLcMZe4tkwfsA76 2mSJqFsxYvyMMt/RreOzdH8wVgQo2inqyEK9DjIDCNmcoUkGY7jjH1L/Y/h0ebE5qH0j oVSg== 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 e23si7974763edc.252.2020.12.07.01.24.56; Mon, 07 Dec 2020 01:25:20 -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 S1726237AbgLGJX3 (ORCPT + 99 others); Mon, 7 Dec 2020 04:23:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:58812 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725550AbgLGJX2 (ORCPT ); Mon, 7 Dec 2020 04:23:28 -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 A9307AD6B; Mon, 7 Dec 2020 09:22:46 +0000 (UTC) Subject: Re: [PATCH drm/hisilicon v2 1/2] drm/hisilicon: Use managed mode-config init 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: <1607331906-19005-1-git-send-email-tiantao6@hisilicon.com> <1607331906-19005-2-git-send-email-tiantao6@hisilicon.com> From: Thomas Zimmermann Message-ID: Date: Mon, 7 Dec 2020 10:22:44 +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: <1607331906-19005-2-git-send-email-tiantao6@hisilicon.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7w5Q9hFsGTX4HT2ZGrujcHkTr1U0WxU24" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7w5Q9hFsGTX4HT2ZGrujcHkTr1U0WxU24 Content-Type: multipart/mixed; boundary="44arVvp8gUngPeOglD8Juq6qtBgxbQMZH"; 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: Subject: Re: [PATCH drm/hisilicon v2 1/2] drm/hisilicon: Use managed mode-config init References: <1607331906-19005-1-git-send-email-tiantao6@hisilicon.com> <1607331906-19005-2-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1607331906-19005-2-git-send-email-tiantao6@hisilicon.com> --44arVvp8gUngPeOglD8Juq6qtBgxbQMZH Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 07.12.20 um 10:05 schrieb Tian Tao: > Using drmm_mode_config_init() sets up managed release of modesetting > resources. >=20 Individual patches usually contain a changelog to highlight the=20 difference to previous versions. Please add one before committing the=20 patch. Your cover letter for the series already does this correctly. > Signed-off-by: Tian Tao Reviewed-by: Thomas Zimmermann Thanks for all these updates. > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 14 +++----------- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 - > 2 files changed, 3 insertions(+), 12 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 3687753..7f01213 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > @@ -96,8 +96,9 @@ static int hibmc_kms_init(struct hibmc_drm_private *p= riv) > struct drm_device *dev =3D &priv->dev; > int ret; > =20 > - drm_mode_config_init(dev); > - priv->mode_config_initialized =3D true; > + ret =3D drmm_mode_config_init(dev); > + if (ret) > + return ret; > =20 > dev->mode_config.min_width =3D 0; > dev->mode_config.min_height =3D 0; > @@ -125,14 +126,6 @@ static int hibmc_kms_init(struct hibmc_drm_private= *priv) > return 0; > } > =20 > -static void hibmc_kms_fini(struct hibmc_drm_private *priv) > -{ > - if (priv->mode_config_initialized) { > - drm_mode_config_cleanup(&priv->dev); > - priv->mode_config_initialized =3D false; > - } > -} > - > /* > * It can operate in one of three modes: 0, 1 or Sleep. > */ > @@ -262,7 +255,6 @@ static int hibmc_unload(struct drm_device *dev) > drm_atomic_helper_shutdown(dev); > =20 > pci_disable_msi(dev->pdev); > - hibmc_kms_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 a49c10e..7d263f4 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h > @@ -42,7 +42,6 @@ struct hibmc_drm_private { > struct drm_crtc crtc; > struct drm_encoder encoder; > struct hibmc_connector connector; > - bool mode_config_initialized; > }; > =20 > static inline struct hibmc_connector *to_hibmc_connector(struct drm_c= onnector *connector) >=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 --44arVvp8gUngPeOglD8Juq6qtBgxbQMZH-- --7w5Q9hFsGTX4HT2ZGrujcHkTr1U0WxU24 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/N9GUFAwAAAAAACgkQlh/E3EQov+Ao ERAAgq96FjDmWVLRtFp9mW4xu4kfjY5qDuDZ9ptonUpKwqIUB1GgKp1vfc0Ng2Ll315Uqzv+EM9h U6SUWqn6fETsnhCGr3MiciUT18wXMR7z32lDPn3RRyy5r67JEaZpQ+ZSxkfQHkDdVAM+i537Ns87 5qRpqWTN4p4N2htMritSRHWTH7sFM69kzs6AFozfitEswNayA1+FQAvhGJ3sEGVSnGZ8xq3DqqB4 PM3YO7saPrmBQFUCU44ATS31MDsN59nDAEFOQhwTaj910A4O+bQFWjM3yScXYVssy7cabzzEkLvT tFDYUFpacdusCtrwMoUgXcP+1I41y8PCpVPIcRuHF15kJeNimVACiNvrmW3drCoG177EqgHGgFFD CLo557YUrbHLOyLhXV+uwp5/UEryDCEuQjcYGlDwM1MfpMKh0cYCuAPc35SsYdav1bWu9ld00nvm tXVmHn32+0p8pJsHhOTfyd5h/PffcJFe7gLKXtznOUZIQr4BMQGRna7yXVwTIPM5JNhtQlszWaPu JE3vMCZnNc9pOPsoWjZplIuwdaXaz6o5L2BkRfXiZlugJolebwpWco/AYdG4ePU1ZR+4A2S33IJJ nDLc3tZJiB6rlTUNoDB+dMbVxJd11g0k+Dk2W0J8a0BF18xlPiTPNAIKzYDazPNfd+IOBFq8jzsb fPA= =G8lq -----END PGP SIGNATURE----- --7w5Q9hFsGTX4HT2ZGrujcHkTr1U0WxU24--