Re: Design for setting video modes, ownership of sysfs attributes

From: Jon Smirl
Date: Tue Sep 21 2004 - 10:57:59 EST


On Tue, 21 Sep 2004 14:45:07 +0200, Pavel Machek <pavel@xxxxxx> wrote:
> Hi!
>
> > 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.
>
> I though this was
>
> "Driver decides to either do it itself in kernel, or call userspace
> helper if that would be too complex".

The driver almost always needs to go to user space to get the file of
mode line overrides that the user can create. But there is nothing
stopping you from building everything in the kernel.

I'd just rather not have 100K of resident code waiting around for
something that doesn't occur very often. For the radeon sample I'm
working on I have moved everything to user space except for a couple
of small helper functions that directly play with the registers. Note
that all mode setting in X occurs completely in user space so you
can't argue that it can't be done.


> > 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?
>
> I'd say that write() to that sysfs file can simply return error. See
> echo disk > /sys/power/state, it returns error if transition failed.
>
> Pavel
> --
> People were complaining that M$ turns users into beta-testers...
> ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
>



--
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/