Commit Graph

147 Commits

Author SHA1 Message Date
Christian Gmeiner
255c988024 drm/etnaviv: provide more ID values via GET_PARAM ioctl.
Make it possible for the user space to access these ID values.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2023-12-08 11:24:07 +08:00
Guido Günther
af2602ac87 drm/etnaviv: Add lockdep annotations for context lock
etnaviv_iommu_find_iova has it so etnaviv_iommu_insert_exact and
lockdep_assert_held should have it as well.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2023-12-08 11:24:07 +08:00
Lucas Stach
b6d74c3560 drm/etnaviv: fix dumping of active MMU context
[ Upstream commit 20faf2005ec85fa1a6acc9a74ff27de667f90576 ]

gpu->mmu_context is the MMU context of the last job in the HW queue, which
isn't necessarily the same as the context from the bad job. Dump the MMU
context from the scheduler determined bad submit to make it work as intended.

Fixes: 17e4660ae3d7 ("drm/etnaviv: implement per-process address spaces on MMUv2")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-08 11:24:07 +08:00
Lucas Stach
8f3347a598 drm/etnaviv: fix reference leak when mmaping imported buffer
commit 963b2e8c428f79489ceeb058e8314554ec9cbe6f upstream.

drm_gem_prime_mmap() takes a reference on the GEM object, but before that
drm_gem_mmap_obj() already takes a reference, which will be leaked as only
one reference is dropped when the mapping is closed. Drop the extra
reference when dma_buf_mmap() succeeds.

Cc: stable@vger.kernel.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-08 11:24:07 +08:00
Lucas Stach
9aa4002cc9 drm/etnaviv: don't truncate physical page address
[ Upstream commit d37c120b73128690434cc093952439eef9d56af1 ]

While the interface for the MMU mapping takes phys_addr_t to hold a
full 64bit address when necessary and MMUv2 is able to map physical
addresses with up to 40bit, etnaviv_iommu_map() truncates the address
to 32bits. Fix this by using the correct type.

Fixes: 931e97f3afd8 ("drm/etnaviv: mmuv2: support 40 bit phys address")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-08 11:24:07 +08:00
Doug Brown
e025348004 drm/etnaviv: add missing quirks for GC300
[ Upstream commit cc7d3fb446a91f24978a6aa59cbb578f92e22242 ]

The GC300's features register doesn't specify that a 2D pipe is
available, and like the GC600, its idle register reports zero bits where
modules aren't present.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-08 11:24:07 +08:00
Lucas Stach
58f804da14 drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem
commit e168c25526cd0368af098095c2ded4a008007e1b upstream.

When the mapping is already reaped the unmap must be a no-op, as we
would otherwise try to remove the mapping twice, corrupting the involved
data structures.

Cc: stable@vger.kernel.org # 5.4
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Acked-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-08 11:24:07 +08:00
Thomas Zimmermann
277f5bc2bc drm/etnaviv: Introduce GEM object functions
GEM object functions deprecate several similar callback interfaces in
struct drm_driver. This patch replaces the per-driver callbacks with
per-instance callbacks in etnaviv. The only exception is gem_prime_mmap,
which is non-trivial to convert.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-4-tzimmermann@suse.de
2023-12-08 11:24:07 +08:00
Lucas Stach
2dc08a7dac drm/etnaviv: rework linear window offset calculation
The current calculation based on the required_dma mask can be significantly
off, so that the linear window only overlaps a small part of the DRAM
address space. This can lead to the command buffer being unmappable, which
is obviously bad.

Rework the linear window offset calculation to be based on the command buffer
physical address, making sure that the command buffer is always mappable.

Tested-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
05735e9ff4 drm/verisilicon: fix cursor position
The cursor should be placed at (x + hot_x, y + hot_y) to allow partial
display of a cursor.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-05 23:38:42 +08:00
Han Gao
d81a2398a8 nf: enable nf mangle
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-12-03 15:33:55 +08:00
Han Gao
e133903e4d meles: add 4g/8g dts
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-12-03 14:53:53 +08:00
Han Gao
8b4bca072c meles: fix: usb2.0
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-12-03 14:53:53 +08:00
Haaland Chen
026ae08e53 riscv: dts: light: add Milk-V Meles board
Signed-off-by: Haaland Chen <haaland@milkv.io>
2023-12-03 14:53:53 +08:00
Han Gao
95a545985b riscv: default enable xtheadc
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-11-29 23:46:21 +08:00
Han Gao
f722795a38 toolchains: fix mainline toolchain build
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-11-29 23:46:21 +08:00
Han Gao
06bd593cfd ci: kernel auto build on thead-gcc & mainline-gcc
thead-gcc: v2.8.0
mainline-gcc: v13.2

Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-11-29 23:46:21 +08:00
Jisheng Zhang
556f057aca riscv: cmpxchg: implement arch_cmpxchg64_{relaxed|acquire|release}
After selecting ARCH_USE_CMPXCHG_LOCKREF, one straight futher
optimization is implementing the arch_cmpxchg64_relaxed() because the
lockref code does not need the cmpxchg to have barrier semantics. At
the same time, implement arch_cmpxchg64_acquire and
arch_cmpxchg64_release as well.

However, on both TH1520 and JH7110 platforms, I didn't see obvious
performance improvement with Linus' test case [1]. IMHO, this may
be related with the fence and lr.d/sc.d hw implementations. In theory,
lr/sc without fence could give performance improvement over lr/sc plus
fence, so add the code here to leave performance improvement room on
newer HW platforms.

Link: http://marc.info/?l=linux-fsdevel&m=137782380714721&w=4 [1]
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
2023-11-29 23:46:21 +08:00
Jisheng Zhang
186355454e riscv: select ARCH_USE_CMPXCHG_LOCKREF
Select ARCH_USE_CMPXCHG_LOCKREF to enable the cmpxchg-based lockless lockref
implementation for riscv.

Using Linus' test case[1] on TH1520 platform, I see a 11.2% improvement.
On JH7110 platform, I see 12.0% improvement.

Link: http://marc.info/?l=linux-fsdevel&m=137782380714721&w=4 [1]
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
2023-11-29 23:46:21 +08:00
Jisheng Zhang
b25b9b6b16 riscv: select ARCH_HAS_FAST_MULTIPLIER
Currently, riscv linux requires at least IMA, so all platforms have a
multiplier. And I assume the 'mul' efficiency is comparable or better
than a sequence of five or so register-dependent arithmetic
instructions. Select ARCH_HAS_FAST_MULTIPLIER to get slightly nicer
codegen. Refer to commit f9b4192923fa ("[PATCH] bitops: hweight()
speedup") for more details.

In a simple benchmark test calling hweight64() in a loop, it got:
about 14% preformance improvement on JH7110, tested on Milkv Mars.

about 23% performance improvement on TH1520 and SG2042, tested on
Sipeed LPI4A and SG2042 platform.

a slight performance drop on CV1800B, tested on milkv duo. Among all
riscv platforms in my hands, this is the only one which sees a slight
performance drop. It means the 'mul' isn't quick enough. However, the
situation exists on x86 too, for example, P4 doesn't have fast
integer multiplies as said in the above commit, x86 also selects
ARCH_HAS_FAST_MULTIPLIER. So let's select ARCH_HAS_FAST_MULTIPLIER
which can benefit almost riscv platforms.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
Tested-by: Samuel Holland <samuel.holland@sifive.com>
2023-11-29 23:46:21 +08:00
Icenowy Zheng
35a32afaf8 Kernel: fix out-of-tree build for merged kernel modules
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-11-29 12:54:48 +08:00
NekoRouter
3e042d29a3 Re-disable pwm,qspi0,qspi1 on beagle board
Keep light-a and beagle both can work
2023-10-22 21:04:53 -05:00
NekoRouter
c32ad7b836 Revert "sync: device-tree changes from main repo"
Enable pwm, qspi0, qspi1 on all devices

This reverts partial of commit 40ef3b0976
2023-10-22 21:04:53 -05:00
NekoRouter
99a459c9f7 Add MIPI panel driver, MIPI panel and touch controller Kconfig, New devicetree file 2023-10-22 21:04:53 -05:00
Han Gao
c10fdb081d feat: update npu-ax3386 with sdk1.2.1
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-18 22:16:33 +08:00
Han Gao
e3b22dbe54 ci: use revyos_beaglev_defconfig for ahead & cleanup
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-10 14:46:45 -05:00
Han Gao
b9526ccc12 config: use separate revyos_beaglev_defconfig
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-10 14:46:45 -05:00
Han Gao
f05fed4b3a Revert "fix: temporarily turn off Bluetooth build for ahead"
Use separate config

This reverts commit fe82c45483.
2023-10-10 14:46:45 -05:00
Han Gao
3e8db613d4 fix: reduce log level for aic8800
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-10 13:38:16 -05:00
Lu Hui
e04af8ab30 revyos_defconfig: enable aic8800 wifi 2023-10-10 13:38:16 -05:00
Lu Hui
a29e54cb02 drivers: wireless: add aic8800 support 2023-10-10 13:38:16 -05:00
Han Gao
fe82c45483 fix: temporarily turn off Bluetooth build for ahead
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-10 16:24:12 +08:00
Han Gao
c64537c234 fix: fix ftbfs for openwrt
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-09 15:46:44 -05:00
Han Gao
e0b5c2d836 Revert "Fix DSI"
This reverts commit c37f2020a7fe989eedec6edfc30c6ff1888a1bcf.
2023-10-09 15:46:44 -05:00
Han Gao
65d28e339c chore: force CONFIG_LOCALVERSION_AUTO=n
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-09 15:46:44 -05:00
Han Gao
383394d925 chore: sync revyos_config for sdk 1.2.0
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-09 15:46:44 -05:00
Han Gao
76d072714b fix: sync beagle devicetree
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-09 15:46:44 -05:00
Han Gao
f107c010f0 chore: sync revyos_config
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-10-09 15:46:44 -05:00
Robert Nelson
21488b4bba BeagleV: remove uart4 configuration and leave it to u-boot
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Robert Nelson
4090089096 NFM: quiet: hub usb usb2-port1
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Deepak Khatri
48d0bea232 Fix DSI 2023-10-09 15:46:44 -05:00
Deepak Khatri
0f0b0abd92 Free up P8.12 2023-10-09 15:46:44 -05:00
Deepak Khatri
2864ff8827 Free up P8.08 & P8.09 2023-10-09 15:46:44 -05:00
Robert Nelson
3b1e9db0d7 Make sure to build overlays
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Robert Nelson
d7048c221b BeagleV: add overlays
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Robert Nelson
d92a0f15a5 config: switch from /usr/lib/ -> /lib/ for wifi
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Robert Nelson
e4706a16f3 sync: Fix gpio pins input issue
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Robert Nelson
34157258d7 dt: merge in BlueTooth pinmux changes
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Robert Nelson
825f6a577e dt: sync MB_CS
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00
Robert Nelson
f0fba63d97 merge: dt: add cape header pins
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2023-10-09 15:46:44 -05:00