gpu: ion: Request highmem pages for IOMMU heap

When allocating pages for IOMMU heap it is advantageous
to try to allocate pages from highmem in addition to
lowmem since clients using the IOMMU heap can use
either highmem or lowmem.

CRs-fixed: 430457
Change-Id: Ifc794fc344c67dd53d8f7cebf86536ab9d44ed6c
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit 193fef0514189aa398d704398a783a595d1d7138)
msm: kgsl: Don't wake up gpu on kgsl_ioctl calls if not necessary

This is Iee3db5401bdad1808a09d104e0daecfc3716cbb4 change ported
manually from the msm-3.4/msm-3.7 branch to the jb_2.5 branch.

The current code wakes up gpu on all kgsl_ioctl() calls that need
to hold device->mutex. However there are some kgsl_ioctl() calls that
don't need that. That fix introduces a bit of info to mark such
functions, and don't wake up gpu calling them to save some power.

Change-Id: I86224d2405c42e3803c7e361c02fe1d02d4cdff1
CRs-Fixed: 438932
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
Update copyright to The Linux Foundation

Change-Id: I849ec885832aba72f3e1c4241525a8c113fe3c75
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
Merge "gpu: ion: Request highmem pages for IOMMU heap"
msm: display: panel frame rate report

Add metadata ioctl for retrieving panel frame rate.
Get ready to remove reserved fields usage.

Change-Id: I51a4aed9d85efd5f83a184100b6a3dc682c7a67c
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Merge "msm: display: panel frame rate report"
msm: display: release fence when all pipes are unset

When all pipes are unset(or only boarder fill pipe is left),
fence can be released as mdp doesn't use the buffer any more.

Change-Id: Iede361e13b4ea79956375644585a927e6cb8e8d6
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
(cherry picked from commit f77ba6e24c14c613071530ddb786c13dc0d2105d)
msm : mdp: Move wfd state signalling into mdp driver .

Previously the WFD driver was reponsible for signalling the
online/offline events to userspace listeners.  This led to redundant
notifications due to the manner in which the WFD driver is used. The
signalling is better purposed when done from MDP driver.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

Conflicts:

	include/linux/msm_mdp.h

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit 30b1a99ad6f82b45b71feb3cdb06b831d39ad285)

Change-Id: Ic041c69b626902d48e35a12e69232265961c0bef
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm_fb: writeback panel commit should not happen when buffer is NULL.

The change handles the NULL buffer case for writeback panel.
It avoids the H/W commit when buffer is NULL and also adds it to
free queue.

CRs-Fixed: 448340
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_writeback.c

Change-Id: I2c6b3e8ac05151a1616fa5a05410e2922fc8c9e4
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Merge "msm: display: release fence when all pipes are unset"
Merge "msm : mdp: Move wfd state signalling into mdp driver ."
Merge "msm_fb: writeback panel commit should not happen when buffer is NULL."
Merge "msm: kgsl: Don't wake up gpu on kgsl_ioctl calls if not necessary"
msm: acpuclock-8064: Lower max L2 speed to 1134MHz

There are some testing showing that L2 at 1188MHz may cause
some stability issue. Therefore, lower the max speed to 1134Mhz.

Change-Id: Iaf57a916ce49e7c31708285e5568690b344ef1e5
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
Merge "msm: acpuclock-8064: Lower max L2 speed to 1134MHz"
msm: kgsl: Avoid NULL pointer in adreno setstate functions

Make sure the specified context_id returns a valid context
in adreno_gpummu_setstate and adreno_iommu_setstate and
silently return if it doesn't.

CRs-Fixed: 439367
Change-Id: Ic0dedbad1a91b53f19782b50380bd36842614351
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit 060d7a34db6f9c5e35655cef8c0f936533215bee)
msm: kgsl: Change GPU Fast Hang detection to 50ms

Fast hang detection algorithm is improved to use additional
performance counters to monitor shader processor activity.
Shader processor's active alu cycles, icl0 misses
and fs cflow instructions are added to list of activities
monitored for fast hang detection.

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
(cherry picked from commit d2063cb34c451eb8ccb5debd252229842ac54027)

Conflicts:

	drivers/gpu/msm/a3xx_reg.h
	drivers/gpu/msm/adreno_a3xx.c

Change-Id: I538f06a178f2829c1b4663b4b929c45ab570ae18
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: kgsl: Ensure context pointer exists before dereferencing

When trying to add commands to the ringbuffer command stream, ensure
that the context point is not NULL before dereferencing it.

Change-Id: I6d8217ed4b180454eb43f2db161c10e86bc207da
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
(cherry picked from commit dc2ebb1ea0271c4ec1a83a991d94d7ae908daea3)
msm: kgsl: Fix guilty context logic for GPU hangs

Always mark GPU contexts that have cause a GPU hang as guilty.
If the GPU context recovered successfully, still mark it as guilty.
This will inform applications that something might have
gone wrong and to take actions to ensure everything is correct.

Also, swap out any active context following a hang.  This will
ensure that any new submissions will force the context to be restored
before it is used.

CRs-fixed: 427603
CRs-fixed: 405434
Change-Id: I6b7cf2b2a680a4691f45535a147ca678a4d961f3
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
(cherry picked from commit ebf8c2d6bb79acaae1545c2860bbdfbd0604b80f)
msm: kgsl: Cleanup memdesc flags

We had a ugly mix of flags from usersapce mixed in with internal flags
and the flags were stored in priv and the internal flags were stored
in flags and general confusion all around.

So, external (user) flags moved to memdesc->flags, internal bits moved
to ->priv and now we are ready to handle the full onslaught of user
specified flags.

Change-Id: Ic0dedbad2236ae353b31e5dcaa6ff551713abaf1
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
(cherry picked from commit 1b15b30c8df99833c6930c581d9b83ed0d1f24a9)