Commit Graph

649669 Commits

Author SHA1 Message Date
Stefan Agner
3ba78bf174 kbuild: allow to use GCC toolchain not in Clang search path
(commit ef8c4ed9db upstream)

When using a GCC cross toolchain which is not in a compiled in
Clang search path, Clang reverts to the system assembler and
linker. This leads to assembler or linker errors, depending on
which tool is first used for a given architecture.

It seems that Clang is not searching $PATH for a matching
assembler or linker.

Make sure that Clang picks up the correct assembler or linker by
passing the cross compilers bin directory as search path.

This allows to use Clang provided by distributions with GCC
toolchains not in /usr/bin.

Link: https://github.com/ClangBuiltLinux/linux/issues/78
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-and-tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[ND: adjusted to context, due to adjusting the context of my previous
backport of upstream's ae6b289a37]
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:20:07 +09:00
Stephen Rothwell
3bb1c653db disable stringop truncation warnings for now
commit 217c3e0196 upstream.

They are too noisy

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:20:05 +09:00
Chris Fries
b2182a9f0d kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
(commit ae6b289a37 upstream)

Set the clang KBUILD_CFLAGS up before including arch/ Makefiles,
so that ld-options (etc.) can work correctly.

This fixes errors with clang such as ld-options trying to CC
against your host architecture, but LD trying to link against
your target architecture.

Signed-off-by: Chris Fries <cfries@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[ND: adjusted context due to upstream having removed code above where I
placed this block in this backport]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:20:02 +09:00
Arnd Bergmann
3e4ab3c600 Kbuild: use -fshort-wchar globally
commit 8c97023cf0 upstream.

Commit 971a69db7d ("Xen: don't warn about 2-byte wchar_t in efi")
added the --no-wchar-size-warning to the Makefile to avoid this
harmless warning:

arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

Changing kbuild to use thin archives instead of recursive linking
unfortunately brings the same warning back during the final link.

The kernel does not use wchar_t string literals at this point, and
xen does not use wchar_t at all (only efi_char16_t), so the flag
has no effect, but as pointed out by Jan Beulich, adding a wchar_t
string literal would be bad here.

Since wchar_t is always defined as u16, independent of the toolchain
default, always passing -fshort-wchar is correct and lets us
remove the Xen specific hack along with fixing the warning.

Link: https://patchwork.kernel.org/patch/9275217/
Fixes: 971a69db7d ("Xen: don't warn about 2-byte wchar_t in efi")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:19:59 +09:00
Andrey Konovalov
b58850e1d4 kasan: don't emit builtin calls when sanitization is off
commit 0e410e158e upstream.

With KASAN enabled the kernel has two different memset() functions, one
with KASAN checks (memset) and one without (__memset).  KASAN uses some
macro tricks to use the proper version where required.  For example
memset() calls in mm/slub.c are without KASAN checks, since they operate
on poisoned slab object metadata.

The issue is that clang emits memset() calls even when there is no
memset() in the source code.  They get linked with improper memset()
implementation and the kernel fails to boot due to a huge amount of KASAN
reports during early boot stages.

The solution is to add -fno-builtin flag for files with KASAN_SANITIZE :=
n marker.

Link: http://lkml.kernel.org/r/8ffecfffe04088c52c42b92739c2bd8a0bcb3f5e.1516384594.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ Sami: Backported to 4.9 avoiding c5caf21ab0 and e7c52b84fb ]
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:19:56 +09:00
secuflag
0ac3eff30b Remove pre-commit patch check 2023-05-12 16:19:53 +09:00
Chris Fries
9a53390dab kernel: Add CC_WERROR config to turn warnings into errors
Add configuration option CONFIG_CC_WERROR to prevent warnings
from creeping in.

Signed-off-by: Chris Fries <cfries@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Change-Id: I323b5c3ddee31278da0e6d18b278a2c1327ebd04
2023-05-12 16:19:37 +09:00
Linus Torvalds
088db916ce gcc-9: silence 'address-of-packed-member' warning
commit 6f303d6053 upstream.

We already did this for clang, but now gcc has that warning too.  Yes,
yes, the address may be unaligned.  And that's kind of the point.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:19:03 +09:00
Arnd Bergmann
e96126182f turn off -Wattribute-alias
Starting with gcc-8.1, we get a warning about all system call definitions,
which use an alias between functions with incompatible prototypes, e.g.:

In file included from ../mm/process_vm_access.c:19:
../include/linux/syscalls.h:211:18: warning: 'sys_process_vm_readv' alias between functions of incompatible types 'long int(pid_t,  const struct iovec *, long unsigned int,  const struct iovec *, long unsigned int,  long unsigned int)' {aka 'long int(int,  const struct iovec *, long unsigned int,  const struct iovec *, long unsigned int,  long unsigned int)'} and 'long int(long int,  long int,  long int,  long int,  long int,  long int)' [-Wattribute-alias]
  asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
                  ^~~
../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
  __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
  ^~~~~~~~~~~~~~~~~
../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
 #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
                                    ^~~~~~~~~~~~~~~
../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
 SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,
 ^~~~~~~~~~~~~~~
../include/linux/syscalls.h:215:18: note: aliased declaration here
  asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
                  ^~~
../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
  __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
  ^~~~~~~~~~~~~~~~~
../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
 #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
                                    ^~~~~~~~~~~~~~~
../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
 SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,

This is really noisy and does not indicate a real problem. In the latest
mainline kernel, this was addressed by commit bee2003177 ("disable
-Wattribute-alias warning for SYSCALL_DEFINEx()"), which seems too invasive
to backport.

This takes a much simpler approach and just disables the warning across the
kernel.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:17:26 +09:00
Chris
eee54bb0b9 Revert "cec: cec a bus busy cause system hold [1/1]"
This reverts commit e5617679de.

Change-Id: I23415ecad6254a65ddcf92b171fbce15ca0fac8c
2023-05-09 08:59:38 +09:00
Luke go
a78b44698b ODROID-C4: configs: Reenabled keyboard gpio polled.
Change-Id: I9c91cc912012b47280d0f631820c725653e83540
Signed-off-by: Luke go <sangch.go@gmail.com>
2023-05-02 12:02:10 +09:00
chunlong.cao
87e7c07df2 [display]amvecm: aml_vecm_init Initialization bug [1/1]
PD#OTT-10492

Problem:
    function of aml_vecm_init Initialization bug.

Solution:
    Add support for G12B chips

Verify:
   on W400

Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: I8398676a99d0957daf1fbc4fbb207d1c39e2e320
2023-04-27 09:33:37 +09:00
chunlong.cao
fe96d66ae6 device: [BDS][S905D3]change device u202 to yeker P102-tablet project.[4/5]
PD#SWPL-34159

Problem:
     need support  yeker P102-tablet project

Solution:
    change dts to arm64

Verify:
    U202

Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-24 13:59:54 +09:00
junlan.duan
e85d5e5b1f kernel: add Android P 64bit support
PD#SH-8250

Problem:
vendor partition size is low

Solution:
add vendor partition size

Verify:
p1

Signed-off-by: junlan.duan <junlan.duan@amlogic.com>
Change-Id: If9b43379355dec22bc11d5cb4f40b82e632927af
2023-04-21 13:52:38 +09:00
Pengcheng Chen
e21136bd5e osd: fix reboot quiescent caused screen blank issue [1/1]
PD#SWPL-17605

Problem:
in reboot quiescent, suspend & resume caused afbc_cfg
reg set err

Solution:
in resume, reset afbc_start to 0

Verify:
franklin

Change-Id: I6e019ee88a3cfeb5d39db4777a7c2ac6c9648b02
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2023-04-21 13:52:38 +09:00
yao liu
1473adce54 vpp code style modify [1/1]
PD#SWPL-59491

Problem:
vpp code style modify

Solution:
vpp code style modify

Verify:
sm1

Signed-off-by: yao liu <yao.liu@amlogic.com>
Change-Id: I0ff44f15d441413a70366d86cabaee69a73587f7
2023-04-21 13:52:38 +09:00
yuhua.lin
5e9e5f621b ge2d: ge2d strechblit consumes too much time [1/1]
PD#SWPL-60558

Problem:
ge2d strechblit consumes too much time

Solution:
move cache sync in lib

Verify:
w400

Change-Id: I76d14e67dca6bd2fa05a7d3900c011367bf21884
Signed-off-by: yuhua.lin <yuhua.lin@amlogic.com>
2023-04-21 13:52:38 +09:00
chunlong.cao
6470ba59ea audio: add kcontrol of pdm hareware gain [1/1]
PD#SWPL-58839

Problem:
Pdm mic level is low. The noise level gets worse
when add software gain.

Solution:
1) remove software gain
2) add kcontrol of pdm hw gain, this gain range is 0-24dB.
   0.5dB/step.
3) if user uses pdm mic of loopback,
   add "mic-src = <&pdm>;" in dts.

Verify:
u202

Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: Ifd0f9dfd6d2077b323f3d54f98bb648c725ddb91
2023-04-21 13:52:37 +09:00
chunlong.cao
710cb430f8 audio: add kcontrol of pdm hareware gain [1/1]
PD#SWPL-44152

Problem:
Pdm mic level is low. The noise level gets worse
when add software gain.

Solution:
1) remove software gain
2) add kcontrol of pdm hw gain, this gain range is 0-24dB.
   0.5dB/step.
3) if user uses pdm mic of loopback,
   add "mic-src = <&pdm>;" in dts.

Verify:
T5

Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: Icd0915cc63f5dd302979e741354baf62d04d6daa
2023-04-21 13:52:37 +09:00
chunlong.cao
d93a456063 Revert "lcd: fix lcd_extern device probe mistake [1/1]"
This reverts commit 5802fddc1a48cc97aab51d7e394f80b7fd0ea02f.
2023-04-21 13:52:37 +09:00
Evoke Zhang
9aba57f769 lcd: fix lcd_extern device probe mistake [1/1]
PD#SWPL-36737

Problem:
lcd_extern device can't probe when enter kernel

Solution:
fix lcd_extern device probe mistake

Verify:
ak301

Change-Id: I869806bf85e5bec16bb1956862f7fd2000359a8f
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2023-04-21 13:52:37 +09:00
Tao Zeng
17ee56708e fs: fix crash in squash fs [1/1]
PD#SWPL-37734

Problem:
crash in fs if put page reference count

Solution:
1, remove modify of put page;
2, revert following changes introduced by google:
	commit 60cc09a9e3
	Author: Adrien Schildknecht <adriens@google.com>
	Date:   Thu Sep 29 15:25:30 2016 -0700

	ANDROID: Squashfs: optimize reading uncompressed data

	When dealing with uncompressed data, there is no need to read a whole
	block (default 128K) to get the desired page: the pages are
	independent from each others.

	This patch change the readpages logic so that reading uncompressed
	data only read the number of pages advised by the readahead algorithm.

	Moreover, if the page actor contains holes (i.e. pages that are already
		up-to-date), squashfs skips the buffer_head associated to those pages.

	This patch greatly improve the performance of random reads for
	uncompressed files because squashfs only read what is needed. It also
	reduces the number of unnecessary reads.

	Change-Id: I90a77343bb994a1de7482eb43eaf6d2021502c22
	Signed-off-by: Adrien Schildknecht <adriens@google.com>

	---------------------------------------------------
	commit d840c1d772
	Author: Adrien Schildknecht <adrien+dev@schischi.me>
	Date:   Fri Oct 14 21:03:54 2016 -0700

	ANDROID: Squashfs: implement .readpages()

	Squashfs does not implement .readpages(), so the kernel just repeatedly
	calls .readpage().

	The readpages function tries to pack as much pages as possible in the
	same page actor so that only 1 read request is issued.

	Now that the read requests are asynchronous, the kernel can truly
	prefetch pages using its readahead algorithm.

	Change-Id: I65b9aa2ddc9444aaf9ccf60781172ccca0f3f518
	Signed-off-by: Adrien Schildknecht <adriens@google.com>

	---------------------------------------------------
	ANDROID: Squashfs: replace buffer_head with BIO
	The 'll_rw_block' has been deprecated and BIO is now the basic container
	for block I/O within the kernel.

	Switching to BIO offers 2 advantages:
	1/ It removes synchronous wait for the up-to-date buffers: SquashFS
	now deals with decompressions/copies asynchronously.
	Implementing an asynchronous mechanism to read data is needed to
	efficiently implement .readpages().
	2/ Prior to this patch, merging the read requests entirely depends on
	the IO scheduler. SquashFS has more information than the IO
	scheduler about what could be merged. Moreover, merging the reads
	at the FS level means that we rely less on the IO scheduler.

	Change-Id: I668812cc1e78e2f92497f9ebe0157cb8eec725ba
	Signed-off-by: Adrien Schildknecht <adriens@google.com>

Verify:
t318

Change-Id: I9ea62393066122cd720f41d50bde6cdf925fb06a
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2023-04-21 13:52:37 +09:00
Xingxing Wang
68e3843a22 cpufreq: mutex flow modification in set rate api [1/1]
PD#SWPL-37459

Problem:
[AVA][Askey][AndroidQ][s905x4]console hang after
executing performance mode to 2 boxes.

Solution:
unlock mutex when set rate failed

Verify:
SC2 AH212

Change-Id: Ia097721ebe07e7a2c049921d5f7efddd356ebf58
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2023-04-21 13:52:37 +09:00
Tao Zeng
9ed5e33d2f fs: prevent squashfs cache lock in cma [1/1]
PD#SWPL-37734

Problem:
cma allocation failed when work with squashfs.

Solution:
release page ref# for squashfs to work with CMA

Verify:
t318

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I5d3b8afcc917d83472eeba70f131fd6b8f8f4836
2023-04-21 13:52:37 +09:00
jian.zhou
afc8de3814 audio: set right EE_AUDIO_MST_PAD_CTRL0 register value [1/1]
PD#SWPL-22052

Problem:
mclk is not right value on sm1

Solution:
delete mclk_pad flag on dts

Verify:
SM1

Change-Id: I75bae1b41d78c4391d3b385cc615bf0da0bda7cf
Signed-off-by: jian.zhou <jian.zhou@amlogic.com>
2023-04-21 13:52:37 +09:00
Xingxing Wang
190db37ed1 cpufreq: modify G12B revB&revA A53/A73 DVFS table [1/1]
PD#SWPL-33114

Problem:
modify G12B revB&revA A53/A73 DVFS table

Solution:
100M~1.4G: +40mV
1.5G~1.7G: +50mV

Verify:
G12B A311D

Change-Id: I2a720532e48168cae79e69d3f261661a6fc827de
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2023-04-21 13:52:36 +09:00
chunlong.cao
51897c7f2f Revert "ge2d: t5: add ge2d support [1/1]"
This reverts commit 529c6f4f398b0783f9d19ad03dccd48d2511565c.

Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: Id751430c9532e2570f3ebf24633da8f66838a921
2023-04-21 13:52:36 +09:00
Cao Jian
77e2034375 ge2d: add custom stride support [1/1]
PD#SWPL-29770

Problem:
accept customized picture stride

Solution:
add this support

Verify:
w400

Change-Id: I582286f0f19a617b728cc262f1616a8fce6091b2
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:36 +09:00
Cao Jian
7e699a3907 ge2d: use offset when getting plane paddr [1/1]
PD#SWPL-37010

Problem:
yv12 u & v output error if plane_number is set 1

Solution:
every plane offset is not used
use offset when getting plane paddr

Verify:
w400

Change-Id: I489e9730024659e4aea0dfb0ba2ca33f22d04338
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:36 +09:00
Cao Jian
a7d4bbc988 ge2d: add hw capability flags [1/1]
PD#SWPL-35263

Problem:
acquire HW capabilities at runtime

Solution:
add hw capability flags

Verify:
on w400

Change-Id: I6cab307cd5e3df848da72de64370b71826d30377
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:36 +09:00
Cao Jian
87ea2f5e78 ge2d: add ioctl to attach/detach [1/1]
PD#SWPL-33277

Problem:
reduce cache invalidate actions
while doing bulk actions to improve the performance

Solution:
add ioctl to attach/detach dma fd

Verify:
on sm1/w400

Change-Id: Iea8fae9e483ff70044da748c78d8641c52a0c65d
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
Cao Jian
690e290f04 ge2d: unify power on and off macro [1/1]
PD#SWPL-33136

Problem:
unify power on off macro for powerdomain interface

Solution:
unify the macro

Verify:
t5 & sm1

Change-Id: I7306ae089ec9fd72f7da6d45ab6e8911a1e9c4cf
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
Cao Jian
4d07716e42 ge2d: t5: add ge2d support [1/1]
PD#SWPL-32146

Problem:
need add ge2d support for t5

Solution:
add ge2d support

Verify:
on PTM

Change-Id: Iacb6771df7b349530b6f1913fcc51aa6532f837f
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
Cao Jian
c003ef6bea osd: add member copying in CONFIG_COMPAT [1/1]
PD#SWPL-32539

Problem:
on a64_32 platform
green screen if GE2D_STRIDE_CUSTOM is set

Solution:
add member copying in CONFIG_COMPAT

Verify:
c1

Change-Id: I47b3d2bba6eb1825c96416fd593668bb397fde87
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
fushan.zeng
13e82edf2e linux: reboot power down cpu timeout [1/3]
PD#SH-5853

Problem:
reboot power down cpu timeout

Solution:
power down cpus throug bl31
set PWRN_EN bits

Verify:
S905D3

Signed-off-by: fushan.zeng <fushan.zeng@amlogic.com>
Change-Id: Ib0a9bcf5ef4d0115ba0e83864f6497761050d6f5
2023-04-21 13:52:35 +09:00
renjiang.han
2a0849472a ppmgr: The picture is incorrect due to alignment issues. [1/1]
PD#SWPL-36752

Problem:
The picture is incorrect due to alignment issues using GDC rotation.

Solution:
When using GDC rotation, the width of the buffer and the width
of the effective area are transmitted to the GDC drive.

Verify:
on A311D-W400

Change-Id: I6fabb794750dbb971fc270a174b48dd24965bc9b
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
0e4bc14772 ppmgr: add support gdc rotate. [1/1]
PD#SWPL-28849

Problem:
ppmgr uses ge2d for lower rotation efficiency.

Solution:
ppmgr uses gdc to do 1080p rotation.

Verify:
on w400

Change-Id: I81c7f3c3ababa2518e733608c89ac50074bbdbe9
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
0587c27531 ppmgr: configure buffer and canvas according to rotation requirements. [1/1]
PD#SWPL-27018

Problem:
The mismatch between the width and height of the buffer
and canvas results in garbage.

Solution:
Configure buffer and canvas according to rotation requirements.

Verify:
on U212

Change-Id: Ied08838ad4d4fc7628be55cd2de58f91562030c0
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
f4bb60c4ff ppmgr: support 4k & 1080 rotation for vdin. [1/1]
PD#SWPL-26142

Problem:
vdin is compressed in 1080 & 4k output, but ppmgr does
not support compressed format.

Solution:
If rotation is required, ppmgr informs vdin to output yuv.

Verify:
ab301

Change-Id: Ifebda530dad1c1a57a0415389543d48a8d4fbef2
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:35 +09:00
renjiang.han
24b9f69d9d ppmgr: The picture format is not rotated. [1/1]
PD#SWPL-18297

Problem:
The picture shows abnormality after ppmgr.

Solution:
The picture format is not rotated.

Verify:
on U212

Change-Id: I259554c2f7cb3a5eeb4e90c1c3e135d5005a6f01
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
2023-04-21 13:52:34 +09:00
Cao Jian
9587417431 gdc: add the stride support in gdc_process_phys [1/1]
PD#SWPL-36752

Problem:
Support the stride in physical address configuration

Solution:
add this support

Verify:
verified on g12b

Change-Id: Ic85384af6b67687e9f437319f6bc397c6e39a0cc
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:34 +09:00
Tao Zeng
9219f9ded0 rodata: fix compile error of rodata optimize [1/1]
PD#SWPL-31258

Problem:
Compile failed after merge https://scgit.amlogic.com/#/c/120275/

Solution:
Fix it

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: Ida94b0853baca9126b145e378d69b657b9cd4419
2023-04-21 13:52:34 +09:00
Tao Zeng
1c6529b998 rodata: optimize memory usage of rodata section [5/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, replace __FILE__ definition, using relative path instead of
absolute path. This can help to save about 50KB memory. For example:
[   36.820945@0] WARNING: CPU: 0 PID: 4817 at /mnt/fileroot/tao.zeng/p-android/
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 common/drivers/amlogic/memory_ext/page_trace.c:973
				 ~~~~~~ absolute path
		 pagetrace_write+0x10/0x18
[   42.792868@1] WARNING: CPU: 1 PID: 4864 at drivers/amlogic/
                 memory_ext/page_trace.c:973 pagetrace_write+0x10/0x18

2, replace __FUNC__ definition. using kallsyms interface to print function
instead of build in const string. This change can save about 100KB rodata.

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I65e4e9eb61a2226002557759833e4e16ed37b92e
2023-04-21 13:52:34 +09:00
Tao Zeng
2a7548129f rodata: optimize memory usage of rodata section [4/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, optimize kallsyms compress code. This can help to increase
about 18% of compress ratio and save about 200 ~ 500KB under
different config.

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I4c058fbb22d89bc50c81fa3266ee0f7613f076f2
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2023-04-21 13:52:34 +09:00
Tao Zeng
5b574c9eda mm: add more functions to check cma alloc/free user [1/1]
PD#SWPL-5301

Problem:
Sometimes we need to catch who allcated/free cma pools

Solution:
Add more functions in pagetrace

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I06c114441fc20c8fbde853be9ecb0fc96fd00111
2023-04-21 13:52:34 +09:00
Tao Zeng
ea094c64aa mm: fix Lost RAM too large problem when playing 4k [1/2]
PD#SWPL-16990

Problem:
Lost RAM will be over 200MB when playing 4K.

Solution:
Add cma pages in /proc/meminfo and give a information
for android layer to count them.

Verify:
x301

Change-Id: I99d1ded53ed351a5cb0d24f0e03850a55ef0d272
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2023-04-21 13:52:34 +09:00
Tao Zeng
9a149fa4b0 rodata: optimize memory usage of rodata section [3/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, remove CONFIG_KALLSYMS_ALL in module.c, which can help to save
about 200KB module memory during runtime compared from /proc/pagetrce:
           3068,         c020edd8, module_alloc   -- before
           2776,         c020edd8, module_alloc   -- after

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I15acee0df76f74a04c10d8f290d10fc35d51a283
2023-04-21 13:52:34 +09:00
Tao Zeng
fca514c91e rodata: optimize memory usage of rodata section [2/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, remove CONFIG_KALLSYMS_ALL in scripts, which can help to save
about 1MB ro data in code size.

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: Ie0387da46c6b789cb4f8c5d7e2128238e3986da0
2023-04-21 13:52:34 +09:00
Tao Zeng
313fd8232d rodata: optimize memory usage of rodata section [1/5]
PD#SWPL-31258

Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel

Solution:
1, remove all # lines in .config when generate /proc/config.gz, which can
save about 20KB ro-memory.

Verify:
x301

Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I80b85b006ddec3bbcfb9c8921eb59577af49ad0d
2023-04-21 13:52:34 +09:00
Arnd Bergmann
e6a1386f32 module: fix DEBUG_SET_MODULE_RONX typo
PD#SWPL-31258

[ Upstream commit 4d217a5adc ]

The newly added 'rodata_enabled' global variable is protected by
the wrong #ifdef, leading to a link error when CONFIG_DEBUG_SET_MODULE_RONX
is turned on:

kernel/module.o: In function `disable_ro_nx':
module.c:(.text.unlikely.disable_ro_nx+0x88): undefined reference to `rodata_enabled'
kernel/module.o: In function `module_disable_ro':
module.c:(.text.module_disable_ro+0x8c): undefined reference to `rodata_enabled'
kernel/module.o: In function `module_enable_ro':
module.c:(.text.module_enable_ro+0xb0): undefined reference to `rodata_enabled'

CONFIG_SET_MODULE_RONX does not exist, so use the correct one instead.

Fixes: 39290b389e ("module: extend 'rodata=off' boot cmdline parameter to module mappings")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jessica Yu <jeyu@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Change-Id: I3ed114cc957edca46684dc14bc47e133cd1725de
2023-04-21 13:52:34 +09:00