[Intel-gfx] [PATCH 01/11] drm: Remove __OS_HAS_AGP

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Sep 9 05:53:56 PDT 2015


On Tue, Sep 08, 2015 at 01:56:21PM +0200, Daniel Vetter wrote:
> We already express the drm/agp depencies correctly in Kconfig, so we
> can rip this remnant from the shared drm core days.
> 
> Aside: Pretty much all the #ifdefs in radeon/nouveau could be killed
> if ttm would provide dummy functions. I'm not going to volunteer for
> that though.
> 
> v2: Use IS_ENABLED(CONFIG_AGP) as suggested by Ville
> 
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/Makefile             |  3 ++-
>  drivers/gpu/drm/drm_agpsupport.c     |  4 ++--
>  drivers/gpu/drm/drm_bufs.c           |  6 +++---
>  drivers/gpu/drm/drm_ioc32.c          |  6 +++---
>  drivers/gpu/drm/drm_ioctl.c          |  2 +-
>  drivers/gpu/drm/drm_memory.c         |  6 +++---
>  drivers/gpu/drm/drm_vm.c             |  8 ++++----
>  drivers/gpu/drm/mga/mga_dma.c        |  4 ++--
>  drivers/gpu/drm/nouveau/nouveau_bo.c |  8 ++++----
>  drivers/gpu/drm/r128/r128_cce.c      | 12 ++++++------
>  drivers/gpu/drm/radeon/r600_cp.c     | 14 +++++++-------
>  drivers/gpu/drm/radeon/radeon_agp.c  |  8 ++++----
>  drivers/gpu/drm/radeon/radeon_cp.c   | 16 ++++++++--------
>  drivers/gpu/drm/radeon/radeon_ttm.c  | 10 +++++-----
>  include/drm/drm_agpsupport.h         |  6 +++---
>  15 files changed, 57 insertions(+), 56 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
> index 45e7719846b1..f458d6e33655 100644
> --- a/drivers/gpu/drm/Makefile
> +++ b/drivers/gpu/drm/Makefile
> @@ -6,7 +6,7 @@ drm-y       :=	drm_auth.o drm_bufs.o drm_cache.o \
>  		drm_context.o drm_dma.o \
>  		drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \
>  		drm_lock.o drm_memory.o drm_drv.o drm_vm.o \
> -		drm_agpsupport.o drm_scatter.o drm_pci.o \
> +		drm_scatter.o drm_pci.o \
>  		drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \
>  		drm_crtc.o drm_modes.o drm_edid.o \
>  		drm_info.o drm_debugfs.o drm_encoder_slave.o \
> @@ -19,6 +19,7 @@ drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
>  drm-$(CONFIG_PCI) += ati_pcigart.o
>  drm-$(CONFIG_DRM_PANEL) += drm_panel.o
>  drm-$(CONFIG_OF) += drm_of.o
> +drm-$(CONFIG_AGP) += drm_agpsupport.o
>  
>  drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \
>  		drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o
> diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
> index 4b2b4aa5033b..4dc85ec7aca1 100644
> --- a/drivers/gpu/drm/drm_agpsupport.c
> +++ b/drivers/gpu/drm/drm_agpsupport.c
> @@ -36,7 +36,7 @@
>  #include <linux/slab.h>
>  #include "drm_legacy.h"
>  
> -#if __OS_HAS_AGP
> +#if IS_ENABLED(CONFIG_AGP)

Since you make drm_agpsupport.o build depend on CONFIG_AGP, I suppose
you could drop the #if entirely from drm_agpsupport.c?

>  
>  #include <asm/agp.h>
>  
> @@ -503,4 +503,4 @@ drm_agp_bind_pages(struct drm_device *dev,
>  }
>  EXPORT_SYMBOL(drm_agp_bind_pages);
>  
> -#endif /* __OS_HAS_AGP */
> +#endif /* CONFIG_AGP */
<snip>
> diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
> index 055dc058d147..3d0833c63af2 100644
> --- a/include/drm/drm_agpsupport.h
> +++ b/include/drm/drm_agpsupport.h

Not removing the __OS_HAS_AGP define itself?

> @@ -28,7 +28,7 @@ struct drm_agp_head {
>  	unsigned long page_mask;
>  };
>  
> -#if __OS_HAS_AGP
> +#ifdef CONFIG_AGP

Should use IS_ENABLED(CONFIG_AGP) as well.

Otherwise the patch looks good to me, so with that fixed
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

>  
>  void drm_free_agp(struct agp_memory * handle, int pages);
>  int drm_bind_agp(struct agp_memory * handle, unsigned int start);
> @@ -66,7 +66,7 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
>  int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
>  		       struct drm_file *file_priv);
>  
> -#else /* __OS_HAS_AGP */
> +#else /* CONFIG_AGP */
>  
>  static inline void drm_free_agp(struct agp_memory * handle, int pages)
>  {
> @@ -194,6 +194,6 @@ static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
>  	return -ENODEV;
>  }
>  
> -#endif /* __OS_HAS_AGP */
> +#endif /* CONFIG_AGP */
>  
>  #endif /* _DRM_AGPSUPPORT_H_ */
> -- 
> 2.5.1

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list