From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: "Antonino A. Daplas" <adaplas@gmail.com>
Subject: Re: [PATCH] tdfxfb: mtrr support (2nd revision)
Date: Thu, 2 Aug 2007 19:56:18 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0708021952550.5150@anakin> (raw)
In-Reply-To: <20070731115557.50b9b933.krzysztof.h1@wp.pl>
On Tue, 31 Jul 2007, Krzysztof Helt wrote:
> This patch adds mtrr support to the tdfxfb driver.
> It also kills one redundant include and initialization value.
>
> Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
>
> ---
>
> This patch requires all previous tdfxfb patches sent to this list.
> It reduces ifdefs to only removing unused "nomtrr" parameter from the code.
>
> --- linux-2.6.22/drivers/video/tdfxfb.c 2007-07-31 11:49:16.921420742 +0200
> +++ linux-2.6.23/drivers/video/tdfxfb.c 2007-07-31 11:49:46.147086218 +0200
> @@ -78,6 +77,24 @@
> #define DPRINTK(a,b...)
> #endif
>
> +#ifdef CONFIG_MTRR
> +#include <asm/mtrr.h>
> +#else
> +/* duplicate asm/mtrr.h defines to work on archs without mtrr */
> +#define MTRR_TYPE_WRCOMB 1
> +
> +static __inline__ int mtrr_add (unsigned long base, unsigned long size,
> + unsigned int type, char increment)
> +{
> + return -ENODEV;
> +}
> +static __inline__ int mtrr_del (int reg, unsigned long base,
> + unsigned long size)
> +{
> + return -ENODEV;
> +}
> +#endif
While I like your suggestion to move mtrr.h to the include/asm-generic or
include/linux directory, and redefine all functions as dummies in case
CONFIG_MTRR is not defined, the above are not really dummies, as they
return an error code.
> @@ -1227,6 +1246,12 @@ static int __devinit tdfxfb_probe(struct
>
> printk("fb: %s memory = %dK\n", tdfx_fix.id, tdfx_fix.smem_len >> 10);
>
> + default_par->mtrr_handle = -1;
> + if (!nomtrr)
> + default_par->mtrr_handle =
> + mtrr_add(tdfx_fix.smem_start, tdfx_fix.smem_len,
> + MTRR_TYPE_WRCOMB, 1);
> +
... but everything works nicely, because no callers of mttr_{add,del}()
check for actual errors ;-)
In this case it's a bit tricky to have dummies _and_ check for
failures...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-08-02 17:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-29 21:06 [PATCH] tdfxfb: mtrr support Krzysztof Helt
2007-07-29 23:16 ` Antonino A. Daplas
2007-07-30 11:58 ` Krzysztof Helt
2007-07-31 9:55 ` [PATCH] tdfxfb: mtrr support (2nd revision) Krzysztof Helt
2007-08-02 17:56 ` Geert Uytterhoeven [this message]
2007-08-03 3:24 ` Krzysztof Helt
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=Pine.LNX.4.64.0708021952550.5150@anakin \
--to=geert@linux-m68k.org \
--cc=adaplas@gmail.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).