From: "Antonino A. Daplas" <adaplas@gmail.com>
To: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH] tdfxfb: mtrr support
Date: Mon, 30 Jul 2007 07:16:31 +0800 [thread overview]
Message-ID: <1185750991.9324.14.camel@daplas> (raw)
In-Reply-To: <20070729230653.d5dd086b.krzysztof.h1@wp.pl>
On Sun, 2007-07-29 at 23:06 +0200, Krzysztof Helt wrote:
> From: Krzysztof Helt <krzysztof.h1@wp.pl>
>
> 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.
>
> --- linux-2.6.22.old/drivers/video/tdfxfb.c 2007-07-28 23:37:00.000000000 +0200
> +++ linux-2.6.22/drivers/video/tdfxfb.c 2007-07-28 23:35:49.000000000 +0200
> @@ -67,7 +67,9 @@
> #include <linux/init.h>
> #include <linux/pci.h>
> #include <asm/io.h>
> -#include <linux/spinlock.h>
> +#ifdef CONFIG_MTRR
> +#include <asm/mtrr.h>
> +#endif
>
> #include <video/tdfx.h>
>
> @@ -150,7 +152,11 @@ MODULE_DEVICE_TABLE(pci, tdfxfb_id_table
> static int nopan;
> static int nowrap = 1; /* not implemented (yet) */
> static int hwcursor = 1;
> -static char *mode_option __devinitdata = NULL;
> +static char *mode_option __devinitdata;
> +/* mtrr option */
> +#ifdef CONFIG_MTRR
> +static int nomtrr __devinitdata;
> +#endif
>
> /* -------------------------------------------------------------------------
> * Hardware-specific funcions
> @@ -1227,6 +1233,14 @@ static int __devinit tdfxfb_probe(struct
>
> printk("fb: %s memory = %dK\n", tdfx_fix.id, tdfx_fix.smem_len >> 10);
>
> +#ifdef CONFIG_MTRR
> + 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);
> +#endif
> +
Since akpm already commented against using #ifdef's within functions,
might as well modify the patch to something like this:
#ifdef CONFIG_MTRR
static inline void tdfxfb_mtrr_add(struct fb_info *info)
{
struct tdfxfb_par *par = info->par;
par->mtrr_handle = mtrr_add(info->fix.smem_start,
info->fix.smem_len,
MTRR_TYPE_WRCOMB, 1);
}
#else
#define tdfxfb_mtrr_add(...) do {} while (0)
#endif
...tdfxfb_probe(...)
{
...
tdfxfb_mtrr_add();
...
}
Tony
-------------------------------------------------------------------------
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-07-29 23:16 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 [this message]
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
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=1185750991.9324.14.camel@daplas \
--to=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).