Linux and OSX: Update PCI ids for latest AMD GPUs as of June 2012

Some updates from 5-June-2012 for new Northern Islands, Southern
Islands and Trinity gpus.
Screen/Linux: Improve gpu crtc assignment logic

Still a heuristic, prone to failure on slightly unusual multi-display
setups. However, should be a bit more robust, and at least handle the
case from ptb forum message #14200 with AMD Catalyst driver better.
We'll see...

Now we just assign low-level hardware crtc's in ascending order,
starting with the first active output on the first X-Screen, followed
by more active outputs, then the outputs of a potential 2nd screen, 3rd
screen etc.

This should be ok on single-display, multi-display on single x-screen,
multi-displays on multi x-screen zaphodhead etc. Still assigning
display outputs in a non-ascending order to x-screens will kill the
guess-o-matic and require manual assignment via the 'ScreenToHead'
preference setting.
Screen: Improve early verbosity setup, be less chatty on Linux.

If the environment variable PSYCH_SCREEN_VERBOSITY is defined at
Screen() load time, its value is used as initial verbosity level for
Screen diagnostic output.

PsychTweak('ScreenVerbosity') allows to set this initial level, so it
takes effect already at Screen() load time, before usercode has the
option of changing verbosity the conventional way via
Screen('Preference', 'Verbosity').

The Linux Screen glue uses this to suppress some diagnostic startup
output at normal level 3: The amount of output for detection of
available video outputs for the different X-Screens and displays is too
much on some higher-end gpu's, e.g., 20 lines (!) on a AMD Eyefinity
card with multiple displayport, hdmi, dvi, vga outputs.

Also some formatting fixes to Screen and PsychTweak.
PsychtoolboxKernelDriver for OSX: Also support beamposition query on Intel GPUs

So far this wasn't needed, but at least OSX 10.7 does not support
beamposition queries on Intel integrated GPUs anymore, so we need to do
it ourselves via the kernel driver.

The OSX CVDisplayLink timestamping is pretty much useless on Intel IGP,
as it is even more horribly broken than on other GPUs.

PsychtoolboxKernelDriver for 64-Bit kernels rebuilt & tested.
Screen/Linux: Make windowed windows borderless/decorationless by default.

Non-GUI windows should have no borders, titlebar or any buttons, just
as on OSX.
Make it so by setting appropriate Window manager hints.
Rebuild Screen for 64-Bit Octave on Linux to test last commit.
Screen/Linux: Always use override-redirect, unless it is a GUI window.

This may be a more simple solution to consistent behaviour with OSX.
Screen for 64-Bit Octave on Linux rebuilt and tested on non-composited
desktop. Test for compositor pending.
Screen/Linux: Set proper window decorations for GUI mode.

If a window is in GUI mode, enable all decorations like
titlebar, border, control buttons, menu etc. Allow resize,
move, minimize and other ops. The only op we forbid is
closing the window via some close button or keyboard shortcut,
as that would wreak havoc.

Screen for 64-Bit Octave on Linux rebuilt and tested.
Screen/Linux: Honow windowLevels 0 to 999

A window shielding level now XLowerWindow()'s the window to the
bottom of the stack after creation.

A > 0 shielding level XMapRaised() maps it now to the top of
the stack.
Screen/Linux: Honor PsychDebugWindowConfiguration fully.

A zero opaqueForHID flag, aka windowShieldinglevel < 1500 was
so far ignored, ie., the levels 1000 - 1499 were treated identical
to levels 1500 - 1999. The window was always opaque for mouse clicks
and other input events. Rather annoying if one wants to debug on a
single display setup.

Now we use the XFixes V2.0+ extension to allow transparency for
input events like mouse clicks. The extension allows to define an
arbitrary subregion of the window, where it accepts input, outside
of that region it ignores it and just lets it go through to underlying
windows. We define an empty input region, thereby make the window
transparent for user input.

Makefiles updated with -lXfixes dependency on the libXFixes.so library.

Screen for 64-Bit Octave on Linux rebuilt and tested.
Screen/Linux: Improve window stacking, try per-pixel alpha.

Use the NETWM_STATE_ABOVE property for GUI windows at windowLevel
of at least 500. This will instruct the WM to try to keep the window
above most other windows.

Try to choose a GLX visual / fbconfig that allows true ARGB 32 bit
window backing stores and may facilitate per pixel alpha transparency
for transparent windows (windowLevels 1000 - 1999). May or may not work.
Screen/Linux: Bugfix for last commit - Must bind glXGetFBConfigAttrib()

Before we use it the first time, or bad things will happen.
Screen/Linux: Another bugfix for glXGetFBConfigAttrib()

Return code on success is 'Success', not TRUE!
Screen/Linux: Match for visual depths of 32 bpp, not FBConfig depth 32 bpp.

Another refinement, probably as pointless as all refinements before.
Screen/Linux: Only share OpenGL context resources on same X-Screen.

Context resource sharing fails between windows that are living
on different X-Screens, therefore we must avoid trying this.

Instead we try to find a matching peer window from the same
X-Screen to share with, otherwise just avoid sharing if there
isn't any suitable peer for a newborn window on the same X-Screen.

Screen for 64-Bit Octave on Linux rebuilt.
Btw. Per-Pixel alpha transparency now works on composited desktops,
due to the last patch in the endless patch series of fixes. This
means that functionality of PsychDebugWindowConfiguration() et al.
is now on par with OSX and Windows.
Screen/Linux: Only share OpenGL context resources on same X-Screen II

And another damn fix for stuff that refuses to work first time.
We need to skip ourselves when searching for matching peer windows,
ie., a window that has our own window index, because the new window
is already stored in the windowbank, but not yet valid.
Screen/Linux: Add another safety check for OpenGL context sharing.

The code can handle context auto-resource sharing properly now when
multiple X-Screens are involved. It shares between windows on the same
X-Screen, but not across X-Screens.

However, multi-display stereo mode (Mode 10), or display mirroring,
both via imaging pipeline and bounce buffer fbo's absolutely requires
sharing context resources, so we either have to succeed in sharing, or
fail with an error message. Add a check to catch the 2nd case when trying
to share across X-Screens and abort with an error message, instead of
crashing the runtime hard, as we do at the moment.
Screen/Linux: Add potential fix for multi-X-Screen multiflips.

For synchronous flipping of master and slave windows, or for
'multiflip' flips, special care needs to be taken if the different
windows reside on different X-Screens. We need to explicitely enable
the OpenGL context of each window before scheduling the bufferswap,
later restore to our own master window.

At least the NVidia binary blob 295.4x needs this, otherwise it
will crash in glXSwapBuffers() when trying to swap a window that
resides on a different X-Screen than the one whose OpenGL context
is currently current on the calling thread.

So far the theory, let's see if it really works on the test machine.
Screen: Add new function PsychGetGPUSpecs() and use it.

The function retrieves low-level properties of the GPU attached
to a screen: majorType (kPsychRadeon, kPsychGeForce, kPsychIntelIGP
at the moment for AMD/ATI, NVIDIA or INTEL gpus), minorType to
discriminate different generations of hardware, e.g., the DCE display
engine id for AMD hw, the NV core family for NVidia hw, the GENeration
for Intel hw. PCI device Id, and number of CRTC's.

The function only succeeds with PsychtoolboxKernelDriver support on
OSX and MMIO support on Linux, it always fails on Windows. The function
just provides the properties stored in the OS specific screen glue for
each system.

Use the function in the PsychGraphicsHardwareHALSupport to prevent
execution of GPU specific code on the wrong hw. Ditto for PsychWindowSupport.

Currently this checks if the GPU is a AMD/ATI Radeon/FireXXX GPU with
DCE-1 (AVIVO) display engine. If it isn't, then functions for 10 bpc
framebuffer support, identity LUT configuration and swap completion
checks are disabled.

Test pending. Screen for 64-Bit Octave on Linux rebuilt.
Screen: Cosmetic - Turn warning about color clamping into info.

No reason to scare people for something that's entirely optional.

Screen for 64-Bit Octave on Linux rebuilt.