[UPSTREAM] drm/i915/bdw: Implement Wa4x4STCOptimizationDisable:bdw

Not implementing this W/A can lead to hangs.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Rafael Barbalho <rafael.barbalho@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 5d708680eac2a8e2a0981007278a759df738d15b)

BUG=none
TEST=none
LINK=http://cgit.freedesktop.org/drm-intel/commit/?id=300e620f92df5c1cddd5b4b68193c1f483b487a6

Change-Id: I66cbce99eb1af40b3a852ccd394595a2a4c17bd6
Reviewed-on: https://chromium-review.googlesource.com/192516
Reviewed-by: Joe Konno <joe.konno@intel.com>
Reviewed-by: Ben Zhang <benzh@chromium.org>
Tested-by: Joe Konno <joe.konno@intel.com>
Reviewed-by: James Ausmus <james.ausmus@intel.com>
Commit-Queue: Joe Konno <joe.konno@intel.com>
[UPSTREAM] drm/i915: Add OACONTROL to the command parser register whitelist.

Mesa needs to be able to write OACONTROL in order to expose the
Observability Architecture's performance counters via OpenGL.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
[danvet: Add comment that this is just a temporary work-around and
that we need to check more things before we can allow OACONTROL writes
for real everywhere.]
[danvet 2: Squash in fixup to avoid a DRM_ERROR due to unsorted reg
list, spotted by Jani.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

(cherry picked from commit eb445b9ca132c80bb439a1ee7e0f74cb5e0ab597)

Conflicts:
	drivers/gpu/drm/i915/i915_cmd_parser.c
	drivers/gpu/drm/i915/i915_reg.h

BUG=none
TEST=none
LINK=http://cgit.freedesktop.org/drm-intel/commit/?id=86e73a120b689902aadd008f6fcdaf657bda3d78

Change-Id: Idf05810d277a74ef8369bd71f45ba79642814e80
Reviewed-on: https://chromium-review.googlesource.com/192517
Reviewed-by: Joe Konno <joe.konno@intel.com>
Reviewed-by: Ben Zhang <benzh@chromium.org>
Tested-by: Joe Konno <joe.konno@intel.com>
Reviewed-by: James Ausmus <james.ausmus@intel.com>
Commit-Queue: Joe Konno <joe.konno@intel.com>
DO NOT REBASE: drm/i915: Fix PSR programming

| has a higher precedence than ?. Therefore, the calculation doesn't do
at all what you would expect. Thanks to Ken for convincing me that this
was indeed the issue. Send me back to C programmer school, please.

I'm sort of surprised PSR was continuing to work for people. It should
be broken IMO (and it was broken for me, but I had assumed it never
worked).

Regression from:
commit ed8546ac1f99b850879f07b1e9b06b42fb0a36d9
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Mon Nov 4 22:45:05 2013 -0800

    drm/i915/bdw: Support eDP PSR

Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: Kenneth Graunke <kenneth.w.graunke@intel.com>
Cc: Art Runyan <arthur.j.runyan@intel.com>
Reported-by: "Kumar, Kiran S" <kiran.s.kumar@intel.com>
Cc: stable@vger.kernel.org [v3.13+]
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Included in 3.14-rc6

BUG=None
TEST=eDP PSR panel support with kernel cmdline 'i915.enable_psr=1'

Change-Id: I27109c5d615c7035c0d2778a9751e053f748f422
(cherry picked from commit 24bd9bf54d45d28089251cdf62bf14323d1aa827)
Reviewed-on: https://chromium-review.googlesource.com/194350
Reviewed-by: James Ausmus <james.ausmus@intel.com>
Reviewed-by: Ben Zhang <benzh@chromium.org>
Tested-by: Brian Wilson <brian.wilson@intel.com>
Commit-Queue: James Ausmus <james.ausmus@intel.com>