public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joseph Chan <JosephChan@via.com.tw>,
	Jonathan Corbet <corbet@lwn.net>
Subject: Re: [RFC] viafb: add interface for output device configuration
Date: Wed, 08 Sep 2010 01:20:29 +0200	[thread overview]
Message-ID: <4C86C8BD.2080703@gmx.de> (raw)
In-Reply-To: <20100907155301.d97c85c7.akpm@linux-foundation.org>

Andrew Morton schrieb:
> On Mon,  6 Sep 2010 22:48:10 +0000
> Florian Tobias Schandinat <FlorianSchandinat@gmx.de> 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.

Of course. I just wanted to make sure that the interface is sane and reasonable 
and improve the code to do the right thing at least in most of the cases before 
writing proper documentation for it. I hope that I can achieve the first with 
this e-mail and for the later I just prepared a patch which I'm testing at the 
moment. If there are no objections against this interface I hope I can send a 
complete patch series including this patch, major improvements and documentation 
within a week.


Thanks,

Florian Tobias Schandinat

      reply	other threads:[~2010-09-07 23:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06 22:48 [RFC] viafb: add interface for output device configuration Florian Tobias Schandinat
2010-09-07 22:53 ` Andrew Morton
2010-09-07 23:20   ` Florian Tobias Schandinat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C86C8BD.2080703@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=JosephChan@via.com.tw \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox