drm/msm: hdmi audio support

NOTE: hdmi_msm_audio_info_setup() and hdmi_msm_audio_sample_rate_reset()
are expected by the ALSA driver to be exported by the display driver.
It is pretty lame, but at the moment we are missing a better API.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drm/msm: add hang_debug module param

msm.hang_debug=y will dump out current register values if the gpu locks
up, for easier debugging.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drm/msm: spin helper

Helper macro to simplify places where we need to poll with timeout
waiting for gpu.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drm/msm: crank down gpu when inactive

Shut down the clks when the gpu has nothing to do.  A short inactivity
timer is used to provide a low pass filter for power transitions.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drm/msm: add chip-id param

Some of the w/a or different behavior of userspace blob driver seem to
be keyed to gpu patch revision, rather than gpu-id.  So expose the full
chip-id to userspace so it can DTRT.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drm/msm: use componentised device support

Signed-off-by: Rob Clark <robdclark@gmail.com>
drm/msm: validate flags, etc

After reading a nice article on LWN[1], I went back and double checked
my handling of invalid-input checking.  Turns out there were a couple
places I had missed.

Since the driver is fairly young, and the devices it supports are really
only just barely usable for basic stuff (serial console) with an
upstream kernel, I think we should fix this now and revert specific
parts of this patch later in the unlikely event that a regression is
reported.

[1] https://lwn.net/Articles/588444/

Signed-off-by: Rob Clark <robdclark@gmail.com>
add simple_dname()

From:

commit 118b23022512eb2f41ce42db70dc0568d00be4ba
Author:     Al Viro <viro@zeniv.linux.org.uk>
AuthorDate: Sat Aug 24 12:08:17 2013 -0400
Commit:     Al Viro <viro@zeniv.linux.org.uk>
CommitDate: Sat Aug 24 12:10:17 2013 -0400

    cope with potentially long ->d_dname() output for shmem/hugetlb

    dynamic_dname() is both too much and too little for those - the
    output may be well in excess of 64 bytes dynamic_dname() assumes
    to be enough (thanks to ashmem feeding really long names to
    shmem_file_setup()) and vsnprintf() is an overkill for those
    guys.

    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
take anon inode allocation to libfs.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Conflicts:
	fs/anon_inodes.c
	fs/libfs.c
drm backport from v3.5-rc1

Sync to commit:

commit c9eaa447e77efe77b7fa4c953bd62de8297fd6c5
Author:     Linus Torvalds <torvalds@linux-foundation.org>
AuthorDate: Sun Apr 13 14:18:35 2014 -0700
Commit:     Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Sun Apr 13 14:18:35 2014 -0700

    Linux 3.15-rc1
DOWNSTREAM: drm/msm: add glue for audio driver
DOWNSTREAM: drm/msm: use faster downstream iommu APIs

mapping/unmapping by range means less TLB invalidate overhead, which is
good for a few fps in xonotic, for example.
WIP: drm/msm: hacks to build for 8x74
DOWNSTREAM: drm/msm: register iommu domain

This API doesn't exist upstream.
WIP: drm/msm: add rd logging debugfs

To ease debugging, add debugfs file which can be cat/tail'd to log
submits, along with fence #.  If GPU hangs, you can look at 'gpu'
debugfs file to find last completed fence and current register state,
and compare with logged rd file to narrow down the DRAW_INDX which
triggered the GPU hang.

Conflicts:
	drivers/gpu/drm/msm/msm_gpu.c

Conflicts:
	drivers/gpu/drm/msm/Makefile
	drivers/gpu/drm/msm/msm_drv.h
WIP: drm/msm: add perf logging debugfs

Conflicts:
	drivers/gpu/drm/msm/Makefile
	drivers/gpu/drm/msm/adreno/a3xx_gpu.c
WIP: drm/msm: add trace points

Conflicts:
	drivers/gpu/drm/msm/msm_drv.c
	drivers/gpu/drm/msm/msm_gpu.c
WIP: perf/timechart: support for GPU

Show GPU as another "CPU" on the timeline, so we can see where it is
busy and idle.  Also show pending flips (green bar on the GPU), as well
as places where processes are blocked on a fence (yellow bar on the
process).

Currently a bit hacky.  And looking for drm/msm specific traces.  We
should probably make a set of generic traces that can be used by all drm
drivers, and use these trace events in perf.  (For other GPU's we
probably want a way to be able to visualize activity on multiple rings.)