arm: Use vblank_disable_and_save in drm_vblank_cleanup()

Calling vblank_disable_fn() will cause that function to no-op
if !dev->vblank_disable_allowed for some kms drivers, e.g.,
on nouveau-kms. This can cause the gpu vblank irq's to not get
disabled before freeing the dev->vblank array, so if a
vblank irq fires and calls into drm_handle_vblank() after
drm_vblank_cleanup() completes, it will cause use-after-free
access to dev->vblank array.

Call vblank_disable_and_save unconditionally, so vblank irqs
are guaranteed to be off, before we delete the data structures
on which they operate.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Merge remote-tracking branch 'origin/drm-intel-fixes' into drm-intel-nightly

Conflicts:
	drivers/gpu/drm/i915/i915_drv.c
Merge remote-tracking branch 'drm-upstream/drm-fixes' into drm-intel-nightly
Merge remote-tracking branch 'origin/topic/core-stuff' into drm-intel-nightly
Merge remote-tracking branch 'origin/topic/vblank-rework' into drm-intel-nightly

Conflicts:
	drivers/gpu/drm/drm_irq.c
drm-intel-nightly: 2014y-08m-21d-10h-03m-09s integration manifest
perf: export perf_event_overflow

To support pmu drivers in loadable modules, such as the i915 driver

Signed-off-by: Robert Bragg <robert@sixbynine.org>
perf: Add PERF_PMU_CAP_IS_DEVICE flag

The PERF_PMU_CAP_IS_DEVICE flag provides pmu drivers a way to declare
that they only monitor device specific metrics and since they don't
monitor any cpu metrics then perf should bypass any cpu centric security
checks, as well as disallow cpu centric attributes.

Signed-off-by: Robert Bragg <robert@sixbynine.org>
i915: Expose PMU for Observation Architecture

Gen graphics hardware can be set up to periodically write snapshots of
performance counters into a circular buffer and this patch exposes that
capability to userspace via the perf interface.

This introduces a new PERF_PMU_CAP_IS_DEVICE flag that allows us to
convey to events/core that our pmu does not relate to the cpu. This in
turn lets us bypass the perf_paraniod_cpu() || CAP_SYS_ADMIN check when
opening an event associated with a specific cpu id but no specific pid.
In our case that doesn't imply we will expose anything about the
different processes that may run on that cpu. This driver builds on the
drm driver's authentication scheme to determine if a process has
permission to collect metrics for a specific gpu context.  Only root can
collect metrics across all gpu contexts.

Only Haswell is supported currently.

Signed-off-by: Robert Bragg <robert@sixbynine.org>