Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rockchip64-6.14: Set dma mask to 64 bit #7924

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

SuperKali
Copy link
Member

Description

This patch sets the DMA mask to 64-bit for Rockchip DRM drivers to properly handle physical addresses above 4GB. The VOP MMU can translate upper 4GB physical addresses to iova below 4GB, resolving "swiotlb buffer full" warnings seen on systems with >4GB RAM.

Source: https://source.mnt.re/reform/reform-debian-packages/-/blob/487191f7ad5c48850c22b3fe8d4d9187f21945e5/linux/patches6.11/rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch

Motivation: Fixes graphical subsystem warnings that occur when handling large memory allocations on Rockchip devices with >4GB DDR.

How Has This Been Tested?

  • Verified on RK3588-based SBC with 8GB RAM
  • Confirmed disappearance of swiotlb warnings via dmesg monitoring

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

@github-actions github-actions bot added size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Mar 7, 2025
@Tonymac32
Copy link
Member

Please test on RK3399 and/or RK3328. I assume RK3566/8 will behave like RK3588

@SuperKali
Copy link
Member Author

Please test on RK3399

Unfortunately I don't possess any board with those soc

@paolosabatino
Copy link
Contributor

Perhaps today I can give a shot to rk3328/rk3399 boards

@paolosabatino
Copy link
Contributor

Quick check on OrangePi 4 LTS (rk3399) and a rk3318 tvbox shows no harm: both present basic DRM console, XFCE works in both composite and non-composite modes, OpenGL works fine (tested quake) and dmesg is clean.

The patch seems ok to me

@paolosabatino paolosabatino added the Ready to merge Reviewed, tested and ready for merge label Mar 8, 2025
@SuperKali SuperKali merged commit a691fe0 into armbian:main Mar 8, 2025
10 checks passed
@lanefu
Copy link
Member

lanefu commented Mar 8, 2025

My unscientific testing on glmark2 on pinebook pro (rk3399) shows a bit of a regression.

before1: 397
before2: 400
after1: 381
after2: 386

@paolosabatino
Copy link
Contributor

paolosabatino commented Mar 8, 2025

My unscientific testing on glmark2 on pinebook pro (rk3399) shows a bit of a regression.

before1: 397 before2: 400 after1: 381 after2: 386

Weird, I felt "something" while watching Quake demo going on... Anyway I guess the patch as-is cannot be mainlined in the kernel because IMHO it would break 32bit, wouldn't it? A nicer way to do that would be enable only for those SoCs which can address more than 4gb of DRAM.

This is only for edge kernel though, so there is time for refinement and testing.

@SuperKali SuperKali deleted the dma-mask branch March 8, 2025 18:07
@paolosabatino
Copy link
Contributor

Did a benchmark with glmark2 on rk3399, no regression on my side:

  • 360 points with kernel 6.12 and no patch
  • 366 points with kernel 6.14 and this patch applied

torte71 pushed a commit to torte71/armbian-mksklipad50 that referenced this pull request Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

4 participants