From: Thomas Zimmermann <tzimmermann@suse.de>
To: Tian Tao <tiantao6@hisilicon.com>,
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
Subject: Re: [PATCH drm/hisilicon 1/2] drm/hisilicon: Use managed mode-config init
Date: Mon, 7 Dec 2020 09:03:45 +0100 [thread overview]
Message-ID: <ba38ae20-a041-6918-331a-09cf796b92a3@suse.de> (raw)
In-Reply-To: <1607302172-60123-2-git-send-email-tiantao6@hisilicon.com>
[-- Attachment #1.1: Type: text/plain, Size: 1952 bytes --]
Hi
Am 07.12.20 um 01:49 schrieb Tian Tao:
> Using drmm_mode_config_init() sets up managed release of modesetting
> resources.
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 3687753..d631f82 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -96,7 +96,9 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
> struct drm_device *dev = &priv->dev;
> int ret;
>
> - drm_mode_config_init(dev);
> + ret = drmm_mode_config_init(dev);
> + if (ret)
> + return ret;
> priv->mode_config_initialized = true;
I think mode_config_initialized is only required by hibmc_kms_finit(),
which you remove. You should remove this line and the field from struct
hibmc_drm_private.
Best regards
Thomas
>
> dev->mode_config.min_width = 0;
> @@ -125,14 +127,6 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
> return 0;
> }
>
> -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 = false;
> - }
> -}
> -
> /*
> * It can operate in one of three modes: 0, 1 or Sleep.
> */
> @@ -262,7 +256,6 @@ static int hibmc_unload(struct drm_device *dev)
> drm_atomic_helper_shutdown(dev);
>
> pci_disable_msi(dev->pdev);
> - hibmc_kms_fini(priv);
> dev->dev_private = NULL;
> return 0;
> }
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2020-12-07 8:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 0:49 [PATCH drm/hisilicon 0/2] Code refactoring Tian Tao
2020-12-07 0:49 ` [PATCH drm/hisilicon 1/2] drm/hisilicon: Use managed mode-config init Tian Tao
2020-12-07 8:03 ` Thomas Zimmermann [this message]
2020-12-07 0:49 ` [PATCH drm/hisilicon 2/2] drm/hisilicon: Delete unused local parameters Tian Tao
2020-12-07 8:04 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba38ae20-a041-6918-331a-09cf796b92a3@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tiantao6@hisilicon.com \
--cc=xinliang.liu@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®