linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Stanislaw Gruszka <stf_xl@wp.pl>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: krzysztof.h1@wp.pl, linux-fbdev-devel@lists.sourceforge.net,
	Haavard Skinnemoen <hskinnemoen@atmel.com>
Subject: Re: [PATCH 2/2] atmel_lcdfb: Disallow to set larger resolution than framebuffer memory can handle
Date: Fri, 05 Sep 2008 09:25:16 +0200	[thread overview]
Message-ID: <48C0DEDC.8050302@atmel.com> (raw)
In-Reply-To: <200809031537.40702.stf_xl@wp.pl>

Stanislaw Gruszka :
> Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
> CC: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  drivers/video/atmel_lcdfb.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index 3376f35..5d6cf33 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -342,6 +342,13 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
>  	var->transp.offset = var->transp.length = 0;
>  	var->xoffset = var->yoffset = 0;
>  
> +	if (info->fix.smem_len) {
> +		unsigned int smem_len = (var->xres_virtual * var->yres_virtual
> +					 * ((var->bits_per_pixel + 7) / 8));
> +		if (smem_len > info->fix.smem_len)
> +			return -EINVAL;
> +	}
> +
>  	/* Saturate vertical and horizontal timings at maximum values */
>  	var->vsync_len = min_t(u32, var->vsync_len,
>  			(ATMEL_LCDC_VPW >> ATMEL_LCDC_VPW_OFFSET) + 1);


-- 
Nicolas Ferre


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

      parent reply	other threads:[~2008-09-05  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 13:37 [PATCH 2/2] atmel_lcdfb: Disallow to set larger resolution than framebuffer memory can handle Stanislaw Gruszka
2008-09-03 18:59 ` Krzysztof Helt
2008-09-04  7:14   ` Stanislaw Gruszka
2008-09-05  7:25 ` Nicolas Ferre [this message]

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=48C0DEDC.8050302@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=akpm@linux-foundation.org \
    --cc=hskinnemoen@atmel.com \
    --cc=krzysztof.h1@wp.pl \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=stf_xl@wp.pl \
    /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).