Skip to contentSkip to conversation

"ls > /dev/fb0" generates weird ioctls if panning is set

DISCUSSION Timur Tabi 2 participants 3 messages Dec 16, 2011 Framebuffer layer

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

If I do this:

	echo "0,100" > /sys/devices/soc.0/fffe10000.display/graphics/fb0/pan

then whenever I do this:

	ls > /dev/fb0

my driver receives the following three ioctls:

graphics fb0: unknown ioctl command (0x402C7413) graphics fb0: dir=2 type='t' (74) nr sizeD graphics fb0: unknown ioctl command (0x40087468) graphics fb0: dir=2 type='t' (74) nr4 size=8 graphics fb0: unknown ioctl command (0x402C7413) graphics fb0: dir=2 type='t' (74) nr sizeD

This is on PowerPC, where dir=2 means read.

The "echo" and "cat" commands don't generate these ioctls, so there's something special about the "ls" command. Does anyone know what's going on? ioctl-number.txt lists these ioctls for type 't':

't' 00-7F linux/if_ppp.h
't' 80-8F linux/isdn_ppp.h
't' 90 linux/toshiba.h

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
author
#1 lore raw
Quoted 6 lines · Timur Tabi

graphics fb0: unknown ioctl command (0x402C7413) graphics fb0: dir=2 type='t' (74) nr sizeD graphics fb0: unknown ioctl command (0x40087468) graphics fb0: dir=2 type='t' (74) nr4 size=8 graphics fb0: unknown ioctl command (0x402C7413) graphics fb0: dir=2 type='t' (74) nr sizeD

I figured it out. These ioctls are:

#define TCGETS _IOR('t', 19, struct termios)
#define TIOCGWINSZ _IOR('t', 104, struct winsize)

I'm guessing that since I redirect stdout to /dev/fb0, Linux is treating /dev/fb0 as a terminal, and therefore it's receiving terminal ioctls.

Is this something that fbdev should be supporting, or am I wrong to use /dev/fb0 as a terminal?

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#2 lore raw
In reply to Timur Tabi
Quoted 14 lines · On Fri, 16 Dec 2011 16:31:22 -0600 Timur Tabi <[email protected]> wrote:
Quoted 6 lines · Timur Tabi

graphics fb0: unknown ioctl command (0x402C7413) graphics fb0: dir=2 type='t' (74) nr sizeD graphics fb0: unknown ioctl command (0x40087468) graphics fb0: dir=2 type='t' (74) nr4 size=8 graphics fb0: unknown ioctl command (0x402C7413) graphics fb0: dir=2 type='t' (74) nr sizeD

I figured it out. These ioctls are:

#define TCGETS _IOR('t', 19, struct termios)
#define TIOCGWINSZ _IOR('t', 104, struct winsize)

Quoted 6 lines

I'm guessing that since I redirect stdout to /dev/fb0, Linux is treating /dev/fb0 as a terminal, and therefore it's receiving terminal ioctls.

Is this something that fbdev should be supporting, or am I wrong to use /dev/fb0 as a terminal?

No. Do not redirect to /dev/fb0, use /dev/tty1 instead.

Anatolij