drm: add the base source of the Poulsbo (psb) 2D X11 driver

The complete source of the base (unpatched) psb-kernel-source Poky
package, moved into the kernel tree so it can be build as a
first-class citizen instead of as an external module.  Subsequent
patches will remove the unnecessary parts.

The code here is all the code contained in this tarball:

https://launchpad.net/~gma500/+archive/ppa/+files/
	psb-kernel-source_4.42.0-0ubuntu2~1010um5.tar.gz

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: remove the package Makefile and replace it with the kernel Makefile

The default Makefile is meant for building the modules externally.
Replace it with the normal kernel Makefile (Makefile.kernel).

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm: apply psb-kernel-source package's build.patch

Build mods required for compilation.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm: intel_ldvs.c: add missing arg to backlight_device_register() call

backlight_device_register() added a backlight_props param - give it
another arg to keep it happy.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
emenlow: switch to psb

Use drm-psb instead of drm for emenlow.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm: Fix psb ioctl assignment

Replace drm_ioctl with drm_unlocked_ioctl.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: remove BKL remnants

replace lock/unlock_kernel with the drm_global_mutex from 3.0.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: update spinlock initializers

Update SPIN_LOCK_UNLOCKED users to __ form.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: remove call to agp_flush_chipset

agp_flush_chipset was removed because intel drm calls the chipset
functions directly, and psb doesn't implement a chipset_flush()
function anyway.  Leave drm_agp_flush_chipset exported for modules
that might be expecting it to be there though.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: remove includes of nonexistent i2c-id.h

i2c-id.h is gone, don't include it.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: remove assigment to deprecated i2c_adapter.id

i2c_adapter.id has been removed and it's not used by anything, so
remove it.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: use console_lock/unlock()

The acquire/release_console_sem() functions were renamed to
console_lock/unlock(), so change the calls.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: add DRM_UNLOCKED flag

Add DRM_UNLOCKED to allow us to call handlers that do their own
locking without the global lock.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: mark unlocked ioctls

Mark the ioctls that already do their own locking DRM_UNLOCKED.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: initialize backlight type

If unset, props.type gets the value 0, which is no longer maps to a
valid type value, so initialize it explicitly.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: fix ioremap calls

Mapping the opregion non-cacheable fails, so use acpi_os_ioremap
instead.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
drm-psb: change udelay to mdelay in intel_wait_for_vblank()

This fixes the compile error>

ERROR: "__bad_udelay" [drivers/gpu/drm-psb/psb.ko] undefined!

This is the same fix as in gma500:

  commit 243dd2809a5edd2e0e3e62781083aa44049af37d
  Author: Stephen Rothwell <sfr@canb.auug.org.au>
  Date:   Mon Jul 25 15:18:44 2011 +1000

    gma500: udelay(20000) it too long again

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
bsp/emenlow: initialize lvds backlight only if lvds enabled

intel_lvds_init() initializes the lvds backlight even if the lvds init
failed.  That doesn't make sense, and causes unnecessary error
messages in the kernel log.

Put the backlight init code into a separat function and only call it
if the lvds panel was successfully initialized.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
bsp/emenlow: give up drm_global_mutex on contention in drm_lock()

If drm_lock_take() fails, give up the global ioctl mutex and allow
other locked ioctls in the meantime.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>