[PATCH replace] DDX/fbdevhw: Disable FBIOBLANK ioctl if not supported

Keith Packard keithp at keithp.com
Fri Oct 4 14:32:30 PDT 2013

Egbert Eich <eich at freedesktop.org> writes:

> Some ioctls may not be supported by the kernel however their failure
> is non-fatal to the driver. Unfortunately we only know once we try
> to execute the ioctl however the sematics of the fbdev driver API
> doesn't allow upper layers to disable the call.
> Instead of changing the fbdevHW driver API just disable the call to
> this ioctl on the module level when detecting such a case.

I'd not bother with remembering whether the ioctls were supported and
just call every time, ignoring any errors and not printing
anything ever.

If you want an error message on the first call, I think just having a
static boolean within the lexical scope of the function would be simpler
than adding the per-device bitmask, enum of unsupported ioctl names etc.

Of course, I don't care *that* deeply either, so if this is really what
you want...

> +    if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *) fbmode)) {
> +        switch (errno) {
> +        case EAGAIN:
> +        case EINTR:
> +        case ERESTART:
> +            xf86DrvMsg(pScrn->scrnIndex, X_INFO,
> +                       "FBIOBLANK: %s\n", strerror(errno));
> +            break;

Presumably some of these values should cause the driver to retry the

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131004/6624902a/attachment.pgp>

More information about the xorg-devel mailing list