From: Arjan van de Ven <arjanv@redhat.com>
To: Dave Airlie <airlied@linux.ie>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC/patch] macro_removal_agp_mtrr.diff
Date: Sat, 04 Sep 2004 12:14:38 +0200 [thread overview]
Message-ID: <1094292878.2801.7.camel@laptop.fenrus.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0409041053450.25475@skynet>
[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]
On Sat, 2004-09-04 at 12:02, Dave Airlie wrote:
> This patch is the first in the drmfntbl-0-0-2-branch of macro removals
>
> This dumps __REALLY_HAVE_AGP and __REALLY_HAVE_MTRR and replaces them with
> a bitmask of driver features that is checked...
>
> I've had to introduce __OS_HAS_AGP and __OS_HAS_MTRR, on Linux these map
> simply to (CONFIG_AGP || CONFIG_AGP_MODULE) and CONFIG_MTRR, however I
> can't remove them completely as we need to build on architectures that
> don't have the AGP or MTRR interfces... but they are much cleaner than the
> old code...
it looks you can nuke most of those.
> -#if __REALLY_HAVE_AGP
> +#if __OS_HAS_AGP
> drm_agp_head_t *agp; /**< AGP data */
> #endif
for example does this extra pointer really hurt in the *really* unlikely
case you don't have AGP ?
> +static __inline__ int drm_core_check_feature(struct drm_device *dev, int feature)
> +{
> + return ((dev->driver_features & feature) ? 1 : 0);
> +}
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.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-09-04 10:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-04 10:02 Dave Airlie
2004-09-04 10:11 ` Christoph Hellwig
2004-09-04 10:14 ` Arjan van de Ven [this message]
2004-09-04 10:21 ` Dave Airlie
2004-09-04 10:30 ` Dave Airlie
2004-09-04 10:36 ` Arjan van de Ven
2004-09-04 10:37 ` Arjan van de Ven
2004-09-04 13:23 ` Dave Airlie
2004-09-04 13:30 ` Arjan van de Ven
2004-09-04 15:47 ` Gene Heskett
2004-09-04 16:33 ` Alan Cox
2004-09-04 22:04 ` Lee Revell
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=1094292878.2801.7.camel@laptop.fenrus.com \
--to=arjanv@redhat.com \
--cc=airlied@linux.ie \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome