CHROMIUM: s5p-mfc: fix freeing buffers for encoder

Make REQBUFS(0) work in the encoder and don't leak private codec buffers
on alloc-free-realloc sequence.

This is a temporary fix for 3.4, not to be merged into newer kernels/upstream.

Signed-off-by: Pawel Osciak <posciak@chromium.org>

BUG=chromium:274454
TEST=veaunittest

Change-Id: Ia6a30b7289c3b8adc363ea642248bf3f0e7d4086
Reviewed-on: https://gerrit.chromium.org/gerrit/66089
Reviewed-by: John Sheu <sheu@chromium.org>
Commit-Queue: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
CHROMIUM: s5p-mfc: copy timestamp from src to dst

copy source buffer timestamp & timecode to destination
buffer during mfc encode.

BUG=chrome-os-partner:18019
TEST=build, run mfc encoder on CrOS snow

Signed-off-by: avnd kiran <avnd.kiran@samsung.com>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>

Change-Id: I3b7126f96ab761d2220cab4d020be1ecdf947b4b
Reviewed-on: https://gerrit.chromium.org/gerrit/65126
Tested-by: kiran <kiran@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: kiran <kiran@chromium.org>
UPSTREAM: perf/arm: Fix armpmu_map_hw_event()

Fix constraint check in armpmu_map_hw_event().

Reported-and-tested-by: Vince Weaver <vincent.weaver@maine.edu>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

BUG=chromium:275769
TEST=daisy build

Change-Id: I5a0a6920202aa4f13bb3a4daa0e5be8340feb22c
(cherry picked from commit b88a2595b6d8aedbd275c07dfa784657b4f757eb)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66212
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
CHROMIUM: drm/anx7808: Add an i2c adapter to 7808.

Adds an i2c adapter that can be used instead of the hardware DDC port.

BUG=chrome-os-partner:18395
TEST=With following changes, connect spring to external monitor.  Reboot every
40 seconds for 500 trials and see that the machine displays external video.
Previously, this would cause the dongle to become wedged about 1% of the time.

Change-Id: I222b972337033d6148f2b976dbaf15d7cef57c91
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65012
CHROMIUM: exynos: dts: Add HDMI DDC port.

On devices that include analogix 7808, use the DDC port provided by the driver
instead of the hardware DDC port.

BUG=chrome-os-partner:18395
TEST=With following change, see that the driver provided DDC port is used
instead of the hardware DDC port.

Change-Id: I5868521bad4d922ea859ff10d49dc25754eb2dd8
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65013
CHROMIUM: exynos: hdmi: Dereference ddc_node on use.

Order of initialization of exynos_hdmi and ddc is not currently guaranteed.
This patch allows the DDC channel to be used even if it happens to be
initialized after hdmi.

This patch should be dropped when HDMI driver initialization is guaranteed to
happen after DDC channel on which it depends.

BUG=chrome-os-partner:18395
TEST=Use external HDMI port on spring and observe that it still works.

Change-Id: Iecbe80fa1a37fd83b2c31eac3c0b7e5284b8c033
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65014
CHROMIUM: exynos: hdmi: Use generalized hdmi DDC port.

Use hdmi_ddc instead of exynos_ddc.

BUG=chrome-os-partner:18395
TEST=On spring, see that the driver provided DDC port is used instead of the
hardware DDC port.

Change-Id: I4e7c2e7fea51e13601ec7102080c2488664b42f8
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65015
CHROMIUM: Event log support in the chromeos_arm platform driver.

An in memory buffer is set up covering a range of addresses specified in the
device tree, and when a panic happens, an event log event is generated and
stored in that buffer. When the system reboots as a result of the panic, the
firmware discovers the event and records it in the event log in flash.

I've also added a remove function which may or may not be desirable.

BUG=chrome-os-partner:16132
TEST=Built and booted on spring, triggered a panic using /proc/sysrq-trigger,
and after the reboot, used mosys eventlog to verify that a panic event had
been recorded.

Change-Id: I4494ed733f618262b03ef2c81b6485590c9d2bb4
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/55644
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
CHROMIUM: drm/anx7808: Initialize HDMI status earlier.

It appears that setting HDMI_MODE register bit at output configuration time
sometimes causes audio not to work, through a mechanism that is not clear.
Once downstream hotplug is detected, it is safe to st this register, so let's
do it right after bridge input signal is detected.

BUG=chrome-os-partner:21784
TEST=With external monitor (COBY LEDTV3216) connected through HDMI dongle, plug
in the dongle to the HDMI port.  Play a video with sound and hear sound from
the monitor.

Test 2: With board attached to HDMI dongle and Quantum 980 analyzer, do a
capture, and see that infoframes are transmitted, regardless of whether dongle
or downstream HDMI is plugged in first.

Change-Id: I3080a14cd3aa0cb8c02b182208dcf6b678e3276a
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66530
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
CHROMIUM: Configure Spring GPIOs powerdown-settings for suspend.

BUG=chrome-os-partner:22133
TEST=manual,

Test S2R cycles.  Make sure functionality with changes to GPIO
powerdown-setting still function correctly.

Measured power is identical in S3.

Change-Id: Id7e447e38efa58c1cd973807ac6ec958b038b0d3
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66690
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Tested-by: Bryan Freed <bfreed@chromium.org>
CHROMIUM: bluetooth: Add support for WB222 [0cf3:e003]

BUG=chrome-os-partner:22121
TEST=manual: hciconfig to show device, hcitool scan to look for remote

Change-Id: I7208d7bf352a6e855543f8462ede9e12071d2a94
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66870
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
drm/exynos: Add trace_exynos_page_flip_state event

trace: Add an event to show more detail of
frame buffer when GPU is rendering. This
allows chrome://tracing to trace the states
that a frame buffer passes through while
being flipped on particular crtc.
The state transition is shown as follows:
wait_kds -> wait_apply -> wait_flip -> flipped

Signed-off-by: Chen-tai Kao <kao@chromium.org>

BUG=chromium:264087
TEST=set event (exynos_page_flip_state), then start ftrace
 # At Chrome OS login screen,
 # start cursor blinking in login box,
 # then access shell by Ctrl-Atl-F2.
 # login with root
 cd /sys/kernel/debug/tracing
 echo exynos_page_flip_state > set_event
 echo 1 > tracing_enabled
 echo 1 > tracing_on
 grep exynos_page_flip_state trace
 Should see something like:
  xxx [000] .... 6.000001: exynos_page_flip_state: pipe=0, fb=26, state=wait_kds
  xxx [000] .... 6.000002: exynos_page_flip_state: pipe=0, fb=26, state=wait_apply
  xxx [000] .... 6.000003: exynos_page_flip_state: pipe=0, fb=25, state=wait_kds
  xxx [000] .... 6.000004: exynos_page_flip_state: pipe=0, fb=26, state=wait_flip
  xxx [000] .... 6.000005: exynos_page_flip_state: pipe=0, fb=25, state=wait_apply
  xxx [000] .... 6.000006: exynos_page_flip_state: pipe=0, fb=25, state=wait_flip
  xxx [000] .... 6.000007: exynos_page_flip_state: pipe=0, fb=26, state=flipped
  xxx [000] .... 6.000008: exynos_page_flip_state: pipe=0, fb=25, state=flipped

Change-Id: I88529517805f851364f9e7400b33420325b062b0
Reviewed-on: https://gerrit.chromium.org/gerrit/65294
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: kao <kao@chromium.org>
Tested-by: kao <kao@chromium.org>
Merge branch 'chromeos-3.4' of https://git.chromium.org/git/chromiumos/third_party/kernel into chromeos-3.4
Revert "CHROMIUM: mmc: card: add a quirk for Kingston eMMC"

This reverts commit 1865052d4041d818fb245be254aba2803f786cd3.
Revert "Revert "CHROMIUM: mmc: card: add a quirk for Kingston eMMC""

This reverts commit c8be8636121e38220d132ce765a7b85874da5cdb.