NVIDIA/Optimus

Laptops with NVIDIA graphics cards using NVIDIA Optimus can be configured to render scenes on the discrete NVIDIA GPU (Graphics Processing Unit) card using x11-drivers/nvidia-drivers and copy the rendered scenes to the Intel GPU using XRandR.

It is recommended to have an alternative boot method available such as bootable CD-ROM or DVD.

Kernel configuration
Consider setting:

DeviceDrivers -> Graphics Support -> Intel 8xx/9xx/Gex/G4x/HD Graphics -> Enable modetting on intel by default

xorg.conf configuration
http://us.download.nvidia.com/XFree86/Linux-x86_64/331.38/README/optimus.html http://us.download.nvidia.com/XFree86/Linux-x86_64/331.38/README/randr14.html

Using monitor EDID saved to a file
It is probably best to try a simple configuration first like described in the NVIDIA driver manual. Some laptops may benefit from saving the EDID screen information to a file so it can be passed to the NVIDIA and Intel modesetting drivers. The EDID information can be saved like:

emerge -v x11-misc/read-edid get-edid >edid.bin

Qingy
emerge -v sys-apps/qingy

for menu option (a) KDE-4
Add the xrandr commands to the end of the file:

/etc/X11/Sessions/KDE-4

for menu option (b) Your .xsession
Add the xrandr commands to the file:

~/.xsession

qingy directfb
In the directfb configuration file:

/etc/directfbrc

It is necessary to set the busid parameter to the busid of the Intel graphics card reported by:

lsusb

For example, if lsusb says the Inntel graphics card is on busid 00:02.0, then add the following line to /etc/directfbrc:

busid=0:02:0

CDM
emerge -v x11-misc/cdm

Add the xrandr commands to the file:

~/.xinitrc

KDM KDE
emerge -v kde-base/kdm

Add the xrandr commands to the file:

/usr/share/config/kdm/Xsetup

Other display managers
Any Display Manager that starts using X-Windows then asks the user to log in will result in a black screen unless a way can be found to run the necessary xrandr commands before asking the user to log in.