Merge pull request #45 from Psychtoolbox-3/master

Resync with current master of official Psychtoolbox-3 repo.

* Mostly undo octave-3.8 incompatible CalStruct OOP code.
* Small other BrainardLab fixes.

Note: Testing with octave-4.2 devel branch showed that the CalStruct OOP code would have mostly worked, ie., will work once 4.2 is released. One missing item was inputParser(), and then some smal stuff.
Screen.m: Make compatible with Octave, so "help Screen.m" works.
PsychtoolboxVersion(): Add in (Neuro)Debian support.

So NeuroDebian doesn't have to carry its own support patches
for this function. Also fix lacking 'date', 'websvn' fields,
and generally clean it up a bit.
Screen/Linux: Add safeguard against negative msc values.

On two occassions glXWaitForSbcOML() returned a negative msc
value, which is legal, as msc is a signed 64 Bit integer, but
our remaining code can't deal with this, so simply strip the
sign bit from returned msc's, so they are always positive and
incrementing from the perspective of our code, so we are
protected against such a "underflow by overflow" scenario.

It was not clear in those two isolated cases why suddenly
negative (but incrementing) values were returned, as values
large enough to overflow are very unlikely in practice. A
restart of the X-Server via logout/login resolved the problem.
Maybe somewhere a zero initialization is missing in XOrg 1.15?
That would technically be not a bug, as the "start point" is not
defined and could be in the high value range, but it would still
be confusing to clients.
Screen: Support new imagingMode flag kPsychNeedOtherStreamInput.

When the flag is provided and a stereomode is active, this will
bind the complementary input image to texture unit 1 during
processing of a stereo processing chain. For left-view processing,
the input image of the right view channel is exposed, during right-
view processing, the input image of the left view channel is exposed.

This allows for things like stereo crosstalk reduction shaders
which need access to the "other eyes" input image to use it for
their suppression strategy.
PsychImaging: Reshuffle stereo setup code to treat VPixx devices better.

DataPixx/ViewPixx/ProPixx special feature setup code should also
execute for stereo modes selected via PsychImaging tasks, not only
for user-provided numeric stereomode specs.

Reorder taks processing to make it so.
Screen/Linux: Add final workaround setup for nouveau-kms pageflip bugs.

Rework this again. The timestamping workaround for nouveau-kms pageflip
completion event bugs in Linux 3.13-3.15 can be enabled via the
conserveVRAM setting.It will also get auto-enabled if a broken kernel
is detected, ie., a kernel with a version prior to the versions we know
to contain the fixes. This is easily done for 3.14 and 3.15. Linux 3.13
needs special treatment, depending if it is a longterm stable kernel, or
a Ubuntu distribution kernel based on a longterm 3.13 stable kernel.

Now we have Ubuntu specific detection logic in place to detect if we
are on a vanilla 3.13 kernel or Ubuntu one. And specific detection logic
to decide if the workaround is needed or not.

The current situation mid August 2014 is that the bug is fixed in all
upstream/mainline/vanilla stable kernels (3.13.11.5+, 3.14.12+, 3.15.5+),
and in all Linux 3.16+ kernels anyway since initial release.

The Ubuntu 14.04-LTS distribution kernel still isn't fixed, one month
after Ubuntu's kernel team fixed the 3.13.11.5+ stable longterm kernel
on which the 14.04-LTS kernels are based. This takes longer than i
expected, so we add this Ubuntu special case, which can automatically
decide about the status of the 14.04-LTS kernel and act appropriately.

Only source code updated, to allow cherry-picking into ptb 3.0.11.
Screen/Linux: Add PCI-Ids for AMD MULLINS DCE-8 type asic.
PsychtoolboxKernelDriver for OSX: Add PCI-Ids for AMD MULLINS DCE-8 type asic.
Add prototype implementation of stereo crosstalk reduction.

This adds a new, but so far hidden/undocumented PsychImaging
task 'StereoCrosstalkReduction', and associated demo code inside
ImagingStereoDemo.m.

Requesting ...

 PsychImaging('AddTask', 'LeftView', 'StereoCrosstalkReduction', reduceCrossTalk);
 PsychImaging('AddTask', 'RightView', 'StereoCrosstalkReduction', reduceCrossTalk);

...would load the new StereoCrosstalkReductionShader.frag.txt GLSL shader, set it
up with parameter 'reduceCrossTalk' (whatever that is) and attach it to a properly
configured imaging pipeline. It's purpose in life would be to somehow reduce
crosstalk in stereo images.

Currently the shader(s) get attached at the top of the per-view image processing
chains, one shader for left-eye, and one for right-eye. This way the input images
to the shaders are the (panel scaled/fitted and multisample anti-aliased) stimulus
images as drawn by usercode. We use one individual shader per eye, so each shader,
although containing the same code, can be parameterized differently for the two
eyes.

The shader must be a single-pass shader, as the content of the 2nd stereo channel
(the one whose ghost images shall be suppressed) can't be carried through multiple
pipeline slots or passes.

Also shader placement isn't yet optimal in case other operations like image flipping,
geometric undistortion etc. would be also part of the image processing chains. This
may need more work, once the basics are proven to be working, but as a starter it
should be good enough.

The shader itself is currently just a "here starts your task" implementation,
which doesn't do something meaningful, apart from demonstrating to Diederick how
to access the two input images and create an output image. Filling the shader with
some meaning is Diedericks task.

This commit also contains a properly compiled Screen mex file for 64-Bit Octave on
Linux to make this work.

Recompile for Screen mex files for other runtimes and os'es is pending for a
separate commit.
Screen for 64-Bit Matlab/Octave on OSX and 64-Bit Matlab on Windows rebuilt.

-> Incorporates the changes needed for stereo crosstalk reduction prototyping.
Merge pull request #204 from kleinerm/master

Pull current state into public master.

* Linux final nouveau-kms and msc fixes.
* AMD MULLINS support for Linux and PTBKD.
* Prototype implementation for stereo crosstalk reduction - just the support infrastructure.
* PsychtoolboxVersion supports NeuroDebian.
* Smallish cleanups.
Merge remote-tracking branch 'upstream/master'