Re: [RFC] viafb: add interface for output device configuration

From: Andrew Morton
Date: Tue Sep 07 2010 - 18:53:38 EST


On Mon, 6 Sep 2010 22:48:10 +0000
Florian Tobias Schandinat <FlorianSchandinat@xxxxxx> wrote:

> viafb: add interface for output device configuration
>
> This patch extends the proc entry to contain a possibility to view and
> change the output devices for each IGA. This is useful for debugging
> output problems as it provides a reliable way to query which low level
> devices are active after VIAs output device configuration nightmare
> happended. It's as well suitable for daily use as one can change the
> output configuration on the fly for example to connect a projector.
> At the moment it's still unstable. The reason is that we have to handle
> a bunch of undocumented output devices (those without a proper name) and
> that this patch is the first step to collect and verify the needed
> information. Basically the only configuration change that is expected to
> work at the moment is switching output devices between IGA1 and IGA2.
>
> ...
>
> +u32 via_parse_odev(char *input, char **end)
> +{
> + char *ptr = input;
> + u32 odev = 0;
> + bool next = true;
> + int i, len;
> +
> + while (next) {
> + next = false;
> + for (i = 0; i < ARRAY_SIZE(device_mapping); i++) {
> + len = strlen(device_mapping[i].name);
> + if (!strncmp(ptr, device_mapping[i].name, len)) {
> + odev |= device_mapping[i].device;
> + ptr += len;
> + if (*ptr == ',') {
> + ptr++;
> + next = true;
> + }
> + }
> + }
> + }
> +
> + *end = ptr;
> + return odev;
> +}

So people must decrypt the above code

> + iga1_entry = proc_mkdir("iga1", viafb_entry);
> + shared->iga1_proc_entry = iga1_entry;
> + proc_create("output_devices", 0, iga1_entry,
> + &viafb_iga1_odev_proc_fops);
> + iga2_entry = proc_mkdir("iga2", viafb_entry);
> + shared->iga2_proc_entry = iga2_entry;
> + proc_create("output_devices", 0, iga2_entry,
> + &viafb_iga2_odev_proc_fops);
> }

to work out what to write into these?

Can we have a wee bit of documetnation, please? At least in the
changelog, but Documentation/fb/viafb.txt would be a better place.

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