mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] video: fbdev: amiga: Simplify amifb_pan_display()
Date: Mon, 11 Jul 2022 23:20:27 +0200	[thread overview]
Message-ID: <681e1739-d251-661a-a46f-9412f3b6e165@gmx.de> (raw)
In-Reply-To: <b803f10a2b3b85386b25a2e25b98fb4e59413ea9.1657553681.git.geert@linux-m68k.org>

On 7/11/22 17:35, Geert Uytterhoeven wrote:
> The fb_pan_display() function in the core already takes care of
> validating most panning parameters before calling the driver's
> .fb_pan_display() callback, and of updating the panning state
> afterwards, so there is no need to repeat that in the driver.
>
> Remove the duplicate code.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

I've applied this and the other 3 patches to the fbdev git tree.

Thanks!
Helge


> ---
>  drivers/video/fbdev/amifb.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c
> index 6e07a97bbd31a1dd..d88265dbebf4cb19 100644
> --- a/drivers/video/fbdev/amifb.c
> +++ b/drivers/video/fbdev/amifb.c
> @@ -2540,27 +2540,16 @@ static int amifb_blank(int blank, struct fb_info *info)
>  static int amifb_pan_display(struct fb_var_screeninfo *var,
>  			     struct fb_info *info)
>  {
> -	if (var->vmode & FB_VMODE_YWRAP) {
> -		if (var->yoffset < 0 ||
> -			var->yoffset >= info->var.yres_virtual || var->xoffset)
> -				return -EINVAL;
> -	} else {
> +	if (!(var->vmode & FB_VMODE_YWRAP)) {
>  		/*
>  		 * TODO: There will be problems when xpan!=1, so some columns
>  		 * on the right side will never be seen
>  		 */
>  		if (var->xoffset + info->var.xres >
> -		    upx(16 << maxfmode, info->var.xres_virtual) ||
> -		    var->yoffset + info->var.yres > info->var.yres_virtual)
> +		    upx(16 << maxfmode, info->var.xres_virtual))
>  			return -EINVAL;
>  	}
>  	ami_pan_var(var, info);
> -	info->var.xoffset = var->xoffset;
> -	info->var.yoffset = var->yoffset;
> -	if (var->vmode & FB_VMODE_YWRAP)
> -		info->var.vmode |= FB_VMODE_YWRAP;
> -	else
> -		info->var.vmode &= ~FB_VMODE_YWRAP;
>  	return 0;
>  }
>


      reply	other threads:[~2022-07-11 21:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11 15:35 Geert Uytterhoeven
2022-07-11 21:20 ` Helge Deller [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=681e1739-d251-661a-a46f-9412f3b6e165@gmx.de \
    --to=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@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

all inboxes | Powered by JetHome®