Re: [RFC/patch] macro_removal_agp_mtrr.diff

From: Dave Airlie
Date: Sat Sep 04 2004 - 05:22:53 EST



> for example does this extra pointer really hurt in the *really* unlikely
> case you don't have AGP ?

good point..

>
> if you make a drm_core_has_AGP and drm_core_has_MTRR wrapper around
> these then...
>
>
> > +#if __OS_HAS_MTRR
> > + if (drm_core_check_feature(dev, DRIVER_USE_MTRR)) {
> > + if ( map->type == _DRM_FRAME_BUFFER ||
> > + (map->flags & _DRM_WRITE_COMBINING) ) {
> > + map->mtrr = mtrr_add( map->offset, map->size,
> > + MTRR_TYPE_WRCOMB, 1 );
> > + }
> > }
>
> ...this would NOT need an ifdef because drm_core_has_MTRR would be a
> define to 0 for non-OS_HAS_MTRR machines at which point the compiler
> removes the entire code. Eg no ifdef needed and the code gets more
> readable.

I never remember the compiler will drop things completely.. so the
mtrr_add will never show up in the module.. I'll implement these and throw
another patch in ...

Thanks,
Dave.

--
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/