drm/gma500: Make SGX MMU driver actually do something

Old MMU code never wrote PDs or PTEs to any registers. Now we do, and
that's a good start.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Add support for SGX interrupts

Add 2D blit status and MMU fault interrupts to the IRQ handler.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Give MMU code it's own header file

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Add first piece of blitter code

Right now, all we need to know about the blitter is that it's not doing
anything that can be messed up when fiddling with MMU mappings.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Hook up the MMU

Properly init the MMU and add MMU entries when adding GTT entries

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Always trap MMU page faults

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Remove unused ioctls

All of these ioctls are unused and most of them just duplicate what drm
already provides.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Add backing type and base align to psb_gem_create()

We'll need this for our gem create ioctl in a later patch.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Remove dead code

The gma500 driver sets DRIVER_GEM unconditionally, so testing for the
absence of the feature will always fail.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Move asle interrupt work into a work task

Previously the backlight code was called from IRQ context which isn't
allowed. This patch moves all the asle work into a work task which takes
care of the locking bug reported by users.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64221
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Unify _get_core_freq for cdv and psb

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Unify encoder mode fixup

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500/cdv: Cedarview display cleanups

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Code cleanup - removal of centralized exiting of function

Removed centralized exiting of function (goto statement), since it was
the only used in one single location with only a return statement.

Signed-off-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Code cleanup - style fixes

Code cleanup by following i915 constant/variable names and ordering
Code cleanup by following directions from kernel doc: Codingstyle
Code cleanup by following directions from kernel doc: DRM

Signed-off-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: Code cleanup - inline documentation

Improve readability by adding/changing inline documentation

Signed-off-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drm/gma500: remove stub .open/postclose

These are unused and can safely be dropped. DRM core verifies they're
non-NULL before it calls them.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>