linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Antonino A. Daplas" <adaplas@gmail.com>
Cc: Linux Fbdev development list <linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: [PATCH 18/33] pm3fb: mtrr support and noaccel option
Date: Thu, 26 Jul 2007 13:12:38 -0700	[thread overview]
Message-ID: <20070726131238.9ed4bc7a.akpm@linux-foundation.org> (raw)
In-Reply-To: <46A8925B.8090801@gmail.com>

On Thu, 26 Jul 2007 20:23:55 +0800 "Antonino A. Daplas" <adaplas@gmail.com> wrote:

> From: Krzysztof Helt <krzysztof.h1@wp.pl>
> 
> This patch adds usage of MTRR registers and two new options: noaccel and
> nomtrr.
> 

It's been tested with CONFIG_MTRR=n, I trust?

> +#ifdef CONFIG_MTRR
> +#include <asm/mtrr.h>
> +#endif

Is the ifdef there needed for a successful compile?  If not, it's nicer to
leave it out.

>  #include <video/pm3fb.h>
>  
> @@ -52,6 +55,12 @@ #define PM3_PIXMAP_SIZE	(2048 * 4)
>   * Driver data
>   */
>  static char *mode_option __devinitdata;
> +static int noaccel   __devinitdata = 0;
> +
> +/* mtrr option */
> +#ifdef CONFIG_MTRR
> +static int nomtrr __devinitdata = 0;

Unneeded initialisation to zero.  scripts/checkpatch.pl detects and reports
this.

> +#ifdef CONFIG_MTRR
> +	if (!nomtrr) {
> +		par->mtrr_handle = mtrr_add(pm3fb_fix.smem_start,
> +						pm3fb_fix.smem_len,
> +						MTRR_TYPE_WRCOMB, 1);
> +	}
> +#endif
>  	info->fbops = &pm3fb_ops;
>  
>  	par->video = PM3_READ_REG(par, PM3VideoControl);
> @@ -1257,6 +1276,10 @@ #endif
>  			FBINFO_HWACCEL_IMAGEBLIT |
>  			FBINFO_HWACCEL_FILLRECT;
>  
> +	if (noaccel) {
> +	    	printk(KERN_DEBUG "disabling acceleration\n");
> +  		info->flags |= FBINFO_HWACCEL_DISABLED;
> +	}
>  	info->pixmap.addr = kmalloc(PM3_PIXMAP_SIZE, GFP_KERNEL);
>  	if (!info->pixmap.addr) {
>  		retval = -ENOMEM;
> @@ -1330,6 +1353,11 @@ static void __devexit pm3fb_remove(struc
>  		unregister_framebuffer(info);
>  		fb_dealloc_cmap(&info->cmap);
>  
> +#ifdef CONFIG_MTRR
> +	if (par->mtrr_handle >= 0)
> +		mtrr_del(par->mtrr_handle, info->fix.smem_start,
> +			 info->fix.smem_len);
> +#endif /* CONFIG_MTRR */

I suspect that with a bit of thought a lot of these unpleasing ifdefs could
be removed.



-------------------------------------------------------------------------
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/

  reply	other threads:[~2007-07-26 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26 12:23 [PATCH 18/33] pm3fb: mtrr support and noaccel option Antonino A. Daplas
2007-07-26 20:12 ` Andrew Morton [this message]
2007-07-26 21:51   ` Antonino A. Daplas
2007-07-27 17:19   ` Krzysztof Helt
2007-07-27 19:33     ` Andrew Morton

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=20070726131238.9ed4bc7a.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.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).