Commit Graph

193 Commits

Author SHA1 Message Date
thead_admin
e17ac7bab2 Linux_SDK_V1.3.3
Signed-off-by: thead_admin <occ_thead@service.alibaba.com>
2024-01-31 22:09:29 +08:00
Han Gao
2bd2eac4a7 ci: add pahole
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-12-30 20:18:05 +08:00
Han Gao
6a61ffb0b6 config: enable bpf for bpfcc & bpftrace
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-12-30 20:18:05 +08:00
Icenowy Zheng
6bb5a30b0e drm/verisilicon: bias fb address for dual-head offset
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-29 21:30:20 +08:00
Han Gao
6bafa84231 config: network: enable brcmfmac
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-12-27 22:38:48 +08:00
Icenowy Zheng
593e484dbb drm/verisilicon: finally fix the cursor position
Fixes cursor disappearing when using rotated screen.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-27 22:36:59 +08:00
Icenowy Zheng
108fcf335e riscv: dts: thead: downclock SD card for LPi4A
It's reported that @198MHz some R/W error will happen.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-27 22:36:46 +08:00
Han Gao
5441a6d3e1 config: network: wg & team & bonding
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2023-12-27 22:36:30 +08:00
Lu Hui
117a49c9b2 riscv: dts: light-lpi4a-z14inch-m0: add 14inch screen support 2023-12-26 16:29:43 +08:00
Lu Hui
ceed3702cd drivers: panel: add 14inch-2160x1440_40Hz screen timing into simple-panel.c 2023-12-26 16:29:43 +08:00
Lu Hui
274a4b08dd sound: es8156 limit max volume 2023-12-26 16:29:43 +08:00
Lu Hui
2c9ad71844 revyos_defconfig: disable sysrq from serial port 2023-12-26 16:29:43 +08:00
Lu Hui
fa040f74fb revyos_defconfig: enable hid over i2c driver 2023-12-26 16:29:43 +08:00
Lu Hui
37075d067b riscv: dts: light-lpi4a-console: add ydx trackpoint, thank ice 2023-12-26 16:29:43 +08:00
Lu Hui
14763fe34c revyos_defconfig: enable cw2015 battery & gpio charger 2023-12-26 16:29:43 +08:00
Lu Hui
3c3d82b1e9 revyos_defconfig: enable panel-bridge lt8911exb 2023-12-26 16:29:43 +08:00
Lu Hui
633d39c11d revyos_defconfig: enable panel-minjun 2023-12-26 16:29:43 +08:00
Lu Hui
25fc785ecc riscv: dts: add light-lpi4a-[laptop|console|z14inch-m0].dts 2023-12-26 16:29:43 +08:00
Lu Hui
d49c77423a revyos_defconfig: enable framebuffer console rotate 2023-12-26 16:29:43 +08:00
Lu Hui
31b8e1e375 riscv: dts: light-lpi4a-dsi0-hdmi: allow panel ref by other dts file 2023-12-26 16:29:43 +08:00
Lu Hui
3a6df042b4 drivers: panel-bridge: add lt8911exb driver 2023-12-26 16:29:43 +08:00
Lu Hui
f32b30324f drivers: panel: add mingjun-070bi30ia2 2023-12-26 16:29:43 +08:00
Lu Hui
1fd93bc1a9 drivers: aic8800: upgrade to 20231212 2023-12-26 16:29:43 +08:00
Icenowy Zheng
b8c5d35460 revyos_defconfig: use ETNAVIV instead of Galcore
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
afcdc418d4 drm/etnaviv: hack: use only pta id 0
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
d6f09caa32 light: use etnaviv
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
727e6f3be6 galcore: adapt to vivante,gc
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
2f78e6b748 drm/etnaviv: add GC620
Dirty.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
cfe4413691 drm/etnaviv: add hwdb entry for TH1520 GC620
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
373e8161c5 drm/etnaviv: add workaround for GC620 on TH1520 (0x5552)
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Icenowy Zheng
9ba56a64a8 drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-12-08 11:24:07 +08:00
Lucas Stach
ad542ee013 drm/etnaviv: expedited MMU fault handling
The GPU is halted when it hits a MMU exception, so there is no point in
waiting for the job timeout to expire or try to work out if the GPU is
still making progress in the timeout handler, as we know that the GPU
won't make any more progress.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
2023-12-08 11:24:07 +08:00
Lucas Stach
e44f708a9e drm/etnaviv: drop GPU initialized property
Now that it is only used to track the driver internal state of
the MMU global and cmdbuf objects, we can get rid of this property
by making the free/finit functions of those objects safe to call
on an uninitialized object.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
2023-12-08 11:24:07 +08:00
Lucas Stach
ccbbd8ae8f drm/etnaviv: better track GPU state
Instead of only tracking if the FE is running, use a enum to better
describe the various states the GPU can be in. This allows some
additional validation to make sure that functions that expect a
certain GPU state are only called when the GPU is actually in that
state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
2023-12-08 11:24:07 +08:00
Lucas Stach
e286235a75 drm/etnaviv: avoid runtime PM usage in etnaviv_gpu_bind
Nothing in this callpath actually touches the GPU, so there is no reason
to get it out of suspend state here. Only if runtime PM isn't enabled at
all we must make sure to enable the clocks, so the GPU init routine can
access the GPU later on.

This also removes the need to guard against the state where the driver
isn't fully initialized yet in the runtime PM resume handler.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
2023-12-08 11:24:07 +08:00
Lucas Stach
e084b32587 drm/etnaviv: slow down FE idle polling
Currently the FE is spinning way too fast when polling for new work in
the FE idleloop. As each poll fetches 16 bytes from memory, a GPU running
at 1GHz with the current setting of 200 wait cycle between fetches causes
80 MB/s of memory traffic just to check for new work when the GPU is
otherwise idle, which is more FE traffic than in some GPU loaded cases.

Significantly increase the number of wait cycles to slow down the poll
interval to ~30µs, limiting the FE idle memory traffic to 512 KB/s, while
providing a max latency which should not hurt most use-cases. The FE WAIT
command seems to have some unknown discrete steps in the wait cycles so
we may over/undershoot the target a bit, but that should be harmless.

If the GPU core base frequency is unknown keep the 200 wait cycles as
a sane default.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
2023-12-08 11:24:07 +08:00
Lucas Stach
880ab177a1 drm/etnaviv: split fence lock
The fence lock currently protects two distinct things. It protects the fence
IDR from concurrent inserts and removes and also keeps drm_sched_job_arm and
drm_sched_entity_push_job in one atomic section to guarantee the fence seqno
monotonicity. Split the lock into those two functions.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-12-08 11:24:07 +08:00
Christian Gmeiner
c32beb855f drm/etnaviv: print MMU exception cause
The MMU tells us the fault status. While the raw register value is
already printed, it's a bit more user friendly to translate the
fault reasons into human readable format.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2023-12-08 11:24:07 +08:00
Lucas Stach
8304fb3b0e drm/etnaviv: switch to PFN mappings
There is no reason to use page based mappings, as the established
mappings are special driver mappings anyways and should not be
handled like normal pages.

Be consistent with what other drivers do and use raw PFN based
mappings.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2023-12-08 11:24:07 +08:00
Lucas Stach
51464f6592 drm/etnaviv: reap idle mapping if it doesn't match the softpin address
When a idle BO, which is held open by another process, gets freed by
userspace and subsequently referenced again by e.g. importing it again,
userspace may assign a different softpin VA than the last time around.
As the kernel GEM object still exists, we likely have a idle mapping
with the old VA still cached, if it hasn't been reaped in the meantime.

As the context matches, we then simply try to resurrect this mapping by
increasing the refcount. As the VA in this mapping does not match the
new softpin address, we consequently fail the otherwise valid submit.
Instead of failing, reap the idle mapping.

Cc: stable@vger.kernel.org # 5.19
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
2023-12-08 11:24:07 +08:00
Lucas Stach
f87b29df53 drm/etnaviv: move idle mapping reaping into separate function
The same logic is already used in two different places and now
it will also be needed outside of the compilation unit, so split
it into a separate function.

Cc: stable@vger.kernel.org # 5.19
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
2023-12-08 11:24:07 +08:00
Christian Gmeiner
c71d194901 drm/etnaviv: print offender task information on hangcheck recovery
Track the pid per submit, so we can print the name and cmdline of
the task which submitted the batch that caused the gpu to hang.

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
Lucas Stach
dc96c0fe68 drm/etnaviv: reap idle softpin mappings when necessary
Right now the only point where softpin mappings get removed from the
MMU context is when the mapped GEM object is destroyed. However,
userspace might want to reuse that address space before the object
is destroyed, which is a valid usage, as long as all mapping in that
region of the address space are no longer used by any GPU jobs.

Implement reaping of idle MMU mappings that would otherwise
prevent the insertion of a softpin mapping.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Acked-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2023-12-08 11:24:07 +08:00
Lucas Stach
5ffd7f5029 drm/etnaviv: move flush_seq increment into etnaviv_iommu_map/unmap
The flush sequence is a marker that the page tables have been changed
and any affected TLBs need to be flushed. Move the flush_seq increment
a little further down the call stack to place it next to the actual
page table manipulation. Not functional change.

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>
2023-12-08 11:24:07 +08:00
Lucas Stach
0f89c7db16 drm/etnaviv: move MMU context ref/unref into map/unmap_gem
This makes it a little more clear that the mapping holds a reference
to the context once the buffer has been successfully mapped into that
context and simplifies the error handling a bit.

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>
2023-12-08 11:24:07 +08:00
Michael Walle
4a4a708db1 drm/etnaviv: use a 32 bit mask as coherent DMA mask
The STLB and the first command buffer (which is used to set up the TLBs)
has a 32 bit size restriction in hardware. There seems to be no way to
specify addresses larger than 32 bit. Keep it simple and restict the
addresses to the lower 4 GiB range for all coherent DMA memory
allocations.

Please note, that platform_device_alloc() will initialize dev->dma_mask
to point to pdev->platform_dma_mask, thus dma_set_mask() will work as
expected.

While at it, move the dma_mask setup code to the of_dma_configure() to
keep all the DMA setup code next to each other.

Suggested-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2023-12-08 11:24:07 +08:00
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