<mareko>
does anybody know how to make MS Teams screen sharing work with XWayland?
rasterman has joined #dri-devel
<mareko>
AMD requires 256B pitch alignment for linear (it must exactly 256B, not less and not more); some AMD generations allow less, but Mesa always allocates with 256B alignment to make multi-GPU interop possible
<mareko>
AFAIK Intel also allocates with 256B alignment for linear because it's the only way to have interop with AMD GPUs
* ccr
thinks about the Holy Handgrenade.
<Company>
I wonder if llvmpipe should do that, too
<Company>
it currently does 64 I think
<mareko>
ideally we would have linear modifiers for different alignments
<Company>
that would be neat
warpme has quit []
<mareko>
because the current linear modifier is always exposed but is not usable depending on the pitch alignment
<Company>
yeah, GTK has fallbacks using mmap() for linear and doesn't accept LINEAR for fourccs it can't handle
<Company>
and those fallbacks are SLOW
nerdopolis has joined #dri-devel
LeviYun has quit [Read error: Connection reset by peer]
heat has joined #dri-devel
siak has quit [Ping timeout: 480 seconds]
siak has joined #dri-devel
siak has quit []
Guest1303 is now known as DemiMarie
<DemiMarie>
mareko: what are the rules for offsets and for non-LINEAR modifiers?
<DemiMarie>
Company: why fallback instead of failing?
<Company>
1. because the fallbacks aren't always slow
<Company>
2. because sometimes it doesn't matter that they're slow
<Company>
3. because nobody can handle failure
<jannau>
should v3d (rpi4b) in the upstream kernel use DMA?
<DemiMarie>
Company: how does one avoid the fallbacks?
<jannau>
I'm seeing 'vc4-drm gpu: swiotlb buffer is full (sz: 540672 bytes), total 32768 (slots), used 1381 (slots)' and garbled graphics
<Company>
DemiMarie: one uses drivers that don't need them
<Company>
you need to know what the target's requirements are and make sure your sources produce content that doesn't fallback
<DemiMarie>
Does GTK help with that?
<Company>
no
<DemiMarie>
Does GTK provide enough information to know the target?
<Company>
no
<DemiMarie>
How can one discover the target?
<Company>
you'd probably need to poke the GL and Vulkan default drivers
<Company>
but even that won't help too much, because half that info isn't available that way
<DemiMarie>
That doesn't seem reasonable. One doesn't know what GTK will be importing into.
<Company>
that's correct
<DemiMarie>
What is the solution?
<Company>
the target and source offer compatible formats in all cases
<DemiMarie>
How can one ensure that?
<Company>
you talk to everyone involved and get them to agree
<DemiMarie>
How does one do that?
<Company>
I don't know that
<Company>
which is why I implemented fallback
<Company>
my hope is that it works well enough so that in the few cases where it doesn't, users file bugs against the drivers so their developers are aware of the issues and then go and fix things
<Company>
or they come to GTK and suggest faster fallbacks
<DemiMarie>
Is the proper solution an omniscient userspace allocator like gralloc or minigbm?
<Company>
if I toggle some flags in GTK, my 4k video deadlocks my app for ~10s until an image appears and then another 10s for the next image
<Company>
by default, GPU and CPU stay in low power and take like ~5% each while playing that same 4k video
<DemiMarie>
In that case it might be better to fail and force the source to fallback to rendering to a CPU buffer.
<Company>
yeah, but I can't do that
<DemiMarie>
Why?
<Company>
because I don't have any easy tools to achieve that
<Company>
the source here is some random application developed by someone somewhere
<Company>
which will hopefully work fine in >95% of cases
<Company>
but sometimes some nerds read the Arch wiki and copy its tips into their /etc/environment.d
<Company>
and sometimes somebody has a driver for some new mobile chip they want to test on
<DemiMarie>
I found that GSK_RENDERER=cairo fixed some GTK apps that didn't render properly.
<Company>
yeah, it's the slow fallback (that also can't do 3D, but most GTK apps don't do any 3D)
<Company>
"slow" being relative there, because if you don't have a GPU, Cairo can be faster than GL/Vulkan software
<DemiMarie>
It seems that on Fedora 40 the default renderer is buggy with software rendering and X11.
<Company>
I'm not aware of any issues
<Company>
but I've also done a ton of work on the renderer this cycle, so I might be losing track
gouchi has joined #dri-devel
<DemiMarie>
It would be nice if there was a way for GTK to switch at runtime depending on whether 3D is in use, but this is off-topic.
<Company>
It would be nice if people stopped running UIs on devices without a GPU
<Company>
and didn't even consider it an option
<DemiMarie>
Company: never going to happen
DodoGTA has quit [Quit: DodoGTA]
<Company>
I'm pretty sure it's going to happen
<Company>
because UI software will flat out stop working
uis[m] has joined #dri-devel
<DemiMarie>
That would break tens of thousands of users
<DemiMarie>
At least
<Company>
absolutely
<Company>
and then they will buy new hardware
DodoGTA has joined #dri-devel
<Company>
GTK 4.18 will do color management and linear compositing
<Company>
which will kill Cairo performance
<DemiMarie>
Could llvmpipe be made faster with better use of SIMD?
<DemiMarie>
Or is it memory bandwidth bound?
<Company>
I do think llvmpipe is the better choice compared to Cairo, but I have no idea what the limits are there
<Company>
the limit depends a bit on what you're doing, but on my machine llvmpipe stops getting much faster for my benchmark at ~4 threads
<Company>
so I assume that's the memory bandwidth limit
<DemiMarie>
Not everyone can afford new hardware.
<Company>
they'll have to use older GTK versions with older hardware then
kts has joined #dri-devel
<DemiMarie>
Or switch to non-GTK applications, which is what I may recommend to Qubes OS users
<Company>
yeah, fine with me
<DemiMarie>
Why are you okay with breaking working systems?
<Company>
GTK runs on pretty much anything that supports GLES3, anything older doesn't usually even have the CPU power to do the tasks that GTK applications want to do
<DemiMarie>
You forgot VDI, VMs, and systems where drivers are being brought up.
dsimic is now known as Guest1361
dsimic has joined #dri-devel
<Company>
I don't forget them, I just don't think they should be holding anyone back
<Company>
and VMs not getting their GPU story in order has been an ongoing thing for the last 10+ years
Guest1361 has quit [Ping timeout: 480 seconds]
kts has quit [Quit: Konversation terminated!]
kts has joined #dri-devel
Duke`` has joined #dri-devel
<Company>
DemiMarie: just tested it, the linear compositing color management stuff has pretty much no measurable impact on Mesa software rendering
<Company>
it just trashes Cairo, because unlike GL/Vulkan, Cairo has no support for it
<emersion>
could GTK disable the fancy color stuff with cairo?
<Company>
no
<Company>
well, it technically could, but it's a bad idea
<Company>
because it changes the result too much
<emersion>
it does
<emersion>
but usable and different result would be better than unusable
<Company>
yes and no
<Company>
people blame GTK if things look like shit, not their setup
<emersion>
and they don't blame GTK if it's super slow?
<Company>
no, because they know their setup is bad
* emersion
doesn't really get why a calculator app or a file manage would require a fancy GPU
<Company>
I mean, they will initially, because they will see the regression from 4.16 => 4.18
<Company>
a calculator doesn't need a fancy gpu
<emersion>
a GTK4 calculator does
<Company>
because you don't care if it takes 100ms to repaint
<emersion>
and drains your battery?
<Company>
it doesn't because it only repaints once
<Company>
but file managers these days want to do smooth scrolling of fancy renderings for their files
<Company>
it's not like 20 years ago where you dragged the scrollbar, then it repainted once and was done
<Company>
you swipe the trackpad or wheel around
rasterman has quit [Ping timeout: 480 seconds]
<Company>
and GTK won't stop running on those setups, it's just that people get annoyed once you get <10fps (roughly)
<Company>
and I'm sure you could make software rendering a lot faster (both in Mesa and in GTK), but that would require some serious engineering effort
<Company>
and nobody is willing to do that
bmodem has quit [Ping timeout: 480 seconds]
<DemiMarie>
Company: this could be solved by making it a runtime flag
<Company>
GTK_BROKEN_RENDERING=1
<DemiMarie>
What kind of engineering effort, and how much faster? 2x?
<Company>
it's hard to make such generic statements because they depend on use case
coldfeet has quit [Remote host closed the connection]
<Company>
but to give some guesses:
<Company>
I expect Cairo to lose 50% of rendering perf because of linear compositing - pixman supports reading images as SRGB but Cairo doesn't expose a CAIRO_FORMAT_SRGB
<Company>
the Cairo renderer doesn't cache any converted images, and PNGs come out as unpremultiplied RGBA, but Cairo wants premultiplied BGRA - that's probably gonna buy you a bunch of speed on image-heavy cases (like a file manager showing a grid of thumbnails)
<Company>
lavapipe recently gained dmabuf support, which seems to have made perf of the software Vulkan renderer go up by roughly 3x
<Company>
but that's on a system with a GPU
<Company>
no idea what you'd get from using Cairo with udmabuf instead of wl_shm
<Company>
then GTK is absolutely not optimized for reducing shader instruction count
<Company>
because we're usually either CPU-bound or VRAM memory bandwidth
<Company>
but that is different on old hardware
<Company>
on with software rendering with low CPU count
rasterman has joined #dri-devel
<Company>
one could also write a GTK backend using skia
gouchi has quit [Remote host closed the connection]
ellyq has quit [Ping timeout: 480 seconds]
<mareko>
DemiMarie: non-linear modifiers have complex alignment rules
kts has quit [Quit: Konversation terminated!]
<DemiMarie>
mareko: are they written down anywhere?
<DemiMarie>
Also, is there an opaque counterpart to every format that has an alpha channel? If so, is it safe to pass a buffer with an alpha channel with the opaque format, or will that break with non-linear modifiers?
<DemiMarie>
If this is not safe, then I need to make a copy.
sima has quit [Ping timeout: 480 seconds]
<mareko>
DemiMarie: yes, yes
<DemiMarie>
mareko: where are the written down?
<mareko>
nowhere
<mareko>
I was replying to the second message
<mareko>
trying to write down alignment rules for tiling is futile
<DemiMarie>
Futile?
<mareko>
yes
<DemiMarie>
Why?
<mareko>
every GPU is different
<DemiMarie>
Does Mesa know the rules?
<DemiMarie>
And if so, does it strictly validate them when importing external dmabufs?
<mareko>
for some, yes; for others, it has to compute them based on which GPU is plugged in
<DemiMarie>
Was the second yes “yes, it is safe” or “yes, you must make a copy”?
<mareko>
it's safe
<mareko>
but if you go RGBX->RGBA, A can be random
<DemiMarie>
mareko: is it safe to treat RGBA as RGBX?
<mareko>
yes
<mareko>
DemiMarie: what are you working on?
<DemiMarie>
Does that include lying to a Wayland compositor about the buffer type?
<DemiMarie>
mareko: A Wayland proxy for Qubes OS
<mareko>
I don't know much about compositors
<DemiMarie>
Client requests come from guest VMs and are assumed malicious. Furthermore, transparency is not allowed: the guest (which runs its own proxy) is responsible for compositing subsurfaces, and each format that supports transparency is transformed into one that does not.
simon-perretta-img has joined #dri-devel
rasterman has quit [Remote host closed the connection]
<zamundaaa[m]>
Demi: it's safe, but it'll cause a lot of problems for apps
simon-perretta-img__ has joined #dri-devel
<zamundaaa[m]>
Oh, nvm, with subsurfaces out of the way, it should usually be fine
simon-perretta-img_ has quit [Ping timeout: 480 seconds]
simon-perretta-img has quit [Ping timeout: 480 seconds]
<Company>
it won't be fine
<Company>
unless you take control over shadows
<Company>
because Adwaita draws 60-90px wide shadows
<Company>
people not running compositors on X11 still file bugs to this day
ity has quit [Quit: WeeChat 4.3.5]
tarceri has quit [Remote host closed the connection]
tarceri has quit [Remote host closed the connection]
tarceri has joined #dri-devel
vliaskov has joined #dri-devel
<jenatali>
karolherbst: cool, clc and vtn patches look good to me
vliaskov has quit [Read error: Connection reset by peer]
<karolherbst>
feel free to use the MR as a checklist on what to add to your CL impl :D
<DemiMarie>
Company: those shadows will be clipped
<karolherbst>
anyway.. I think the interop stuff fails, because iris probably needs special handling for msaa exports
<DemiMarie>
Company: but also Adwaita should support not drawing shadows that will be clipped anyway
<Company>
there was some work along those lines, yeah
* Company
didn't follow that
<DemiMarie>
this is also why I posted the change to xdg-decoration, because for tiling compositors not drawing server-side decorations doesn’t make sense at all
<DemiMarie>
but that is off-topic here
<Company>
xdg-decoration first needs to learn to cooperate with GTK anyway
alanc has quit [Remote host closed the connection]
alanc has joined #dri-devel
Kayden has quit [Quit: Leaving]
Kayden has joined #dri-devel
sima has quit [Ping timeout: 480 seconds]
nerdopolis has quit [Remote host closed the connection]
nerdopolis has joined #dri-devel
gbittencourt4 has quit [Ping timeout: 480 seconds]
gbittencourt4 has joined #dri-devel
flom84 has joined #dri-devel
<Company>
so apparently my mesa shader cache has 50 parts
<Company>
each of those have 2 files
<Company>
and I have 2 GPUs and llvmpipe
<Company>
so now I have 50 * 2 * 3 = 300 open fds
<Company>
good news everyone: if I use Vulkan and GL, I get even more fds
rgallaispou has quit [Read error: Connection reset by peer]
sima has joined #dri-devel
iive has joined #dri-devel
flom84 has quit [Quit: Leaving]
<DemiMarie>
Company: how would it cooperate?
<DemiMarie>
There are compositors that will draw server-side decorations no matter what the client does. It’s up to the client to deal with this situation.
<DemiMarie>
But that is a topic for #_oftc_#wayland:matrix.org
<Company>
there are clients that will draw client-side decorations no matter what the compositor does. It's up to the compositor to deal with this situation.
<Company>
now what?
<DemiMarie>
duplicate decorations
<Company>
that's not what the protocol says though
<DemiMarie>
#_oftc_#wayland:matrix.org
<emersion>
the protocol says the client must obey
<Company>
exactly
<Company>
and GTK can't do that
Kayden has quit [Quit: Leaving]
Kayden has joined #dri-devel
Duke`` has quit [Ping timeout: 480 seconds]
Kayden has quit [Quit: Leaving]
<DemiMarie>
no, GTK can
<DemiMarie>
"obey" does not mean "no CSDs"
rasterman has quit [Quit: Gettin' stinky!]
gouchi has quit [Remote host closed the connection]
Kayden has joined #dri-devel
gbittencourt4 has quit [Ping timeout: 480 seconds]