Re: [PATCH 33/39] drm: rip out drm_core_has_MTRR checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

On Wed, Jul 10, 2013 at 2:12 PM, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
> The new arch_phys_wc_add/del functions do the right thing both with
> and without MTRR support in the kernel. So we can drop these
> additional checks.
>
> Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
> ---
>  drivers/gpu/drm/drm_bufs.c | 13 +++++--------
>  drivers/gpu/drm/drm_pci.c  | 11 +++++------
>  drivers/gpu/drm/drm_stub.c |  2 +-
>  drivers/gpu/drm/drm_vm.c   |  3 +--
>  include/drm/drmP.h         | 10 ----------
>  5 files changed, 12 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
> index 5f73f0a..f63133b 100644
> --- a/drivers/gpu/drm/drm_bufs.c
> +++ b/drivers/gpu/drm/drm_bufs.c
> @@ -207,12 +207,10 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
>                         return 0;
>                 }
>
> -               if (drm_core_has_MTRR(dev)) {
> -                       if (map->type == _DRM_FRAME_BUFFER ||
> -                           (map->flags & _DRM_WRITE_COMBINING)) {
> -                               map->mtrr =
> -                                       arch_phys_wc_add(map->offset, map->size);
> -                       }
> +               if (map->type == _DRM_FRAME_BUFFER ||
> +                   (map->flags & _DRM_WRITE_COMBINING)) {
> +                       map->mtrr =
> +                               arch_phys_wc_add(map->offset, map->size);
>                 }
>                 if (map->type == _DRM_REGISTERS) {
>                         if (map->flags & _DRM_WRITE_COMBINING)
> @@ -464,8 +462,7 @@ int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
>                 iounmap(map->handle);
>                 /* FALLTHROUGH */
>         case _DRM_FRAME_BUFFER:
> -               if (drm_core_has_MTRR(dev))
> -                       arch_phys_wc_del(map->mtrr);
> +               arch_phys_wc_del(map->mtrr);
>                 break;
>         case _DRM_SHM:
>                 vfree(map->handle);
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 80c0b2b..9e93ea5 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -276,12 +276,11 @@ static int drm_pci_agp_init(struct drm_device *dev)
>                         DRM_ERROR("Cannot initialize the agpgart module.\n");
>                         return -EINVAL;
>                 }
> -               if (drm_core_has_MTRR(dev)) {
> -                       if (dev->agp)
> -                               dev->agp->agp_mtrr = arch_phys_wc_add(
> -                                       dev->agp->agp_info.aper_base,
> -                                       dev->agp->agp_info.aper_size *
> -                                       1024 * 1024);
> +               if (dev->agp) {
> +                       dev->agp->agp_mtrr = arch_phys_wc_add(
> +                               dev->agp->agp_info.aper_base,
> +                               dev->agp->agp_info.aper_size *
> +                               1024 * 1024);
>                 }
>         }
>         return 0;
> diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
> index e7471ef..30cbd62 100644
> --- a/drivers/gpu/drm/drm_stub.c
> +++ b/drivers/gpu/drm/drm_stub.c
> @@ -445,7 +445,7 @@ void drm_put_dev(struct drm_device *dev)
>
>         drm_lastclose(dev);
>
> -       if (drm_core_has_MTRR(dev) && drm_core_has_AGP(dev) && dev->agp)
> +       if (dev->agp)
>                 arch_phys_wc_del(dev->agp->agp_mtrr);
>
>         if (dev->driver->unload)
> diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
> index feb2003..b5c5af7 100644
> --- a/drivers/gpu/drm/drm_vm.c
> +++ b/drivers/gpu/drm/drm_vm.c
> @@ -251,8 +251,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
>                         switch (map->type) {
>                         case _DRM_REGISTERS:
>                         case _DRM_FRAME_BUFFER:
> -                               if (drm_core_has_MTRR(dev))
> -                                       arch_phys_wc_del(map->mtrr);
> +                               arch_phys_wc_del(map->mtrr);
>                                 iounmap(map->handle);
>                                 break;
>                         case _DRM_SHM:
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 62e9e41..d933f06 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -75,7 +75,6 @@
>  #include <linux/idr.h>
>
>  #define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
> -#define __OS_HAS_MTRR (defined(CONFIG_MTRR))
>
>  struct module;
>
> @@ -1220,15 +1219,6 @@ static inline int drm_core_has_AGP(struct drm_device *dev)
>  #define drm_core_has_AGP(dev) (0)
>  #endif
>
> -#if __OS_HAS_MTRR
> -static inline int drm_core_has_MTRR(struct drm_device *dev)
> -{
> -       return drm_core_check_feature(dev, DRIVER_USE_MTRR);
> -}
> -#else
> -#define drm_core_has_MTRR(dev) (0)
> -#endif
> -

That was the last user of DRIVER_USE_MTRR (apart from drivers setting
it in .driver_features). Any reason to keep it around?

Cheers
David

>  static inline void drm_device_set_unplugged(struct drm_device *dev)
>  {
>         smp_wmb();
> --
> 1.8.3.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux