#
#asahi-dev · 2023-10-07 13:20
eilnheader changes from 0x2db032e0->0x2db012e0, 0x100000->0x300000, same otherwise
#asahi-dev · 2023-10-07 13:16
eilnspecifically non-coded idr slice inserts [height/width, dmaconfig, dst_y, dst_uv, dmaconfig, dmaconfig, dmaconfig, dmaconfig, unk, ref_tile0, ref_tile1, ref_tile2, ref_tile3] before the dma commands
#asahi-dev · 2023-10-07 13:15
jannegjust additional pointers or changes in the decoder headers as well? I would expect 2 reference frame lists. might be hard to detect if you just decode 2 frames
#asahi-dev · 2023-10-07 13:02
eilnthe next dma'd decode stream automatically stacks on top of the last one. interesting. that limit must be 0x100000 then
#asahi-dev · 2023-10-07 12:59
eilnjanneg: just decoded a non-idr coded slice. structure is no longer the same, additional dart addrs pointing to the previous (presumably) reference frames
#asahi-dev · 2023-10-07 12:34
chadmedbootlin have a v4l2 vaapi driver implementing the request api
#asahi-dev · 2023-10-07 12:21
eilnalright looking at a multi slice one rn
#asahi-dev · 2023-10-07 11:59
eilnactually the decode stream header seems constant @ 0x74 bytes
#asahi-dev · 2023-10-07 11:56
eilnjanneg: my screen roughly looks like this https://pastebin.com/RfAL9EmT
#asahi-dev · 2023-10-07 11:53
jannegH.264 (03/2005) is the best spec document to look at
#asahi-dev · 2023-10-07 11:52
jannegI guess the dart addresses could point to reference frames or scaling_lists
#asahi-dev · 2023-10-07 11:50
eilnonly single slice but it's been constant for all of these
#asahi-dev · 2023-10-07 11:49
jannegis the 10 constant? does your h264 bitstream has a single slice or multiple?
#asahi-dev · 2023-10-07 11:46
eilnthe decode stream is roughly about 10 frame info u32s (height/width), 10 shifted dart addrs, and 10*n slice commands which are 0x2a000000 masked
#asahi-dev · 2023-10-07 11:44
eilnjanneg: that makes much more sense. I haven't even tested non-pow2
#asahi-dev · 2023-10-07 11:43
jannegi.e. SPS.pic_width_in_mbs_minus1
#asahi-dev · 2023-10-07 11:42
jannegI would expect ((width + 15) >> 4) - 1
#asahi-dev · 2023-10-07 11:42
jannegany idea why the dimensions are effectively just shifted right by 3?
#asahi-dev · 2023-10-07 11:40
janneg64 and 4096 are reasonable minimal/maximal dimensions
#asahi-dev · 2023-10-07 11:38
eilnit's so ugly. just height/width looks like this ((((x.height - 1) << 1) >> 4) << 16) | (((x.width - 1) << 1) >> 4)
#asahi-dev · 2023-10-07 11:38
eilnwe are decoding smpte bars now. pow2 64 <= height,width <= 4096 works. shall look into tiling tomorrow
#asahi-dev · 2023-10-07 11:38
eilnok yeah sps+pps is part of the decode stream
#asahi-dev · 2023-10-07 11:38
jannegthe only appeal of v4l2 m2m stateless is that it is a standardized API
#asahi-dev · 2023-10-07 11:37
ChaosPrincessor pretend the avd is totally a part of gpu.
#asahi-dev · 2023-10-07 11:36
ChaosPrincessif they are not happy, char/misc exists
#asahi-dev · 2023-10-07 11:36
jannegnot sure how happpy v4l2 is about a custom which pipes basically binary data through
#asahi-dev · 2023-10-07 11:34
jannegvulkan video would probably mean a drm mode
#asahi-dev · 2023-10-07 11:34
chadmedi just think no one's bothered doing it yet :
#asahi-dev · 2023-10-07 11:34
chadmedthe backends are modular so we could theoretically just add one for v4l2
#asahi-dev · 2023-10-07 11:33
jannegI haven't looked at libva internals but I suppose we could / have to whatever we want as backend and driver
#asahi-dev · 2023-10-07 11:33
chadmedoh does that mean a drm driver for avd?
#asahi-dev · 2023-10-07 11:32
eilnas a render node?
#asahi-dev · 2023-10-07 11:31
chadmedhow would that userspace component slot in then? i initially imagined a va-api driver but it doesnt have v4l2 as a backend
#asahi-dev · 2023-10-07 11:31
jannegif we need an userspace part we should reconsider va-api or vulkan video as those have already userspace
#asahi-dev · 2023-10-07 11:31
eilnI know avc is scaled because my output can't fit in that tile size. there's a hardcoded scaling list. I have yet to seen anything about scaler
#asahi-dev · 2023-10-07 11:31
eilnjanneg: yes they have de/tileRows fn in the kext. codec/platform invariant
#asahi-dev · 2023-10-07 11:30
jannegif svc and mvc were just annexes they could be easily ignored but unfortunately they seeep through the whoole standard and add complexity
#asahi-dev · 2023-10-07 11:28
jannegeiln: they do what (RE: neon)! neither scaler or gpu can handle the AVD tiling?
#asahi-dev · 2023-10-07 11:25
eilnI thought about using ane's chinook but it seems iboot locks down ctrr since 13.5
#asahi-dev · 2023-10-07 11:24
chadmedoh.... ew
#asahi-dev · 2023-10-07 11:24
eilnwe'll need a userspace layer anyway; apple rolls out NEON in the kernel to untile output
#asahi-dev · 2023-10-07 11:24
eilnI'm tempted to generate the decode stream entirely in userspace and attach it as VIDIOC_S_EXT_CTRLS() V4L2_CTRL_FLAG_HAS_PAYLOAD void* ptr. header/reference frame info is all encoded in there. that would make our driver about 500 LOC
#asahi-dev · 2023-10-07 11:24
eilnchadmed: I meant that as in "I don't want to deal with the CM3 at all" e.g. non-aic interrupts, writing cortex code, etc. I did load my own code at the end ;)
#asahi-dev · 2023-10-07 11:24
eilnjanneg: that is much saner, thank you
#asahi-dev · 2023-10-07 08:17
ydaltonchadmed: that would also mean avoiding the problem of copying a macOS blob
#asahi-dev · 2023-10-07 02:25
chadmedR was already considering this iirc
#asahi-dev · 2023-10-07 02:25
chadmedeiln: since the cm3 fw is uploaded by the kernel, we can write our own and use that as the copro for stateless >:)
#asahi-dev · 2023-10-07 02:02
linaAfter all when you send the image to other people they see the unmirrored version, mirroring is only for local preview
#asahi-dev · 2023-10-07 02:02
linaSo we don't need to worry about that
#asahi-dev · 2023-10-07 02:01
lina(Some probably have toggles for it but it should never be the default and I think videocall apps always mirror internally)

plus ›