#asahi-dev · 2024-05-12 22:18
chadmed_now that we've fixed the crashing we can probably find ways around the other silly behaviour. e.g. make the primary plane dest rectangle x+64, y+64 then offset the fb placement on that surface so that the cursor plane technically does not clip the edges of the primary surface#asahi-dev · 2024-05-12 22:16
chadmed_again this makes sense given DCP's backstory in the apple sip extended universe#asahi-dev · 2024-05-12 22:16
chadmed_leio: in our case blending = compositing. we can only have two surfaces#asahi-dev · 2024-05-12 21:43
Nefsen402do that until it hits a deadline then just fallback to compositing#asahi-dev · 2024-05-12 21:43
Nefsen402KMS requires compositors to basically guess what it will be happy with and if not, try another configuration#asahi-dev · 2024-05-12 21:43
Nefsen402Most overhead comes from just bad API design#asahi-dev · 2024-05-12 21:42
jannausure, but there's overhead before programming regs#asahi-dev · 2024-05-12 21:41
Nefsen402Well, yeah, apple has an entire firmware stack between the kernel and the hw, at some point it needs to reprogram registers#asahi-dev · 2024-05-12 21:39
jannaulinux 6.9 is released#asahi-dev · 2024-05-12 21:39
jannauno direct HW register programming on apple systems though#asahi-dev · 2024-05-12 21:38
jannauswitching might lose 1 frame because userspace notices to late that needs to switch and then has no time left for re-rendering #asahi-dev · 2024-05-12 21:37
jannauleio: we might have confused each other. primary + cursor + overlay/underlay at the same time doesn't work#asahi-dev · 2024-05-12 21:36
Nefsen402don't know how it looks for other hw tho#asahi-dev · 2024-05-12 21:36
Nefsen402and that logic is pretty expensive#asahi-dev · 2024-05-12 21:36
Nefsen402However, on AMD, it runs some pretty complex logic (a bunch of machine generated code) to decide if a buffer is viable for use as a hardware plane#asahi-dev · 2024-05-12 21:36
Nefsen402Not much goes on in userspace either#asahi-dev · 2024-05-12 21:35
nicolas17I mean mostly userspace overhead#asahi-dev · 2024-05-12 21:32
Nefsen402Switching isn't the hard part. It's really just a matter of reprogramming registers. Nothing in there that could introduce a bunch of latency#asahi-dev · 2024-05-12 21:31
nicolas17I'm surprised that switching has acceptable latency :P#asahi-dev · 2024-05-12 21:29
Nefsen402or it falls back to software#asahi-dev · 2024-05-12 21:29
Nefsen402Either that second window is allocated a hardware plane which the hardware will continue to composite both the overlapping surface and the video#asahi-dev · 2024-05-12 21:29
nicolas17what happens when another window partially covers the video player window?#asahi-dev · 2024-05-12 21:22
leiothat's where I'm mentally blocked right now - how is it not "blending" more than 2 layers#asahi-dev · 2024-05-12 21:22
leioOK, so I think the point here with the terminology is that when you have a video overlay, you seem to be composite them together without alpha blending needed, but you're just "placing" that plane in some specific location and it isn't counting as a blending with the other plane that happens to be lower z-priority (in CSS terms), so only the plane used for cursor ends up being blended on top of the combined visual result of the other 2 or so?#asahi-dev · 2024-05-12 21:13
jannauvideo player shouldn't hide the cursor if it's not over/under the video or it hasn't pointer focus#asahi-dev · 2024-05-12 21:12
jannausubtitles could be handled by using a video underlay instead of an overlay#asahi-dev · 2024-05-12 21:10
leiois that the same kind of usage as for example having no cursor (as it gets auto-hidden typically by video players) and in its place would be subtitles on top of the video?#asahi-dev · 2024-05-12 21:07
jannaudesktop with cursor and the overlay for non-fullscreen video playback#asahi-dev · 2024-05-12 21:06
leiowhat for would you use all 3 at once?#asahi-dev · 2024-05-12 21:05
jannauno, also blending/composting with full occlusion (i.e. no alpha blending)#asahi-dev · 2024-05-12 21:04
jannauit could then decide if it want to use the overlay plane for an overlay or the cursor#asahi-dev · 2024-05-12 21:04
leiounder blend, you mean blend with alpha channel?#asahi-dev · 2024-05-12 21:04
leiobut how do we declare the types; 1) do we mark one as cursor and then expect compositors to see its properties and find it's usable for other purposes too and use it when they deem it useful; 2) do we mark all as (primary +) overlay, as they are full sized and think compositors should pick one for cursor then; 3) something else#asahi-dev · 2024-05-12 21:03
jannauso it would make sense to only export the primary and overlay plane to inform userspace about this limitation#asahi-dev · 2024-05-12 21:03
jannauthe only issue is that we can only blend 2 layers (planes)#asahi-dev · 2024-05-12 21:02
jannauexporting cursor and overlay is not an issue (if we can get a unrestricted cursor plane to work) those don't have to match HW#asahi-dev · 2024-05-12 21:00
jannaubut hw as apples which has mostly universal planes it doesn't make much of difference#asahi-dev · 2024-05-12 21:00
leiowhat I hope we can avoid is that we tie up a plane in a way that it can ONLY be used as a cursor#asahi-dev · 2024-05-12 20:59
jannauHW / drivers can have "arbitrary" restrictions on planes so it makes sense that hardware which has real HW cursor support to export that as cursor plane#asahi-dev · 2024-05-12 20:57
jannaufor userspace it's just a hint#asahi-dev · 2024-05-12 20:56
jannauthe kernel needs a cursor plane to emulate the old cursor ioctls#asahi-dev · 2024-05-12 20:56
jannauthe type enumerations are for backward compatibility in the kernel#asahi-dev · 2024-05-12 20:56
leiobut we do want hardware cursors, do we not? You intend to "fake" a cursor plane for that?#asahi-dev · 2024-05-12 20:54
chadmedtheres no point even enumerating a type anymore if we're just going to ignore them #asahi-dev · 2024-05-12 20:54
chadmedif the driver has not exposed a cursor plane, it should be assumed that the hardware does not support hardware cursors. its that simple#asahi-dev · 2024-05-12 20:53
chadmedand we are proof of that#asahi-dev · 2024-05-12 20:53
chadmedin most hardware they behave mostly the same, but cursors are special and they shouldnt be treated the same as content for an overlay#asahi-dev · 2024-05-12 20:52
leioand you think compositors shouldn't use the overlay when cursor one doesn't exist?#asahi-dev · 2024-05-12 20:52
chadmedthere is primary, overlay, and cursor#asahi-dev · 2024-05-12 20:52
leiooh, me not knowing the types thjere maybe? do you mean there's a cursor planer, generic plane and universal plane?