[PATCH 09/20] drm: merge drm_memory.h into drm_memory.c

Daniel Vetter daniel at ffwll.ch
Fri Aug 29 05:43:10 PDT 2014


On Fri, Aug 29, 2014 at 01:56:23PM +0200, Thierry Reding wrote:
> On Fri, Aug 29, 2014 at 12:12:35PM +0200, David Herrmann wrote:
> > The drm_memory.h header is only used to define PAGE_AGP, which is only
> > used in drm_memory.c. Fold the header into drm_memory.c and drop it.
> > 
> > Signed-off-by: David Herrmann <dh.herrmann at gmail.com>
> > ---
> >  drivers/gpu/drm/drm_memory.c | 11 +++++++++
> >  include/drm/drmP.h           |  6 ++---
> >  include/drm/drm_memory.h     | 59 --------------------------------------------
> >  3 files changed, 13 insertions(+), 63 deletions(-)
> >  delete mode 100644 include/drm/drm_memory.h
> > 
> > diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
> > index 7888dad..62fda6a 100644
> > --- a/drivers/gpu/drm/drm_memory.c
> > +++ b/drivers/gpu/drm/drm_memory.c
> > @@ -39,6 +39,17 @@
> >  #include "drm_legacy.h"
> >  
> >  #if __OS_HAS_AGP
> > +
> > +#ifdef HAVE_PAGE_AGP
> > +# include <asm/agp.h>
> > +#else
> 
> This check seems to be redundant. All architectures that support AGP
> provide this header.
> 
> > +# ifdef __powerpc__
> > +#  define PAGE_AGP	__pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE)
> 
> Is this even necessary? It seems like PowerPC always defines
> HAVE_PAGE_AGP.

Iirc I've tried to untangle this before and I'm not 100% this is actually
the case on all ppc platforms. It looked like there's some crazy include
header depency stuff going on.

But given how popular drm on ppc and that the few platforms where people
actually use gpus are the saner ones (hopefully) I think we can just move
ahead with this change and fixup any compile breakage once it's reported.
If there is any.

> > +# else
> > +#  define PAGE_AGP	PAGE_KERNEL
> > +# endif
> > +#endif
> 
> Shouldn't this simply be moved into the asm/agp.h header for each of the
> architectures that has AGP?

Same comment really, I think the include mess is to hard to untangle. At
least I've failed. So with the #ifdef HAVE_PAGE_AGP dropped around the
include as Thierry suggested this is

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list