MR2 Bringup on mr1_chocolate_rb1 line: Display Bring-up

Change-Id: I3d4202578f5b09d521926e246e6fe4dcf623a48f
Signed-off-by: Justin Philip <jphili@codeaurora.org>
msm: kgsl: add userspace memory alloc and free tracepoints

Add events for tracking memory operations by userspace
clients: kgsl_mem_alloc, kgsl_mem_map, kgsl_mem_free,
kgsl_mem_timestamp_queue (adding an entry to the free
on timestamp list) and kgsl_mem_timestamp_free (when
the memory is actually freed).

Conflicts:

	drivers/gpu/msm/kgsl_trace.h

Change-Id: Id62eec30ea20a0f00f7a7a791c7e5b8dfad487af
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: fix statistics for ion memory regions

The sysfs code was reading the wrong entry in the stats
array, so it printed the wrong value.

Change-Id: I26ce8bbca152a98e3dac53a9c154e52b020d5532
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: a2xx: Check the right interrupt status bits

Check the actual interrupt status bits in a2xx_irq_pending instead
of reading the mask registers which were always set and returning
true. Troutslap for the original author (me).

CRs-fixed: 467381

Conflicts:

	drivers/gpu/msm/adreno_a2xx.c

Change-Id: Ic0dedbada1c5fa64548221718c1eaf9b6eaaa1e8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm_fb: Update MDP fence wait behaviour

The current fence wait times out too early in cases where the GPU
is under a heavy workload. Change this behaviour to warn and wait
for a longer time for GPU to complete it's work.

Change-Id: I8b20c22733a77c1aaea4a1fd1e4daaa14b5ec2fd
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: vidc: Reset stop_called state when START is called

The driver needs to reset the stop_called field once START called.
Otherwise in START, STOP, START, STOP sequences the secondary STOP
will be treated as a duplicate STOP and ignored.

Change-Id: I7104ba6c4dbeda06704c46d836f9b7623fa36146
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: set EOS on output buffer pending transaction

If EOS is signalled while an output buffer is in transaction,
mark EOS when that buffer is returned.
This is observed in case client sends an empty buffer with EOS.

Change-Id: Id818988937cd103482b2e731b12b7f53960088b2
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
vidc: Fix EOS handling if video h/w has a frame in transaction

In case of video hardware is encoding a frame and EOS buffer with
with zero data length arrived, set the EOS flag to the transaction
available in the transaction table which will be passed to the
client in frame done callback from the video hardware.

Change-Id: Ia58b89b9957c3b270a773754fe203d92e238d99b
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: add support for the bitstream_restrict flag

Adds support for the MFC core to add the bitstream_restrict flag in the
sps/pps for H264 codecs.  This allows for the decoder to determine how
many frames to buffer when decoding.

Change-Id: I0415de0704d0f0d5099cc97ca7937c955e504883
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: kgsl: Properly record the size of the sglist in the memdesc

It was possible to fail out of kgsl_sharedmem_alloc after a sglist was
allocated but before we saved the size of the allocation which caused
problems when the sglist was freed during cleanup.

CRs-fixed: 464289
Change-Id: Ic0dedbadd57ec4d9422b5e3a873243d0ffed51f7
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Move events to context specific lists

Move the event accounting from a master list on the device to individual
context lists. This makes the management code more simple and reduces
the amount of extra cycles taken trying to walk a single largish list.
The new added code makes the event code slightly bigger than kgsl.c can
bear. As events become more commonplace this code will be more important
and it will be easier to maintain in a dedicated file so move all the event
related code into kgsl_events.c

Conflicts:

	drivers/gpu/msm/kgsl.c
	drivers/gpu/msm/kgsl.h
	drivers/gpu/msm/kgsl_device.h

Change-Id: Ic0dedbadf00b96eee53aea1d26acb195f1a916ce
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Add a new tracepoint for tracking timestamp events

Change-Id: Ic0dedbad81e77ff7391b642cb1c9254324c4c8c4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Send the correct timestamp to an expired event

Instead of sending the currently expired timestamp to expired
events, send the timestamp that the event expected. This avoids
confusion for events that don't compare the actual timestamp
to the one they expected.  Canceled events send the current
timestamp when they were canceled.

The kgsl_sync handler wasn't prepared for the second case so
add a check to prevent strange things from happening on the
timeline when a event is canceled.

Conflicts:

	drivers/gpu/msm/kgsl_events.c

Change-Id: Ic0dedbad3681db6222720884688dcddb9b06bda2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Decrease the device active count

Decrease the active count for the KGSL device and trigger the
suspend_gate completion if it hits zero

CRS-fixed: 449813

Conflicts:

	drivers/gpu/msm/adreno.c
	drivers/gpu/msm/kgsl_device.h
	drivers/gpu/msm/kgsl_events.c

Change-Id: Ic0dedbadfd2d40e4411cf3b05e1eb4c4eecf7841
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Remove duplicate code for checking timestamps

Event based as well as interruptible based timestamp checks
use the same code, they differ on if the mutex is held or not.
Separate the common code out to avoid confusion.

Conflicts:

	drivers/gpu/msm/adreno.c

Change-Id: Ie2ee01d7a07ff2ba7755ab8d327796345f9ca9ea
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Use the correct timestamp for the snapshot

The snapshot timestamp is currently based on wall time which makes
it very difficult to debug against a kernel log based on boot time.
It doesn't help matters that the snapshot timestamp is output in
human unfriendly hex.  Use boot time instead of wall time for the
snapshot value and print it out in decimal.

Change-Id: Ic0dedbadf9b7d799a3cb4d5917787bccd350c90a
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Add event tracepoints

Add tracepoints for tracking the lifespan of GPU events.

Conflicts:

	drivers/gpu/msm/kgsl_events.c

Change-Id: Ic0dedbadf99b1efcb650608c6ac664d3c4ddafd5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm_fb: HDMI: Correct order for BKSV read operation

During HDCP authentication, the BKSV read operation
should be issued after writing AKSV as per the HDCP
specification. This change fixes this issue.

Change-Id: If5de484fe19dd3e949107d5b0d72f9594ee2e76f
CRs-Fixed: 327845
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
msm_fb: hdmi: CEC Message queue flush

CEC message queue should be flushed when CEC
function is enabled. If there are residue CEC
message, they might cause collision at message
queue.

CRs-fixed: 338811
Change-Id: I6268528417d660fab48818ae67e94e169abbb217
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: hdmi: CEC re-transmission improvements.

Adding some improvements to HDMI CEC code flow to
reduce the risk of system crash and compliance
failure by proper CEC resiters settings and positions
in code flow.

CRs-fixed: 336541
Change-Id: I8fb3510190e5c4ff83b3785c51bade139f20692c
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>