Skip to content

feat(present): offload Present copy compositing to the GPU - #1053

Merged
twaik merged 1 commit into
masterfrom
gpu-present-copy
Jul 12, 2026
Merged

feat(present): offload Present copy compositing to the GPU#1053
twaik merged 1 commit into
masterfrom
gpu-present-copy

Conversation

@twaik

@twaik twaik commented Jul 8, 2026

Copy link
Copy Markdown
Member

Present clients that can't use the flip fast path (windowed, partial damage) now get composited into the root texture via the renderer's GL context instead of a CPU CopyArea.

-disable-gpu-present forces the old path; a lost renderer connection also falls back to CPU.

@twaik

twaik commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

For some comparison:

Upstream:

~ $ termux-x11 -xstartup vkmark
=======================================================
    vkmark 2025.01
=======================================================
    Vendor ID:      0x144D
    Device ID:      0x2600200
    Device Name:    Samsung Xclipse 940
    Driver Version: 100663830
    Device UUID:    0bd042e6bda65ffb89157ea39b1cde4b
=======================================================
[vertex] device-local=true: FPS: 4689 FrameTime: 0.213 ms
[vertex] device-local=false: FPS: 4549 FrameTime: 0.220 ms
[texture] anisotropy=0: FPS: 4515 FrameTime: 0.221 ms
[texture] anisotropy=16: FPS: 4586 FrameTime: 0.218 ms
[shading] shading=gouraud: FPS: 4452 FrameTime: 0.225 ms
[shading] shading=blinn-phong-inf: FPS: 4305 FrameTime: 0.232 ms
[shading] shading=phong: FPS: 4386 FrameTime: 0.228 ms
[shading] shading=cel: FPS: 4409 FrameTime: 0.227 ms
[effect2d] kernel=edge: FPS: 4814 FrameTime: 0.208 ms
[effect2d] kernel=blur: FPS: 4613 FrameTime: 0.217 ms
[desktop] <default>: FPS: 4074 FrameTime: 0.245 ms
[cube] <default>: FPS: 4689 FrameTime: 0.213 ms
[clear] <default>: FPS: 3359 FrameTime: 0.298 ms
=======================================================
                                   vkmark Score: 4418
=======================================================

This PR version:

~ $ termux-x11 -disable-gpu-present -xstartup vkmark
=======================================================
    vkmark 2025.01
=======================================================
    Vendor ID:      0x144D
    Device ID:      0x2600200
    Device Name:    Samsung Xclipse 940
    Driver Version: 100663830
    Device UUID:    0bd042e6bda65ffb89157ea39b1cde4b
=======================================================
[vertex] device-local=true: FPS: 4456 FrameTime: 0.224 ms
[vertex] device-local=false: FPS: 4596 FrameTime: 0.218 ms
[texture] anisotropy=0: FPS: 4503 FrameTime: 0.222 ms
[texture] anisotropy=16: FPS: 4551 FrameTime: 0.220 ms
[shading] shading=gouraud: FPS: 4105 FrameTime: 0.244 ms
[shading] shading=blinn-phong-inf: FPS: 4102 FrameTime: 0.244 ms
[shading] shading=phong: FPS: 4196 FrameTime: 0.238 ms
[shading] shading=cel: FPS: 4236 FrameTime: 0.236 ms
[effect2d] kernel=edge: FPS: 4564 FrameTime: 0.219 ms
[effect2d] kernel=blur: FPS: 4729 FrameTime: 0.211 ms
[desktop] <default>: FPS: 4030 FrameTime: 0.248 ms
[cube] <default>: FPS: 4591 FrameTime: 0.218 ms
[clear] <default>: FPS: 3376 FrameTime: 0.296 ms
=======================================================
                                   vkmark Score: 4310
=======================================================
8096 exited, status=0
~ $ termux-x11 -xstartup vkmark
=======================================================
    vkmark 2025.01
=======================================================
    Vendor ID:      0x144D
    Device ID:      0x2600200
    Device Name:    Samsung Xclipse 940
    Driver Version: 100663830
    Device UUID:    0bd042e6bda65ffb89157ea39b1cde4b
=======================================================
[vertex] device-local=true: FPS: 4991 FrameTime: 0.200 ms
[vertex] device-local=false: FPS: 4997 FrameTime: 0.200 ms
[texture] anisotropy=0: FPS: 4902 FrameTime: 0.204 ms
[texture] anisotropy=16: FPS: 4928 FrameTime: 0.203 ms
[shading] shading=gouraud: FPS: 4788 FrameTime: 0.209 ms
[shading] shading=blinn-phong-inf: FPS: 4734 FrameTime: 0.211 ms
[shading] shading=phong: FPS: 4778 FrameTime: 0.209 ms
[shading] shading=cel: FPS: 4796 FrameTime: 0.209 ms
[effect2d] kernel=edge: FPS: 5038 FrameTime: 0.198 ms
[effect2d] kernel=blur: FPS: 5095 FrameTime: 0.196 ms
[desktop] <default>: FPS: 4249 FrameTime: 0.235 ms
[cube] <default>: FPS: 4963 FrameTime: 0.201 ms
[clear] <default>: FPS: 3468 FrameTime: 0.288 ms
=======================================================
                                   vkmark Score: 4748
=======================================================
9132 exited, status=0

~10% higher vkmark score, so I consider it is an improvement.

Tested with mesa-vulkan-icd-wrapper.

@twaik

twaik commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@robertkirkman probably you will like that. Can you please test this one?

@robertkirkman

robertkirkman commented Jul 8, 2026

Copy link
Copy Markdown
Member

the device i currently am able to access cannot run glmark2 because of a closed source android 10 phantom process killer of One UI 2.5, so i tested using luanti and in game fps counter,

luanti, adreno 630, 2960x1440

  • master with zink + turnip : 11 fps
  • master termux-wsi-layer-november : 30 fps
  • this PR with zink + turnip : 11 fps
  • this PR with termux-wsi-layer-november : 30 fps

i cannot measure an improvement, but there is no introduced issue.

@twaik
twaik force-pushed the gpu-present-copy branch from 15bad04 to 6879d5c Compare July 8, 2026 19:55
@twaik

twaik commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

In the case if you did not see the issue probably you did not hit the accelerated path. There were at least two bugs before the force-push.
One with redirected pixmaps (i.e. with xfwm, where WM uses COMPOSITE extension) and other one with blit coordinates.

You can check in termux's logcat for updated frame counter, which now includes gpu offload stats (if there was a gpu offload).

@robertkirkman

Copy link
Copy Markdown
Member

I see this and this is this PR's logcat from termux logcat command:

07-08 15:06:59.249  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:00.205 31032 31032 D libEGL  : loaded /vendor/lib64/egl/libEGL_adreno.so
07-08 15:07:00.273 31032 31032 D libEGL  : loaded /vendor/lib64/egl/libGLESv1_CM_adreno.so
07-08 15:07:00.284 31032 31032 D libEGL  : loaded /vendor/lib64/egl/libGLESv2_adreno.so
07-08 15:07:00.314 31032 31032 I AdrenoGLES: QUALCOMM build                   : fdd61e0, I20154638fb
07-08 15:07:00.314 31032 31032 I AdrenoGLES: Build Date                       : 10/07/20
07-08 15:07:00.314 31032 31032 I AdrenoGLES: OpenGL ES Shader Compiler Version: EV031.27.05.01
07-08 15:07:00.314 31032 31032 I AdrenoGLES: Local Branch                     :
07-08 15:07:00.314 31032 31032 I AdrenoGLES: Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.UM.8.3.R1.10.00.00.520.058
07-08 15:07:00.314 31032 31032 I AdrenoGLES: Remote Branch                    : NONE
07-08 15:07:00.314 31032 31032 I AdrenoGLES: Reconstruct Branch               : NOTHING
07-08 15:07:00.314 31032 31032 I AdrenoGLES: Build Config                     : S P 8.0.11 AArch64
07-08 15:07:00.333 31032 31032 I AdrenoGLES: PFP: 0x016ee187, ME: 0x00000000
07-08 15:07:00.639 31032 31032 D openal  : [ALSOFT] (II) Initializing library v1.25.2-unknown unknown
07-08 15:07:00.639 31032 31032 D openal  : [ALSOFT] (II) Supported backends: opensl, null, wave
07-08 15:07:00.639 31032 31032 D openal  : [ALSOFT] (II) Loading config /data/data/com.termux/files/usr/etc/openal/alsoft.conf...
07-08 15:07:00.639 31032 31032 D openal  : [ALSOFT] (II) Loading config /data/data/com.termux/files/usr/etc/xdg/alsoft.conf...
07-08 15:07:00.641 31032 31032 D openal  : [ALSOFT] (II) Loading config /data/data/com.termux/files/home/.alsoftrc...
07-08 15:07:00.641 31032 31032 D openal  : [ALSOFT] (II) Loading config /data/data/com.termux/files/home/.config/alsoft.conf...
07-08 15:07:00.641 31032 31032 D openal  : [ALSOFT] (II) Got binary: "/data/data/com.termux/files/usr/bin", "luanti"
07-08 15:07:00.641 31032 31032 D openal  : [ALSOFT] (II) Loading config /data/data/com.termux/files/usr/bin/alsoft.conf...
07-08 15:07:00.642 31032 31032 D openal  : [ALSOFT] (II) Extensions: +NEON
07-08 15:07:00.643 31032 31032 D openal  : [ALSOFT] (II) Initialized backend "opensl"
07-08 15:07:00.643 31032 31032 D openal  : [ALSOFT] (II) Added "opensl" for playback
07-08 15:07:00.643 31032 31032 D openal  : [ALSOFT] (II) Added "opensl" for capture
07-08 15:07:00.644 31032 31032 D openal  : [ALSOFT] (II) Opening default playback device
07-08 15:07:00.645 31032 31032 D openal  : [ALSOFT] (II) Created device 0x74db2b1180, "OpenSL"
07-08 15:07:00.645 31032 31032 D openal  : [ALSOFT] (II) Pre-reset: Stereo, Float32, 48000hz, 512 / 1536 buffer
07-08 15:07:00.682 31032 31032 D         : PlayerBase::PlayerBase()
07-08 15:07:00.683 31032 31032 D         : TrackPlayerBase::TrackPlayerBase()
07-08 15:07:00.683 31032 31032 I libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
07-08 15:07:00.703 31032 31032 I AudioTrack: createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST successful; frameCount 0 -> 576
07-08 15:07:00.706 31032 31032 D openal  : [ALSOFT] (II) Post-reset: Stereo, Int16, 48000hz, 512 / 1536 buffer
07-08 15:07:00.706 31032 31032 D openal  : [ALSOFT] (II) Stereo rendering
07-08 15:07:00.706 31032 31032 D openal  : [ALSOFT] (II) Channel config, Main: 3, Real: 2
07-08 15:07:00.706 31032 31032 D openal  : [ALSOFT] (II) Allocating 5 channels, 20480 bytes
07-08 15:07:00.706 31032 31032 D openal  : [ALSOFT] (II) Enabling single-band first-order ambisonic decoder
07-08 15:07:00.706 31032 31032 D openal  : [ALSOFT] (II) Max sources: 256 (255 + 1), effect slots: 64, sends: 2
07-08 15:07:00.706 31032 31032 D openal  : [ALSOFT] (II) Dithering enabled (16-bit, 32768)
07-08 15:07:00.707 31032 31032 D openal  : [ALSOFT] (II) Output limiter enabled, -0.0005dB limit
07-08 15:07:00.707 31032 31032 D openal  : [ALSOFT] (II) Fixed device latency: 1000000ns
07-08 15:07:00.707 31032 31032 D openal  : [ALSOFT] (II) Post-start: Stereo, Int16, 48000hz, 512 / 1536 buffer
07-08 15:07:00.708 31032 31053 W openal  : [ALSOFT] (WW) pthread_setschedparam failed: Operation not permitted (1)
07-08 15:07:00.708 31032 31032 D openal  : [ALSOFT] (II) Increasing allocated voices to 256
07-08 15:07:00.708 31032 31053 W openal  : [ALSOFT] (WW) D-Bus not supported
07-08 15:07:00.712 31032 31032 D openal  : [ALSOFT] (II) Created context 0x74db1fdb00
07-08 15:07:00.712 31032 31032 D openal  : [ALSOFT] (II) Increasing allocated context properties to 2
07-08 15:07:00.957 31032 31066 D openal  : [ALSOFT] (II) Increasing allocated voice properties to 32
07-08 15:07:01.005 31032 31032 W Gralloc3: mapper 3.x is not supported
07-08 15:07:01.008 31032 31032 W Gralloc3: allocator 3.x is not supported
07-08 15:07:05.262  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0
07-08 15:07:05.263  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:05.444  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0
07-08 15:07:05.445  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:06.298  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: MSG_RESIZED: frame=(0,0,1440,2960) ci=(0,84,0,0) vi=(0,84,0,0) or=1
07-08 15:07:06.321  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=10 res=0x0 s={true 529772982272} ch=false
07-08 15:07:06.329  8101  8101 D AbsListView:  in onLayout changed
07-08 15:07:06.755  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: MSG_WINDOW_FOCUS_CHANGED 0 0
07-08 15:07:06.755  8101  8101 D InputMethodManager: prepareNavigationBarInfo() DecorView@dfc4ab1[TermuxActivity]
07-08 15:07:06.755  8101  8101 D InputMethodManager: getNavigationBarColor() -855310
07-08 15:07:06.853  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)8 dur=20 res=0x4 s={false 0} ch=true
07-08 15:07:06.855  8101  8101 D InputTransport: Input channel destroyed: 'ClientS', fd=65
07-08 15:07:06.864  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: stopped(true) old=false
07-08 15:07:20.604 22500 22531 D LorieNative: New client connection!
07-08 15:07:20.736 22500 22530 I LorieNative: Sent shared buffer width 1440 stride 1472 height 2960 format 2 type 3 id 491
07-08 15:07:20.744 22500 22530 E tx11-request: window changed: 1440 2960 builtin
07-08 15:07:20.953 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:21.024 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.052 22500 22530 I LorieNative: Sent shared buffer width 2960 stride 3008 height 1440 format 2 type 3 id 1728
07-08 15:07:21.111 22500 22530 V LorieNative: New reported framerate is 60
07-08 15:07:21.133 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.146 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:21.194 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:21.236 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.243 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:21.243 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:21.263 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.264 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.273 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:21.273 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:21.277 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.277 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.622 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:21.721 22500 22530 I LorieNative: 27 frames in 5.0 seconds = 5.4 FPS
07-08 15:07:24.068 31032 31052 D         : PlayerBase::stop() from IPlayer
07-08 15:07:24.069 31032 31052 D AudioTrack: stop(172): called with 1114624 frames delivered
07-08 15:07:24.155 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:24.158 22500 22530 E tx11-request: window changed: 1440 2960 builtin
07-08 15:07:24.186 22500 22530 I LorieNative: Sent shared buffer width 1440 stride 1472 height 2960 format 2 type 3 id 1817
07-08 15:07:24.229 22500 22530 V LorieNative: New reported framerate is 60
07-08 15:07:24.250 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:24.277 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:24.297 22500 22530 I LorieNative: Sent shared buffer width 2960 stride 3008 height 1440 format 2 type 3 id 1822
07-08 15:07:24.354 22500 22530 V LorieNative: New reported framerate is 60
07-08 15:07:24.354 22500 22530 E tx11-request: window changed: 2960 1440 builtin
07-08 15:07:24.354 22500 22530 E tx11-request: window changed: 1440 2960 builtin
07-08 15:07:24.367 22500 22530 I LorieNative: Sent shared buffer width 1440 stride 1472 height 2960 format 2 type 3 id 1823
07-08 15:07:24.408 22500 22530 V LorieNative: New reported framerate is 60
07-08 15:07:24.410 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:24.410 22500 22530 I chatty  : uid=10289(com.termux.api) main identical 1 line
07-08 15:07:24.410 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:24.438 22500 22530 D LorieNative: Requested stylus: 0, current loriePen 0x0, current lorieEraser 0x0
07-08 15:07:26.183  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)4 dur=3 res=0x1 s={false 0} ch=false
07-08 15:07:26.183  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: stopped(false) old=true
07-08 15:07:26.188  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: stopped(false) old=false
07-08 15:07:26.213  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=6 res=0x7 s={true 529772982272} ch=true
07-08 15:07:26.284  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
07-08 15:07:26.284  8101  8101 D InputMethodManager: prepareNavigationBarInfo() DecorView@dfc4ab1[TermuxActivity]
07-08 15:07:26.284  8101  8101 D InputMethodManager: getNavigationBarColor() -855310
07-08 15:07:26.286  8101  8101 D InputMethodManager: prepareNavigationBarInfo() DecorView@dfc4ab1[TermuxActivity]
07-08 15:07:26.286  8101  8101 D InputMethodManager: getNavigationBarColor() -855310
07-08 15:07:26.286  8101  8101 V InputMethodManager: Starting input: tba=com.termux ic=com.termux.view.TerminalView$2@97d0508 mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
07-08 15:07:26.286  8101  8101 D InputMethodManager: startInputInner - Id : 0
07-08 15:07:26.286  8101  8101 I InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
07-08 15:07:26.312  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: MSG_RESIZED: frame=(0,0,1440,2960) ci=(0,84,0,0) vi=(0,84,0,0) or=1
07-08 15:07:26.327  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=6 res=0x1 s={true 529772982272} ch=false
07-08 15:07:26.531  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: MSG_RESIZED: frame=(0,0,1440,2960) ci=(0,84,0,908) vi=(0,84,0,908) or=1
07-08 15:07:26.561  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=11 res=0x1 s={true 529772982272} ch=false
07-08 15:07:26.564  8101  8101 D AbsListView:  in onLayout changed
07-08 15:07:26.727 22500 22530 I LorieNative: 107 frames in 5.0 seconds = 21.4 FPS
07-08 15:07:27.722  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: setInTouchMode(false), android.view.ViewRootImpl.checkForLeavingTouchModeAndConsume:7839 android.view.ViewRootImpl.access$2500:205 android.view.ViewRootImpl$EarlyPostImeInputStage.processKeyEvent:6201 android.view.ViewRootImpl$EarlyPostImeInputStage.onProcess:6185 android.view.ViewRootImpl$InputStage.deliver:5793 android.view.ViewRootImpl.deliverInputEvent:9029 android.view.ViewRootImpl.doProcessInputEvents:8886 android.view.ViewRootImpl.enqueueInputEvent:8839 android.view.ViewRootImpl$ViewRootHandler.handleMessage:5421 android.os.Handler.dispatchMessage:107
07-08 15:07:27.723  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0
07-08 15:07:27.723  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:28.148  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0
07-08 15:07:28.148  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:28.815  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0
07-08 15:07:28.816  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:29.266  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0
07-08 15:07:29.267  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:30.599  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0
07-08 15:07:30.599  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 1
07-08 15:07:45.429  8101  8101 I ViewRootImpl@cbda3b8[TermuxActivity]: ViewPostIme key 0

what kind of program should i run that may trigger different behavior?

also, do you mean to watch termux logcat or termux:x11 logcat?

@twaik

twaik commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

I tested it only with mesa-vulkan-icd-wrapper + vkmark.
There are a few conditions for fast path: both target and source pixmaps are not shmem based (because they can not be converted to GPU textures), no legacy drawing and no new flag. I am not exactly remember how exactly old wsi wrapper behaves, so can not tell what is wrong.

@robertkirkman

Copy link
Copy Markdown
Member

i will be able to run vkmark later in a different device

@twaik
twaik force-pushed the gpu-present-copy branch 2 times, most recently from 7442d02 to f9a2811 Compare July 9, 2026 13:19
@robertkirkman

robertkirkman commented Jul 9, 2026

Copy link
Copy Markdown
Member

Here are Adreno 612 vkmark --fullscreen scores at 2400x1080

master

151
150
150

PR

143
152
152

Samsung Galaxy A70 SM-A705FN One UI 8 Android 16

pkg install mesa-vulkan-icd-freedreno driver

@twaik

twaik commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Well, it is in the margin of error.
But at least now it heats GPU instead of CPU so it heats less.

@twaik
twaik force-pushed the gpu-present-copy branch from f9a2811 to d6f7074 Compare July 9, 2026 17:31
@robertkirkman

Copy link
Copy Markdown
Member

Should I test the new version and send logcat result?

@twaik

twaik commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

I think so.
Someone on discord reported some stretching problem while using Pipetto-crypto's wrapper.

@Pipetto-crypto can you please help us?

image

@robertkirkman

Copy link
Copy Markdown
Member
07-09 12:39:39.106 25298 25298 D sshd-session: debug2: channel 0: rcvd adjust 49303
07-09 12:39:39.106 25298 25298 D sshd-session: debug2: channel 0: rcvd adjust 49237
07-09 12:39:39.117 25298 25298 D sshd-session: debug2: channel 0: rcvd adjust 50266
07-09 12:39:39.117 25298 25298 D sshd-session: debug2: channel 0: rcvd adjust 60036
07-09 12:39:39.117 25298 25298 D sshd-session: debug2: channel 0: rcvd adjust 50351
07-09 12:39:40.794 25212 25253 I LorieNative: 15 frames in 5.0 seconds = 3.0 FPS
07-09 12:39:45.796 25212 25253 I LorieNative: 16 frames in 5.0 seconds = 3.2 FPS
07-09 12:39:50.797 25212 25253 I LorieNative: 16 frames in 5.0 seconds = 3.2 FPS
07-09 12:39:55.797 25212 25253 I LorieNative: 16 frames in 5.0 seconds = 3.2 FPS
07-09 12:39:56.927 25411 25411 I shmem   : int libandroid_shmget(key_t, size_t, int): bound UNIX socket /dev/shm/00006343 in pid=25411
07-09 12:39:56.927 25411 25411 I shmem   : void *libandroid_shmat(int, const void *, int): mapped addr 0x7ca0ed0000 for FD 10 ID 0
07-09 12:39:56.928 25411 25411 I shmem   : int libandroid_shmdt(const void *): unmapped addr 0x7ca0ed0000 for FD 10 ID 0 shmid 63430001
07-09 12:39:56.928 25411 25411 I shmem   : int libandroid_shmctl(int, int, struct shmid64_ds *): IPC_RMID for shmid=63430001
07-09 12:39:56.983 25212 25253 I LorieNative: DRI3: imported raw fd, modifier 0, 2400x1080 stride 9728
07-09 12:39:56.986 25212 25253 I LorieNative: DRI3: imported raw fd, modifier 0, 2400x1080 stride 9728
07-09 12:39:56.993 25212 25253 I LorieNative: DRI3: imported raw fd, modifier 0, 2400x1080 stride 9728
07-09 12:39:57.003 25212 25253 I LorieNative: DRI3: imported raw fd, modifier 0, 2400x1080 stride 9728
07-09 12:40:00.798 25212 25253 I LorieNative: 123 frames in 5.0 seconds = 24.6 FPS, 0/118 present copies offloaded to GPU
07-09 12:40:05.799 25212 25253 I LorieNative: 185 frames in 5.0 seconds = 37.0 FPS, 0/185 present copies offloaded to GPU
07-09 12:40:06.352 24830 24830 D sshd-session: debug3: receive packet: type 98
07-09 12:40:06.353 25298 25298 D sshd-session: debug3: receive packet: type 98
07-09 12:40:06.354 24830 24830 D sshd-session: debug1: server_input_channel_req: channel 0 request window-change reply 0
07-09 12:40:06.354 25298 25298 D sshd-session: debug1: server_input_channel_req: channel 0 request window-change reply 0
07-09 12:40:06.354 25298 25298 D sshd-session: debug1: session_by_channel: session 0 channel 0
07-09 12:40:06.354 25298 25298 D sshd-session: debug1: session_input_channel_req: session 0 req window-change
07-09 12:40:06.355 24830 24830 D sshd-session: debug1: session_by_channel: session 0 channel 0
07-09 12:40:06.355 24830 24830 D sshd-session: debug1: session_input_channel_req: session 0 req window-change

@twaik

twaik commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

The log does not say if it works fine on your device or not.
Does it work?

@robertkirkman

Copy link
Copy Markdown
Member

For me, vkcube works. Unfortunately, on most of my devices vulkan-wrapper-android did not work very well, particularly with zink, as of March 15 2025,

so i do not usually try it, but if I should try it here let me know.

@robertkirkman

Copy link
Copy Markdown
Member

The log does not say if it works fine on your device or not. Does it work?

vkcube works for me and it does not look stretched. sorry i was making an additional message but I posted the log first.

@robertkirkman

Copy link
Copy Markdown
Member

I think that people testing graphics drivers and Termux:X11 should know that I have recently added a new OpenGL test, geodesicgears. This is how to launch it

pkg upgrade
pkg install xscreensaver
export PATH=$PREFIX/libexec/xscreensaver:$PATH
geodesicgears

it is much more intensive than glxgears, and it is cursor-interactive and dynamic, so it will have low FPS if the graphics driver is not working correctly and it will have input lag if there is input latency.

For me it is working fine with this PR.

@twaik
twaik force-pushed the gpu-present-copy branch from d6f7074 to 8c4adf5 Compare July 9, 2026 18:23
Present clients that can't use the flip fast path (windowed, partial
damage) now get composited into the root texture via the renderer's
GL context instead of a CPU CopyArea. -disable-gpu-present forces the
old path; a lost renderer connection also falls back to CPU.
@twaik
twaik force-pushed the gpu-present-copy branch from 8c4adf5 to d127944 Compare July 9, 2026 19:03
@twaik

twaik commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Seems like the stretching bug was fixed.

@twaik
twaik merged commit 1b86096 into master Jul 12, 2026
@twaik
twaik deleted the gpu-present-copy branch July 12, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants