crypto: LLVMLinux: Add macro to remove use of VLAIS in crypto code

Add a macro which replaces the use of a Variable Length Array In Struct (VLAIS)
with a C99 compliant equivalent. This macro instead allocates the appropriate
amount of memory using an char array.

The new code can be compiled with both gcc and clang.

struct shash_desc contains a flexible array member member ctx declared with
CRYPTO_MINALIGN_ATTR, so sizeof(struct shash_desc) aligns the beginning
of the array declared after struct shash_desc with long long.

No trailing padding is required because it is not a struct type that can
be used in an array.

The CRYPTO_MINALIGN_ATTR is required so that desc is aligned with long long
as would be the case for a struct containing a member with
CRYPTO_MINALIGN_ATTR.

If you want to get to the ctx at the end of the shash_desc as before you can do
so using shash_desc_ctx(shash)

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Michał Mirosław <mirqus@gmail.com>
crypto: LLVMLinux: Remove VLAIS from crypto/mv_cesa.c

Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
compliant equivalent. This patch allocates the appropriate amount of memory
using a char array using the SHASH_DESC_ON_STACK macro.

The new code can be compiled with both gcc and clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto: LLVMLinux: Remove VLAIS from crypto/n2_core.c

Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
compliant equivalent. This patch allocates the appropriate amount of memory
using a char array using the SHASH_DESC_ON_STACK macro.

The new code can be compiled with both gcc and clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto: LLVMLinux: Remove VLAIS from crypto/omap_sham.c

Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
compliant equivalent. This patch allocates the appropriate amount of memory
using a char array using the SHASH_DESC_ON_STACK macro.

The new code can be compiled with both gcc and clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto: LLVMLinux: Remove VLAIS usage from crypto/hmac.c

Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
compliant equivalent. This patch allocates the appropriate amount of memory
using a char array using the SHASH_DESC_ON_STACK macro.

The new code can be compiled with both gcc and clang.

Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: pageexec@freemail.hu
crypto: LLVMLinux: Remove VLAIS usage from libcrc32c.c

Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
compliant equivalent. This patch allocates the appropriate amount of memory
using a char array using the SHASH_DESC_ON_STACK macro.

The new code can be compiled with both gcc and clang.

Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: pageexec@freemail.hu
Cc: "David S. Miller" <davem@davemloft.net>
msm: mdss: update watermark level programming for macrotile formats

Fetch and store logic for macrotile format is different than linear
format. Update watermark level programming to accommodate these
differences

Change-Id: Id0810bd1e56f9fca00de94f933c9e2db6dead83c
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: reduce mdp bandwidth for single pipe use case

For single layer use case, mdp prefill bandwidth request can be
reduced because mdp pipe operates like a fifo and there is no need to
fill all buffers before the active region.

Change-Id: Ic087f394b2551658543cff7f99789eace0388e07
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: add bandwidth check per pipe

Add check to verify that the bandwidth of a pipe does not exceed
the threshold per pipe. The check happens during the overlay setup
and if the pipe exceed the limit, the driver will try to decimate to
reduce the bandwidth; but even if after decimation the limit is
exceeded, it will fail the configuration.

Change-Id: I7ad3654126a503e41540fca250276d564aecccdd
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: remove additional vert decimation when per pipe BW exceeds

Currently if per pipe BW exceeds pre-defined limit, we add additional
vertical decimation to reduce BW. But this has inverse effect on quality.
To mitigate this issue, decimate further only if user has already
requested decimation else return an appropriate error which user can
detect and act upon it.

CRs-Fixed: 637971
Change-Id: I1c3b913036b7a1680d6c99b03d42f1204f71f89f
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: mdss: Tune watermark and prefill BW based on minimum SMP bytes

Modify watermark levels and prefill BW calculation
to be set based on the minimum prefill buffer bytes from
the SMP. Add debugfs property to dynamically tune the minimum
bytes for debugging

Change-Id: I3af1e3468eaab56d3a8eea5fe456d7af547d3244
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:
	drivers/video/msm/mdss/mdss_debug.c
msm: mdss: Fix potential stack corruption issue

Fix potential stack corruption issue which is possible
due to different datatype for arguments used in callee
and caller function.

Change-Id: I564f62af7574c8eaa3ac8f55de0f0732223cae42
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>