Design for setting video modes, ownership of sysfs attributes

From: Jon Smirl
Date: Sat Sep 18 2004 - 13:45:28 EST


Original proposal.....
At OLS we talked about a system like this for setting video modes:

1) user owns graphics devices
2) user sets mode with string (or similar) format using ioctl common to
all drivers.
3) driver is locked to prevent multiple mode sets
4) common code takes this string and does a hotplug event with it.
5) hotplug event runs root context in user space
6) mode is decoded and verified, this may involve a little process that
maintains the DDC database and reads a file of legal modes. Other
schemes are possible.
7a) mode is set using VBIOS and vm86, signal driver mode is set
7b) the register values needed to set the mode are passed into a root
priv ioctl.
8) driver is unlocked.

In this model all of the verification happens in user space. If you
want to set modes other than the ones from DDC you have to add them to
the config file. There is no need for DDC support and mode verification
in the kernel.

To give credit this is Alan Cox's design.

---------------------------------------------------------------------------------

I'm now starting to implement this design. Would it be better to set
the mode via sysfs attributes? This would allow mode settting with
something like: "echo 'my mode string' /sys/class/drm/card0/mode" A
list of available modes could be in /sys/class/drm/card0/modes

Can PAM change the ownership of a sysfs attribute/directory on login?
For this to work logging in needs to assign you ownership of the
attribute since you want to be able to change it but not anyone else.
DRM may need to assign the ownership of multiple attributes, is this
easy to do?

How are errors going to be communicated in this scheme? I can cat the
sysfs mode variable to get a status. Is there a good way to do this
without polling?

If the sysfs scheme doesn't work mode setting will need to be an IOCTL
with a small program since PAM can change the ownership of the DRM
device. The sysfs scheme has the major advantage of avoiding the need
for the small program.

If we go the sysfs route what is BSD going to do, will we have to
build parallel implementations?

--
Jon Smirl
jonsmirl@xxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/