* [PATCH] drm: Make drm_pci_agp_init legacy
@ 2020-03-07 9:37 Chris Wilson
2020-03-07 10:13 ` Sam Ravnborg
2020-03-09 7:43 ` Thomas Zimmermann
0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2020-03-07 9:37 UTC (permalink / raw)
To: dri-devel
Pull the drm_pci_agp_init() underneath the legacy ifdeffry alongside its
only caller.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/drm_pci.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 5218475ad7e7..81aa21561982 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -166,6 +166,18 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
return drm_pci_irq_by_busid(dev, p);
}
+void drm_pci_agp_destroy(struct drm_device *dev)
+{
+ if (dev->agp) {
+ arch_phys_wc_del(dev->agp->agp_mtrr);
+ drm_legacy_agp_clear(dev);
+ kfree(dev->agp);
+ dev->agp = NULL;
+ }
+}
+
+#ifdef CONFIG_DRM_LEGACY
+
static void drm_pci_agp_init(struct drm_device *dev)
{
if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
@@ -180,18 +192,6 @@ static void drm_pci_agp_init(struct drm_device *dev)
}
}
-void drm_pci_agp_destroy(struct drm_device *dev)
-{
- if (dev->agp) {
- arch_phys_wc_del(dev->agp->agp_mtrr);
- drm_legacy_agp_clear(dev);
- kfree(dev->agp);
- dev->agp = NULL;
- }
-}
-
-#ifdef CONFIG_DRM_LEGACY
-
static int drm_get_pci_dev(struct pci_dev *pdev,
const struct pci_device_id *ent,
struct drm_driver *driver)
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: Make drm_pci_agp_init legacy
2020-03-07 9:37 [PATCH] drm: Make drm_pci_agp_init legacy Chris Wilson
@ 2020-03-07 10:13 ` Sam Ravnborg
2020-03-09 7:43 ` Thomas Zimmermann
1 sibling, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2020-03-07 10:13 UTC (permalink / raw)
To: Chris Wilson; +Cc: dri-devel
Hi Chris.
On Sat, Mar 07, 2020 at 09:37:02AM +0000, Chris Wilson wrote:
> Pull the drm_pci_agp_init() underneath the legacy ifdeffry alongside its
> only caller.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
I dunno this code - but patch is obviously correct.
This diff is a bit weird as it shows that another function is moved.
But it makes sense looking at drm_pci.c
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> drivers/gpu/drm/drm_pci.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 5218475ad7e7..81aa21561982 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -166,6 +166,18 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
> return drm_pci_irq_by_busid(dev, p);
> }
>
> +void drm_pci_agp_destroy(struct drm_device *dev)
> +{
> + if (dev->agp) {
> + arch_phys_wc_del(dev->agp->agp_mtrr);
> + drm_legacy_agp_clear(dev);
> + kfree(dev->agp);
> + dev->agp = NULL;
> + }
> +}
> +
> +#ifdef CONFIG_DRM_LEGACY
> +
> static void drm_pci_agp_init(struct drm_device *dev)
> {
> if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
> @@ -180,18 +192,6 @@ static void drm_pci_agp_init(struct drm_device *dev)
> }
> }
>
> -void drm_pci_agp_destroy(struct drm_device *dev)
> -{
> - if (dev->agp) {
> - arch_phys_wc_del(dev->agp->agp_mtrr);
> - drm_legacy_agp_clear(dev);
> - kfree(dev->agp);
> - dev->agp = NULL;
> - }
> -}
> -
> -#ifdef CONFIG_DRM_LEGACY
> -
> static int drm_get_pci_dev(struct pci_dev *pdev,
> const struct pci_device_id *ent,
> struct drm_driver *driver)
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: Make drm_pci_agp_init legacy
2020-03-07 9:37 [PATCH] drm: Make drm_pci_agp_init legacy Chris Wilson
2020-03-07 10:13 ` Sam Ravnborg
@ 2020-03-09 7:43 ` Thomas Zimmermann
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Zimmermann @ 2020-03-09 7:43 UTC (permalink / raw)
To: Chris Wilson, dri-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 2004 bytes --]
Hi
Am 07.03.20 um 10:37 schrieb Chris Wilson:
> Pull the drm_pci_agp_init() underneath the legacy ifdeffry alongside its
> only caller.
My I suggest to change the commit message slightly, because the patch
actually moves drm_pci_agp_destroy(). Something along 'implement
_destroy() before _init() to protect the latter by CONFIG_DRM_LEGACY'
should do.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In any case
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/drm_pci.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 5218475ad7e7..81aa21561982 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -166,6 +166,18 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
> return drm_pci_irq_by_busid(dev, p);
> }
>
> +void drm_pci_agp_destroy(struct drm_device *dev)
> +{
> + if (dev->agp) {
> + arch_phys_wc_del(dev->agp->agp_mtrr);
> + drm_legacy_agp_clear(dev);
> + kfree(dev->agp);
> + dev->agp = NULL;
> + }
> +}
> +
> +#ifdef CONFIG_DRM_LEGACY
> +
> static void drm_pci_agp_init(struct drm_device *dev)
> {
> if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
> @@ -180,18 +192,6 @@ static void drm_pci_agp_init(struct drm_device *dev)
> }
> }
>
> -void drm_pci_agp_destroy(struct drm_device *dev)
> -{
> - if (dev->agp) {
> - arch_phys_wc_del(dev->agp->agp_mtrr);
> - drm_legacy_agp_clear(dev);
> - kfree(dev->agp);
> - dev->agp = NULL;
> - }
> -}
> -
> -#ifdef CONFIG_DRM_LEGACY
> -
> static int drm_get_pci_dev(struct pci_dev *pdev,
> const struct pci_device_id *ent,
> struct drm_driver *driver)
>
--
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 #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-09 7:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-07 9:37 [PATCH] drm: Make drm_pci_agp_init legacy Chris Wilson
2020-03-07 10:13 ` Sam Ravnborg
2020-03-09 7:43 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).