This means that the drivers for such IPs cannot use the BOs exported
Neither they can use them without the patch.
like you do in this patch. I believe the drivers could be improved
by writing a helper function which studies the sg_table and
concludes that it's actually contiguous. I think we should have at
least one such driver fixed along with this patch so that we can be
more confident that this actually works.
Yes, I we have such driver, but unfortunately it is not upstream (PVR
driver that is). Right now I have droid4 in front of me with SGX
rendering hildon-desktop in landscape using TILER BO.
Sure I had 2 more patches applied and also had to teach PVR driver to
know how to use that scatterlist, but that was a trivial change (an
old version of the patch
https://github.com/tmlind/linux_openpvrsgx/commit/90f16ed906c8c6eb4893d3ff647ca7d921972495).
See glmark-es2 results (with a little help of a simple PVR EXA):
user@devuan-droid4:/root$ uname -a
Linux devuan-droid4 5.15.2-01783-g6ba3430a6fad-dirty #28 SMP PREEMPT
Mon Nov 15 08:48:21 EET 2021 armv7l GNU/Linux
user@devuan-droid4:/root$ xrandr -o 3
user@devuan-droid4:/root$ glmark2-es2 --fullscreen
=======================================================
glmark2 2020.04
=======================================================
OpenGL Information
GL_VENDOR: Imagination Technologies
GL_RENDERER: PowerVR SGX 540
GL_VERSION: OpenGL ES 2.0 build 1.17@4948957
=======================================================
[build] use-vbo=false: FPS: 107 FrameTime: 9.346 ms
[build] use-vbo=true: FPS: 136 FrameTime: 7.353 ms
[texture] texture-filter=nearest: FPS: 156 FrameTime: 6.410 ms
[texture] texture-filter=linear: FPS: 153 FrameTime: 6.536 ms
[texture] texture-filter=mipmap: FPS: 152 FrameTime: 6.579 ms
[shading] shading=gouraud: FPS: 111 FrameTime: 9.009 ms
[shading] shading=blinn-phong-inf: FPS: 116 FrameTime: 8.621 ms
[shading] shading=phong: FPS: 104 FrameTime: 9.615 ms
[shading] shading=cel: FPS: 96 FrameTime: 10.417 ms
[bump] bump-render=high-poly: FPS: 67 FrameTime: 14.925 ms
[bump] bump-render=normals: FPS: 140 FrameTime: 7.143 ms
[bump] bump-render=height: FPS: 131 FrameTime: 7.634 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 49 FrameTime: 20.408 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 17 FrameTime:
58.824 ms
[pulsar] light=false:quads=5:texture=false: FPS: 152 FrameTime: 6.579 ms
[desktop]
blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 23
FrameTime: 43.478 ms
[desktop] effect=shadow:windows=4: FPS: 64 FrameTime: 15.625 ms
[buffer]
columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map:
FPS: 33 FrameTime: 30.303 ms
[buffer]
columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata:
FPS: 33 FrameTime: 30.303 ms
[buffer]
columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map:
FPS: 60 FrameTime: 16.667 ms
[ideas] speed=duration: FPS: 115 FrameTime: 8.696 ms
[jellyfish] <default>: FPS: 48 FrameTime: 20.833 ms
[terrain] <default>:PVR:(Error): SGXKickTA: TA went out of Mem and
SPM occurred during last TA kick [0, ]
PVR:(Error): SGXKickTA: TA went out of Mem and SPM occurred during
last TA kick [0, ]
PVR:(Error): SGXKickTA: TA went out of Mem and SPM occurred during
last TA kick [0, ]
FPS: 1 FrameTime: 1000.000 ms
[shadow] <default>: FPS: 31 FrameTime: 32.258 ms
[refract] <default>: FPS: 13 FrameTime: 76.923 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 156 FrameTime:
6.410 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 100 FrameTime:
10.000 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 156 FrameTime:
6.410 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 128
FrameTime: 7.812 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 83
FrameTime: 12.048 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 127
FrameTime: 7.874 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS:
104 FrameTime: 9.615 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 77
FrameTime: 12.987 ms
=======================================================
glmark2 Score: 92
=======================================================
Impressive, ain't it ;)
But I'm not sure what that driver would be on droid4. I have DRA7
boards which have VIP, CAL and VPE that I can use here. Perhaps it
wouldn't be too much effort for me to extend my tests a bit to
include CAL, and try to fix the driver. I just fear the driver
changes won't be trivial.
At least PVR change was really trivial.
Did you test this somehow?
Yes, on droid4, works with no issue, see above.
Did you look at the userspace mmap of TILER buffers? I wonder if
that goes correctly or not. Isn't memory to userspace mapped per
page, and lengths of the TILER lines are not page aligned?
I really can't explain it any better than Matthijs, see the other mail.
So, what I think shall be done to have TILER BOs (and not only) in a
shape that's usable for anything else but a simple test-cases, if you
accept the $subject patch:
1. Make TILER BOs page-aligned (simple patch, I already have it).
That should fix possible invalid memory accesses for both mmap()-ed
memory and kernel drivers.