|
From: Geert U. <ge...@li...> - 2002-11-02 13:21:41
|
On Fri, 1 Nov 2002, James Simmons wrote:
> Looking at the last bits of the fbdev changes I have question. Currently
> I have in fbgen.c:
>
> int fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
> {
> int xoffset = var->xoffset;
> int yoffset = var->yoffset;
> int err;
>
> if (xoffset < 0 || yoffset < 0 ||
> xoffset + info->var.xres > info->var.xres_virtual ||
> yoffset + info->var.yres > info->var.yres_virtual)
> return -EINVAL;
The one above is generic.
> if (info->fbops->fb_pan_display) {
> if ((err = info->fbops->fb_pan_display(var, info)))
> return err;
> else
> return -EINVAL;
> }
This is weird. if 0 == info->fbops->fb_pan_display, there's no panning, but it
does succeed?
> 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;
> }
>
> Now what I was wondering are these test standard enough that we coudl call
> this instead of info->fb_ops->fb_pan_display. Several drivers have this
> test so it would me more code reduction.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
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
|