staging: drm/omap: get supported color formats from ovl

Get the supported formats for a plane from ovl's supported_modes
bitmask.

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: add a workqueue

Add a workqueue for omapdrm driver, which is needed for at least a
couple things currently: (1) moving omap_gem_roll() to a non-atomic
context, (2) synchronizing page flips w/ DSS scanout related irq's
(in particular not unmapping previous buffer until DSS finishes
scanout).

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: call omap_gem_roll() in non-atomic ctx

If fbcon calls us from atomic context, push the work off to the
workqueue to avoid calling into the gem/dmm code in an atomic
context.

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: some minor fb cleanups

Now that 'struct drm_plane' has a pixel_format field, use that.  And
fix a minor typo.

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: defer unpin until scanout completes

When flipping, defer unpinning until scanout completes, as indicated
by the appropriate END_WIN irq.

This also re-organizes things a bit, in replacing omap_fb_{pin,unpin}
with omap_fb_replace(), to make it easier to add support for scanout
synchronized DMM refill mode (flipping by just reprogramming DMM
synchronized with DSS scanout).

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: debugfs for object and fb tracking

Add some additional debugfs file to aid in tracking buffer usage.

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: Disable DMM debugfs for OMAP3

OMAP3 does not contain a DMM/Tiler block.  As such, we should not
be exposing any DMM debugfs entries on OMAP3 platforms.

Added inline helper function to verify existence of DMM.

Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: Validate debugfs device

Added check for valid device information before dumping debugfs
information.

Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: Get DMM resources from hwmod

This patch splits the DMM off into a separate sub-device, in order to
utilize the platform device information that was created as part of
the OMAP hwmod entry for the DMM.

The driver probe function queries the iomem resource and IRQ using
standard platform_get functions.

The OMAP DRM driver now calls the platform_driver_register() function
for the subordinate DMM driver inside its probe function.  This
guarantees the required order for the DMM and ensures the DMM resources
are available for use by the DRM driver.

Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: mmap of tiled buffers with stride >4kb

Deal with the case of buffers with virtual stride larger than one
page in fault_2d().

Signed-off-by: Rob Clark <rob@ti.com>
drm: cope with platformdev->id == -1

If there are not multiple instances of a platform device, the id
should apparently be set to -1.  Which results in a odd looking
bus-id like "platform:foodrm:-1".  Probably we should just treat
this case as id 0.

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: avoid multiple planes having same z-order

Multiple video pipes on same output with same z-order is an undefined
behavior.  Set a unique z-order value based on overlay number/id.

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: send page-flip event after endwin

The endwin irq indicates that DSS has finished scanning out a buffer.
Use this to trigger page-flip event to userspace, so this happens
only *after* the previous buffer is finished.

Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: use current time for page-flip event

Because we don't have vblank hooked up via drm_irq (which is a bit
awkward due to separation between omapdss (which knows the irq #)
and omapdrm, for now use gettimeofday to have a semi-sane timestamp
in the page-flip event.  Otherwise apps like weston drm compositor,
which use the timestamp in it's animations, get highly confused.

Signed-off-by: Rob Clark <rob@ti.com>
omap2+: add drm device

Register OMAP DRM/KMS platform device, and reserve a CMA region for
the device to use for buffer allocation.  DMM is split into a
separate device using hwmod.

Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob@ti.com>
staging: drm/omap: platform data structs moved to plat-omap

Platform data structs populated when the platform device is registered
need to be #include'able under arch/arm/..., but having to #include
headers from drivers/staging is messy.  Instead these structs are
moved to arch/arm/plat-omap/include/plat.

Signed-off-by: Rob Clark <rob@ti.com>
staging: omap/drm: dmm should return proper errors

Minor error path clean-up.

Signed-off-by: Rob Clark <rob@ti.com>
WIP: tiler/2d support for DSS