From: Thierry Reding <thierry.reding@avionic-design.de>
To: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Mike Rapoport <mike@compulab.co.il>,
linux-fbdev-devel@lists.sourceforge.net,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
linux-arm-kernel@lists.arm.linux.org.uk,
"Antonino A. Daplas" <adaplas@gmail.com>
Subject: Re: [Linux-fbdev-devel] [PATCH 01/11] video: Add support for the Avionic Design Xanthos framebuffer.
Date: Mon, 18 May 2009 10:53:01 +0200 [thread overview]
Message-ID: <20090518085300.GA14909@avionic-design.de> (raw)
In-Reply-To: <20090516112243.44194c20.krzysztof.h1@poczta.fm>
* Krzysztof Helt wrote:
> Hi Thierry
[...]
> > > +static int adxfb_ioctl(struct fb_info *info, unsigned int command,
> > > + unsigned long arg)
> > > +{
> > > + struct adxfb_info *fb = to_adxfb_info(info);
> > > + void __user *argp = (void __user *)arg;
> > > + struct adxfb_scaler_mode mode;
> > > + struct adxfb_viewport viewport;
> > > + int err = 0;
> > > +
> > > + switch (command) {
> > > + case ADXFB_IOCTL_SCALER_SET_MODE:
> > > + if (copy_from_user(&mode, argp, sizeof(mode)))
> > > + return -EFAULT;
> > > +
> > > + err = adxfb_scaler_set_mode(info, &mode);
> > > + if (err < 0)
> > > + return err;
> > > +
> > > + break;
> > > +
> > > + case ADXFB_IOCTL_SCALER_GET_MODE:
> > > + err = adxfb_scaler_get_mode(info, &mode);
> > > + if (err < 0)
> > > + return err;
> > > +
> > > + if (copy_to_user(argp, &mode, sizeof(mode)))
> > > + return -EFAULT;
> > > +
> > > + break;
> > > +
> > > + case ADXFB_IOCTL_OVERLAY_ENABLE:
> > > + err = adxfb_overlay_enable(info, arg);
> > > + if (err < 0)
> > > + return err;
> > > +
> > > + break;
> > > +
> > > + case ADXFB_IOCTL_OVERLAY_SET_VIEWPORT:
> > > + if (copy_from_user(&viewport, argp, sizeof(viewport)))
> > > + return -EFAULT;
> > > +
> > > + err = adxfb_overlay_set_viewport(info, &viewport);
> > > + if (err < 0)
> > > + return err;
> > > +
> > > + break;
> > > +
> > > + default:
> > > + if (fb && fb->ioctl)
> > > + return fb->ioctl(info, command, arg);
> > > +
> > > + break;
>
> The fb->ioctl() is the adxfb_ioctl() here. It will cause infinite
> recursion if called with unknown ioctl command.
> Do not define the clause at all or return the -ENOTTY here.
It is not, actually. The fb->ioctl is supposed to allow board-specific
extensions and is usually NULL. It is not the same as adxfb_ioctl() but is
defined in the adxfb_info structure.
[...]
> I have no comments to rest of the patch so I removed it.
>
> I have a general comment that you should make your driver
> conform to the fbdev API (check_var/set_par) for mode setting.
> I know you have the scaler, so leave the adfxfb_ioctl to handle it.
> If you define the set_par/check_var functions to handle size of
> the overlay's input (without scaling) and color format one can
> use standard FBIOPUT_VSCREENINFO and
> FBIOGET_VSCREENINFO ioctls to set and read your overlay.
> If the overlay should be scaled use the custom ioctls to set the
> scaling factors only.
> Currently, your driver looks like it wants to work around the
> fbdev API. See the skeletonfb.c for guidance.
I was under the impression that FBIOPUT_SCREENINFO was used to set the
framebuffer resolution, which can be (even usually is) different from
that of the overlay. How can I distinguish between which of the video
pages (framebuffer or overlay) should be modified?
> Regards,
> Krzysztof
Thierry
-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
next prev parent reply other threads:[~2009-05-18 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1242294422-10478-1-git-send-email-thierry.reding@avionic-design.de>
2009-05-14 15:05 ` [PATCH 01/11] video: Add support for the Avionic Design Xanthos framebuffer Mike Rapoport
2009-05-16 9:22 ` Krzysztof Helt
2009-05-18 8:53 ` Thierry Reding [this message]
[not found] ` <20090518144028.9b8dbc3f.krzysztof.h1@poczta.fm>
2009-05-18 13:55 ` Thierry Reding
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=20090518085300.GA14909@avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=adaplas@gmail.com \
--cc=krzysztof.h1@poczta.fm \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux@arm.linux.org.uk \
--cc=mike@compulab.co.il \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.