Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp535632pxu; Thu, 26 Nov 2020 05:15:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxy8oYqJDZCPowm3aRfwB41BN73ozCew5scT67DMN3eJ35QBLhAGjnhrh0W0gz+Bg7DZYV6 X-Received: by 2002:a50:ef13:: with SMTP id m19mr2495561eds.34.1606396530213; Thu, 26 Nov 2020 05:15:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606396530; cv=none; d=google.com; s=arc-20160816; b=M1jrS9es2tqI9aCkVafsO73+pVZU2pn0ItI3HDMw2gSF2SG7+HEQV1IXyNiZoKjmqH A9dopSyVsQmZDP/W5FmvQJmwVMZ3BoR3m8avOmvJaQ/yGRc9aGGQFYVuXRBr3VAgl5mE +WXbGxLPWASyU6SUglNoisPwLM3DiOk8aIhGfluNk9b66joHFKHfxh8wvjCEzU6FlTJJ SWuYsBVUXBOX4HBTheBEilO1IX2oUoJNTMdCGLvytEf+BnxKju6Tywry0zCRTTEwjgVz 4LfGPkkFk+AUpfbzZw469LI17z3fDQiBnajG215qOTy0EakTWAtklnEMVy+kE3Fnaxpk Pwgg== 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:references:cc:to:from:subject; bh=fYyH1hmNn6JlowOR63YMwkNPreniCmwy1HH2D9sNZyI=; b=BxM1V5cR2oZiN16foIIFfX4zbNrk735kZPrf2tJguG1fiblVLyUT8AQ7CK1TihRQOI jopSScElZvszT17rEnlVwYAIhGiZ3WJyT+e7K/5O5zleY/cKpJVRpHefxOifIoUFh2DM NxJ8IJ9vfmfgb05x/RW84ZDFzA2GaJkT60y7bqrKqgtQJEEhwasucQehdRJNdx7fGoOM 3pxC8I3v7WCiOMYR8gZPpmAYsE2hHNId5tRB42E0XeSkx5dfTNmppGtlTuvubUJEzH3r SV0IxyVKnsooFC9ebNS94b2M/1Z6mQ4OeVk8pFQ9JJxb93W/WFq9Sn3AsumbXOwHy4Ss plfg== 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 6si3402484edv.501.2020.11.26.05.15.06; Thu, 26 Nov 2020 05:15:30 -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 S2390067AbgKZNN2 (ORCPT + 99 others); Thu, 26 Nov 2020 08:13:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:34602 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389838AbgKZNN1 (ORCPT ); Thu, 26 Nov 2020 08:13:27 -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 79095AD20; Thu, 26 Nov 2020 13:13:24 +0000 (UTC) Subject: Re: [PATCH drm/hisilicon 1/3] drm/hisilicon: Code refactoring for hibmc_drm_drv 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, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: linux-kernel@vger.kernel.org References: <1606392140-57954-1-git-send-email-tiantao6@hisilicon.com> <1606392140-57954-2-git-send-email-tiantao6@hisilicon.com> Message-ID: Date: Thu, 26 Nov 2020 14:13:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o89dRhzFW5LQAZ7JU8VwSfrTnHWFK6jqb" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --o89dRhzFW5LQAZ7JU8VwSfrTnHWFK6jqb Content-Type: multipart/mixed; boundary="79Y3KwGtyWRdBEAb3HZOaxwTOt7gouJUl"; 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, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: linux-kernel@vger.kernel.org Message-ID: Subject: Re: [PATCH drm/hisilicon 1/3] drm/hisilicon: Code refactoring for hibmc_drm_drv References: <1606392140-57954-1-git-send-email-tiantao6@hisilicon.com> <1606392140-57954-2-git-send-email-tiantao6@hisilicon.com> In-Reply-To: --79Y3KwGtyWRdBEAb3HZOaxwTOt7gouJUl Content-Type: multipart/mixed; boundary="------------BE196A595BDE17B60AB4F718" Content-Language: en-US This is a multi-part message in MIME format. --------------BE196A595BDE17B60AB4F718 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Am 26.11.20 um 14:05 schrieb Thomas Zimmermann: > Hi >=20 > Am 26.11.20 um 13:02 schrieb Tian Tao: >> Use the devm_drm_dev_alloc provided by the drm framework to alloc >> a struct hibmc_drm_private. >> >> Signed-off-by: Tian Tao >> --- >> =C2=A0 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c=C2=A0=C2=A0 |=C2= =A0 2 +- >> =C2=A0 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c=C2=A0 | 51=20 >> +++++++++++------------- >> =C2=A0 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h=C2=A0 |=C2=A0 2= +- >> =C2=A0 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c |=C2=A0 2 +- >> =C2=A0 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 |=C2=A0 8 ++-- >> =C2=A0 5 files changed, 31 insertions(+), 34 deletions(-) >> >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c=20 >> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c >> index ea962ac..096eea9 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c >> @@ -499,7 +499,7 @@ static const struct drm_crtc_helper_funcs=20 >> hibmc_crtc_helper_funcs =3D { >> =C2=A0 int hibmc_de_init(struct hibmc_drm_private *priv) >> =C2=A0 { >> -=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D priv->dev; >> +=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D &priv->dev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_crtc *crtc =3D &priv->crtc; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_plane *plane =3D &priv->prim= ary_plane; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int ret; >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c=20 >> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> index d845657..ea3d81b 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> @@ -80,30 +80,31 @@ static const struct dev_pm_ops hibmc_pm_ops =3D { >> =C2=A0 static int hibmc_kms_init(struct hibmc_drm_private *priv) >> =C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int ret; >> +=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D &priv->dev; >=20 > I think that's good style. Pointers deserve their own local variable if= =20 > they are used multiple times within a function. I would move this chang= e=20 > into a separate patch, because it's only semi-related to the actual=20 > changes. >=20 >> -=C2=A0=C2=A0=C2=A0 drm_mode_config_init(priv->dev); >> +=C2=A0=C2=A0=C2=A0 drm_mode_config_init(dev); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 priv->mode_config_initialized =3D true;= >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.min_width =3D 0; >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.min_height =3D 0; >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.max_width =3D 1920; >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.max_height =3D 1200; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.min_width =3D 0; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.min_height =3D 0; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.max_width =3D 1920; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.max_height =3D 1200; >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.fb_base =3D priv->fb_base; >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.preferred_depth =3D 32; >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.prefer_shadow =3D 1; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.fb_base =3D priv->fb_base; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.preferred_depth =3D 32; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.prefer_shadow =3D 1; >> -=C2=A0=C2=A0=C2=A0 priv->dev->mode_config.funcs =3D (void *)&hibmc_mo= de_funcs; >> +=C2=A0=C2=A0=C2=A0 dev->mode_config.funcs =3D (void *)&hibmc_mode_fun= cs; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D hibmc_de_init(priv); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret) { >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_err(priv->dev, "failed= to init de: %d\n", ret); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_err(dev, "failed to in= it de: %d\n", ret); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D hibmc_vdac_init(priv); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret) { >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_err(priv->dev, "failed= to init vdac: %d\n", ret); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_err(dev, "failed to in= it vdac: %d\n", ret); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> @@ -113,7 +114,7 @@ static int hibmc_kms_init(struct hibmc_drm_private= =20 >> *priv) >> =C2=A0 static void hibmc_kms_fini(struct hibmc_drm_private *priv) >> =C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (priv->mode_config_initialized) { >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_mode_config_cleanup(pr= iv->dev); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_mode_config_cleanup(&p= riv->dev); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 priv->mode_conf= ig_initialized =3D false; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> =C2=A0 } >> @@ -202,7 +203,7 @@ static void hibmc_hw_config(struct=20 >> hibmc_drm_private *priv) >> =C2=A0 static int hibmc_hw_map(struct hibmc_drm_private *priv) >> =C2=A0 { >> -=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D priv->dev; >> +=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D &priv->dev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct pci_dev *pdev =3D dev->pdev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 resource_size_t addr, size, ioaddr, ios= ize; >> @@ -258,17 +259,9 @@ static int hibmc_unload(struct drm_device *dev) >> =C2=A0 static int hibmc_load(struct drm_device *dev) >> =C2=A0 { >> -=C2=A0=C2=A0=C2=A0 struct hibmc_drm_private *priv; >> +=C2=A0=C2=A0=C2=A0 struct hibmc_drm_private *priv =3D dev->dev_privat= e; >=20 > Please use to_hibmc_drm_private() instead. dev_private is deprecated. >=20 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int ret; >> -=C2=A0=C2=A0=C2=A0 priv =3D drmm_kzalloc(dev, sizeof(*priv), GFP_KERN= EL); >> -=C2=A0=C2=A0=C2=A0 if (!priv) { >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_err(dev, "no memory to= allocate for hibmc_drm_private\n"); >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -ENOMEM; >> -=C2=A0=C2=A0=C2=A0 } >> -=C2=A0=C2=A0=C2=A0 dev->dev_private =3D priv; >> -=C2=A0=C2=A0=C2=A0 priv->dev =3D dev; >> - >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D hibmc_hw_init(priv); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto err; >> @@ -310,6 +303,7 @@ static int hibmc_load(struct drm_device *dev) >> =C2=A0 static int hibmc_pci_probe(struct pci_dev *pdev, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 const struct pci_device_id *ent) >> =C2=A0 { >> +=C2=A0=C2=A0=C2=A0 struct hibmc_drm_private *priv; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_device *dev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int ret; >> @@ -318,19 +312,22 @@ static int hibmc_pci_probe(struct pci_dev *pdev,= >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >> -=C2=A0=C2=A0=C2=A0 dev =3D drm_dev_alloc(&hibmc_driver, &pdev->dev); >> -=C2=A0=C2=A0=C2=A0 if (IS_ERR(dev)) { >> +=C2=A0=C2=A0=C2=A0 priv =3D devm_drm_dev_alloc(&pdev->dev, &hibmc_dri= ver, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct hibmc_drm_private, dev); >> +=C2=A0=C2=A0=C2=A0 if (IS_ERR(priv)) { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DRM_ERROR("fail= ed to allocate drm_device\n"); >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return PTR_ERR(dev); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return PTR_ERR(priv); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> +=C2=A0=C2=A0=C2=A0 dev =3D &priv->dev; >> +=C2=A0=C2=A0=C2=A0 dev->dev_private =3D priv; >=20 > Don't do this assignment. After this patch, no code in hibmc should=20 > touch dev_private. Instead, change to_hibmc_drm_private() to upcast fro= m=20 > dev. As in [1]. [1] was supposed to be =20 https://elixir.bootlin.com/linux/v5.9.11/source/drivers/gpu/drm/mgag200/m= gag200_drv.h#L177 Best regards Thomas >=20 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dev->pdev =3D pdev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pci_set_drvdata(pdev, dev); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D pci_enable_device(pdev); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret) { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 drm_err(dev, "f= ailed to enable pci device: %d\n", ret); >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto err_free; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D hibmc_load(dev); >> @@ -354,8 +351,6 @@ static int hibmc_pci_probe(struct pci_dev *pdev, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hibmc_unload(dev); >> =C2=A0 err_disable: >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pci_disable_device(pdev); >> -err_free: >> -=C2=A0=C2=A0=C2=A0 drm_dev_put(dev); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >> =C2=A0 } >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h=20 >> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h >> index f310a83..e35353a 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h >> @@ -37,7 +37,7 @@ struct hibmc_drm_private { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 resource_size_t=C2=A0 fb_size; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* drm */ >> -=C2=A0=C2=A0=C2=A0 struct drm_device=C2=A0 *dev; >> +=C2=A0=C2=A0=C2=A0 struct drm_device dev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_plane primary_plane; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_crtc crtc; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_encoder encoder; >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c=20 >> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c >> index 74e26c2..d35548d 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c >> @@ -96,7 +96,7 @@ static const struct drm_encoder_funcs=20 >> hibmc_encoder_funcs =3D { >> =C2=A0 int hibmc_vdac_init(struct hibmc_drm_private *priv) >> =C2=A0 { >> -=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D priv->dev; >> +=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D &priv->dev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct hibmc_connector *hibmc_connector= =3D &priv->connector; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_encoder *encoder =3D &priv->= encoder; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_connector *connector =3D &hi= bmc_connector->base; >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c=20 >> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c >> index 602ece1..e84fb81 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c >> @@ -25,7 +25,7 @@ int hibmc_mm_init(struct hibmc_drm_private *hibmc) >> =C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct drm_vram_mm *vmm; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int ret; >> -=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D hibmc->dev; >> +=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D &hibmc->dev; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vmm =3D drm_vram_helper_alloc_mm(dev, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = pci_resource_start(dev->pdev, 0), >> @@ -41,10 +41,12 @@ int hibmc_mm_init(struct hibmc_drm_private *hibmc)= >> =C2=A0 void hibmc_mm_fini(struct hibmc_drm_private *hibmc) >> =C2=A0 { >> -=C2=A0=C2=A0=C2=A0 if (!hibmc->dev->vram_mm) >> +=C2=A0=C2=A0=C2=A0 struct drm_device *dev =3D &hibmc->dev; >> + >> +=C2=A0=C2=A0=C2=A0 if (!dev->vram_mm) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return; >> -=C2=A0=C2=A0=C2=A0 drm_vram_helper_release_mm(hibmc->dev); >> +=C2=A0=C2=A0=C2=A0 drm_vram_helper_release_mm(dev); >=20 > That's OK for now. A good follow-up patchset is the conversion to=20 > managed DRM helpers. We have these for modesetting, vram helpers and=20 > others. >=20 >> =C2=A0 } >> =C2=A0 int hibmc_dumb_create(struct drm_file *file, struct drm_device = *dev, >> >=20 >=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 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 --------------BE196A595BDE17B60AB4F718 Content-Type: application/pgp-keys; name="OpenPGP_0x680DC11D530B7A23.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="OpenPGP_0x680DC11D530B7A23.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdgX= H47 fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0BeB5B= bqP 5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4YchdHm3bkPj= z9E ErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB9GluwvIhSezPg= nEm imZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEBAAHNKFRob21hcyBaa= W1t ZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmNvbT7CwI4EEwEIADgCGwMFCwkIBwIGFQoJCAsCB= BYC AwECHgECF4AWIQRyF/usjOnPY0ShaOVoDcEdUwt6IwUCXvxIWAAKCRBoDcEdUwt6I+aZB/9ih= Onf G4Lgf1L87cvoXh95/bnaJ6aQhP6/ZeRleuCXflnyDajlm3c9loQr0r2bQUi7JeYwUKbBab2QS= GJm DMRGlLMnmzWB8mHmZ6bHAu+2Sth8SraE42p6BB9d8dlYEID+dl/D/xUBeulfkck5rloGtYqDi= +1Q DfkEZJaxVSZ6FFkXuQi/G9qcI4iklN2nv02iQ7mZe8WYAysix6s/6vIobhirEBreclSNxXqis= p8n 91+v855JC11Eg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zBeMm0A7K1MZ2lne+mKj= T72 bz2KE6isyrpIn4xlzLMQuh1OCthrHKb6GiJO4JWg/jWIt3yBov4EdFDXOnJl7Tq2CkpwrDTsH= Dgi Sw4xK+mHW3QFztsMQi6p7qaPCUSYAPIY4xzOTqExhMj/3Pgyg6hTvdGIpV9VzfMXIR68Pmw79= BGZ tEWaVXS+1ja+6kBOFIQ37sqOBorOGfp6c6Di+IN8mkEHyt9s2Q/YqpPdedm+58tinuaBSBeUk= mhM B/9rSzQXr84M1rhAehbaqDE+UYw8sfsQXiJkZYZz9BHp0YfhD9J5iwgGhYj+LU6dW1+eEsgcq= fMH Dexdvr9koHXeuMNaXa40++GX9cY9DU8RHbeYxGj35eVY793F4gfAAsD5DCF5pCcd7mhicp5eD= rIq 258874hM7w1aSwMS+0K+oppSlIfdogKM/l8RA6oDGZySTkwxXQ8RAYb/ddVc5Ua2gzXccODBz= JuT a+aY+BxmIdz4oMzaNCiK3gedGKoRjnrGguEO+YL/Ji3NhHOXRKu/QVTFDmgpmA0oQTfY+iaLz= bFk keWD97V4vo2flZ8ii37fcKNX4daGGnRRFUh4BrBG =3DskgE -----END PGP PUBLIC KEY BLOCK----- --------------BE196A595BDE17B60AB4F718-- --79Y3KwGtyWRdBEAb3HZOaxwTOt7gouJUl-- --o89dRhzFW5LQAZ7JU8VwSfrTnHWFK6jqb 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+/qfMFAwAAAAAACgkQlh/E3EQov+BW MRAAzULsHBPPAlnAgcQyioK9qsWXOTzWdsW6gkOWpRpSCJTWK5jtLFE8I6g5ljwwG/n5656NYeBN 4QY48nNkwZ39BJ2UhrNKq9eCsbqsDuzqC3BWOTWaYOZksElaCOCBuGGodpBiOaOfP9i7Nfutp/Fa eu1e3q14t1gCykWni8675vXDpY3nvDCNr5UVTwn9ENR8rvBI6VM7ima/n5Hp0xCkbMqqXlZnd0e5 wXMQ7JxFbZrVWBwYozLF0Ji+0S61bVj00CQwN8ekA8kRt0h284/OoaB5Riqx/eFdLsUwYyVil8+R HUbeG9i8yNEubGFwWchlH+FaxSMK2xl+nMB2Aqkp7rT9YiOT5qTykrDOXiMtGvkl7s5yKdwDB2fX Ucnw/kw8/0bvjte4+/13xN3NP36M0iqjbjzGj2V0GCpZ4blJDl9eKPR/b4e8cz6o69O9UnNwLOfY PIUEKdQngzlVB05OaXbG0+dhelJYNwDyqdVHRgAArzuA9kov2bFtjSin9nl/uV0rbMsHz52HqPlP T5YLTslEYoMwPDg6u02FQWEiFuQhn+/vGahXQy+sPp3egCKW1AJ3qn76BCMRs/2CQjww6HPy1J2d 5AUXL1XaSEJdmB4fHJUlyOj3mm8gm5eNJWHtpIcXp+CaG8ptZtXsPI1AgfLQep2tOcU2QedzhK3k Hy8= =gLOT -----END PGP SIGNATURE----- --o89dRhzFW5LQAZ7JU8VwSfrTnHWFK6jqb--