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

Qingy KDE
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

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.