All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Ben Skeggs <bskeggs@redhat.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 10/15] drm: remove device_is_agp callback
Date: Wed, 25 Jan 2017 12:34:37 -0500	[thread overview]
Message-ID: <CADnq5_P8cQ-h9f_KG+pEq3ouuuAfUaxAfDHg6f0ZGgoJsmO3pw@mail.gmail.com> (raw)
In-Reply-To: <20170125062657.19270-11-daniel.vetter@ffwll.ch>

On Wed, Jan 25, 2017 at 1:26 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> With that the drm_pci_device_is_agp function becomes trivial, so
> inline that too. And while at it, move the drm_pci_agp_destroy
> declaration into drm-internal.h, since it's not used by drivers.
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/drm_internal.h          |  1 +
>  drivers/gpu/drm/drm_pci.c               |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_abi16.c |  2 +-
>  drivers/gpu/drm/radeon/radeon_cs.c      |  3 ++-
>  drivers/gpu/drm/radeon/radeon_kms.c     |  2 +-
>  include/drm/drmP.h                      | 15 ---------------
>  include/drm/drm_drv.h                   | 14 --------------
>  7 files changed, 6 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index a6213f814345..f37388cb2fde 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -31,6 +31,7 @@ void drm_lastclose(struct drm_device *dev);
>  /* drm_pci.c */
>  int drm_irq_by_busid(struct drm_device *dev, void *data,
>                      struct drm_file *file_priv);
> +void drm_pci_agp_destroy(struct drm_device *dev);
>
>  /* drm_prime.c */
>  int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 50c732a95b5a..b347c92914cf 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -191,7 +191,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
>  static void drm_pci_agp_init(struct drm_device *dev)
>  {
>         if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
> -               if (drm_pci_device_is_agp(dev))
> +               if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
>                         dev->agp = drm_agp_init(dev);
>                 if (dev->agp) {
>                         dev->agp->agp_mtrr = arch_phys_wc_add(
> diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
> index 7bd4683216d0..4df4f6ed4886 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
> @@ -199,7 +199,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
>                 if (!nvxx_device(device)->func->pci)
>                         getparam->value = 3;
>                 else
> -               if (drm_pci_device_is_agp(dev))
> +               if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
>                         getparam->value = 0;
>                 else
>                 if (!pci_is_pcie(dev->pdev))
> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
> index 510ea371dacc..a8442f7196d6 100644
> --- a/drivers/gpu/drm/radeon/radeon_cs.c
> +++ b/drivers/gpu/drm/radeon/radeon_cs.c
> @@ -121,7 +121,8 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
>                    VRAM, also but everything into VRAM on AGP cards and older
>                    IGP chips to avoid image corruptions */
>                 if (p->ring == R600_RING_TYPE_UVD_INDEX &&
> -                   (i == 0 || drm_pci_device_is_agp(p->rdev->ddev) ||
> +                   (i == 0 || pci_find_capability(p->rdev->ddev->pdev,
> +                                                  PCI_CAP_ID_AGP) ||
>                      p->rdev->family == CHIP_RS780 ||
>                      p->rdev->family == CHIP_RS880)) {
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index 116cf0d23595..56f35c06742c 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -105,7 +105,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
>         dev->dev_private = (void *)rdev;
>
>         /* update BUS flag */
> -       if (drm_pci_device_is_agp(dev)) {
> +       if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) {
>                 flags |= RADEON_IS_AGP;
>         } else if (pci_is_pcie(dev->pdev)) {
>                 flags |= RADEON_IS_PCIE;
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index e5882d5a68e5..21a3a666a2fd 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -790,21 +790,6 @@ extern void drm_sysfs_hotplug_event(struct drm_device *dev);
>
>  /*@}*/
>
> -/* PCI section */
> -static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
> -{
> -       if (dev->driver->device_is_agp != NULL) {
> -               int err = (*dev->driver->device_is_agp) (dev);
> -
> -               if (err != 2) {
> -                       return err;
> -               }
> -       }
> -
> -       return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
> -}
> -void drm_pci_agp_destroy(struct drm_device *dev);
> -
>  extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
>  extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
>  #ifdef CONFIG_PCI
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index 5ab2459b4345..af75fc6ec830 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -151,20 +151,6 @@ struct drm_driver {
>         void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
>
>         /**
> -        * @device_is_agp:
> -        *
> -        * Called by drm_device_is_agp().  Typically used to determine if a card
> -        * is really attached to AGP or not.
> -        *
> -        * Returns:
> -        *
> -        * One of three values is returned depending on whether or not the
> -        * card is absolutely not AGP (return of 0), absolutely is AGP
> -        * (return of 1), or may or may not be AGP (return of 2).
> -        */
> -       int (*device_is_agp) (struct drm_device *dev);
> -
> -       /**
>          * @get_scanout_position:
>          *
>          * Called by vblank timestamping code.
> --
> 2.11.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-01-25 17:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  6:26 [PATCH 00/15] More kerneldoc cleanup Daniel Vetter
2017-01-25  6:26 ` [PATCH 01/15] drm/kms-helpers: Use recommened kerneldoc for struct member refs Daniel Vetter
2017-01-25 12:48   ` [Intel-gfx] " Gustavo Padovan
2017-01-25 15:19     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 02/15] drm/bridge: " Daniel Vetter
2017-01-25  9:33   ` Archit Taneja
2017-01-25 12:40     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 03/15] drm/kms-core: " Daniel Vetter
2017-01-25 13:52   ` Eric Engestrom
2017-01-25  6:26 ` [PATCH 04/15] drm/gem|prime|mm: " Daniel Vetter
2017-01-25 12:51   ` Gustavo Padovan
2017-01-25  6:26 ` [PATCH 05/15] drm/core: " Daniel Vetter
2017-01-25 12:55   ` Gustavo Padovan
2017-01-25 15:23     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 06/15] drm/doc: Clarify connector overview Daniel Vetter
2017-01-25 12:57   ` [Intel-gfx] " Gustavo Padovan
2017-01-25 15:33     ` Daniel Vetter
2017-01-25 18:08       ` Gustavo Padovan
2017-01-25  6:26 ` [PATCH 07/15] drm/gma500: Nuke device_is_agp callback Daniel Vetter
2017-01-25 12:58   ` Gustavo Padovan
2017-01-26  0:11   ` Patrik Jakobsson
2017-01-25  6:26 ` [PATCH 08/15] drm/i810: drop " Daniel Vetter
2017-01-25 17:36   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 09/15] drm/mga: remove " Daniel Vetter
2017-01-25 17:33   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 10/15] drm: " Daniel Vetter
2017-01-25 17:34   ` Alex Deucher [this message]
2017-01-25  6:26 ` [PATCH 11/15] drm: Nuke ums vgaarb support Daniel Vetter
2017-01-25 17:40   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 12/15] drm/moc: Mark legacy fields in drm_driver as such Daniel Vetter
2017-01-25 17:43   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 13/15] drm/doc: Fix typos for early_unregister doc Daniel Vetter
2017-01-26  9:49   ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 14/15] drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/ Daniel Vetter
2017-01-25 17:31   ` Alex Deucher
2017-01-26  9:48     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 15/15] drm: Update kerneldoc for drm_crtc.[hc] Daniel Vetter
2017-01-25 14:26   ` Eric Engestrom
2017-01-25 15:36     ` Daniel Vetter
2017-01-25  7:54 ` ✗ Fi.CI.BAT: warning for More kerneldoc cleanup Patchwork

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=CADnq5_P8cQ-h9f_KG+pEq3ouuuAfUaxAfDHg6f0ZGgoJsmO3pw@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.