#asahi-dev · 2023-07-16 07:44
jannauchadmed: I haven't noticed that but haven't tested specifically for it. For CTM updates it depends on how userspace handles them. if it does a CTM update independently of FB updates it will lose one FB update#asahi-dev · 2023-07-16 07:39
dottedmagYep, so the swap returns after the previous framebuffer has been dealt with. This leaves uncertainty when swap can return during the vblank (which is still >=4% of the frame length). I guess I'd better empirically test it.#asahi-dev · 2023-07-16 07:38
jannauI suppose DCP reports the swap as completed in vblank, i.e. after it stopped accessing the old FB#asahi-dev · 2023-07-16 07:38
chadmedis that why we get stuttering when doing ops like changing the CTM or brightness? or is that something else#asahi-dev · 2023-07-16 07:37
jannauon DRM side we can release the FB only after DCP reported the swap to the new FB as completed. everything else led to crashes of the HW display controller due to reading unmapped memory#asahi-dev · 2023-07-16 07:32
dottedmagOr anywhere in between?#asahi-dev · 2023-07-16 07:31
dottedmagI see. So when in the lifecycle of the frame swap unblocks? I'm not sure how it works. I guess at some point DCP should stop reading from one framebuffer and start reading from another. I guess that without further nudging it does not do that within the frame, so it's somewhere within vblank? Is it when DCP releases the previous framebuffer after it's done with the frame, or when DCP starts reading the new one?#asahi-dev · 2023-07-16 07:28
jannauunsure, DRM atomic helpers might handle DRM_MODE_ATOMIC_NONBLOCK for us but the fw/hw swap is blocking#asahi-dev · 2023-07-16 07:25
dottedmagjannau: So, do I get it right that for now DRM_IOCTL_MODE_ATOMIC blocks, and DRM_MODE_ATOMIC_NONBLOCK is not supported?#asahi-dev · 2023-07-16 07:23
jannaudottedmag: for now the swaps are immediate and blocking so you have a rough idea when the previous one was. the FW interface has timestamps, supposedly for VRR and async swaps. The driver doesn't use that yet and I haven't really looked into how that fits into drm/kms#asahi-dev · 2023-07-16 07:14
dottedmagI see previous discussion on lack of vblank IRQ (good riddance!) Does DCP provide a event+timestamp for "this fb/crtc configuration is being presented", and is it exposed by DRM somehow? 16ms is quite a bit of time room, so it would be nice to be able to synchronize with actual refresh.#asahi-dev · 2023-07-16 06:43
sid-linuxsid-linux: thanks for the link to the firmware overview ChaosPrincess -- very useful..#asahi-dev · 2023-07-16 06:41
sid-linuxsorry wrong username !#asahi-dev · 2023-07-16 06:41
sid-linuxchadmed: thanks again :)#asahi-dev · 2023-07-16 01:35
chadmedi just want to make sure we dont have any severe performance/interactivity regressions#asahi-dev · 2023-07-16 01:35
chadmedanyone game to sanity-check https://github.com/chadmed/linux/commit/607d809f3877bd28dbaf3a758a9961af60f0c631 on a t8013 machine?#asahi-dev · 2023-07-15 19:39
ChaosPrincessThis might be helpful sid-linux#asahi-dev · 2023-07-15 19:39
ChaosPrincesshttps://github.com/AsahiLinux/docs/wiki/Introduction-to-Apple-Silicon#firmware-overview#asahi-dev · 2023-07-15 19:33
svenyeah, it’s iboot #asahi-dev · 2023-07-15 19:31
sid-linuxin `/chosen/memory-map`#asahi-dev · 2023-07-15 19:30
sid-linuxi guess it must be iboot because SEPFW appears in the ADT#asahi-dev · 2023-07-15 19:29
sid-linuxin other words who adds the SEF Firmware to the memory during stage 1?#asahi-dev · 2023-07-15 19:27
sid-linuxdoes iboot add SEP Firmware in stage 1 boot ? Or does Asahi Linux package the SEP firmware with m1n1 stage 1 during installation of Asahi Linux?#asahi-dev · 2023-07-15 18:27
sid-linux*never overwritten by m1n1 as part of the chainloading to the stage 2 m1n1#asahi-dev · 2023-07-15 18:27
sid-linux(figured it out also. adt is never overwritten by m1n1 and it lies at a lower address to _base where m1n1 is loaded)#asahi-dev · 2023-07-15 18:13
sid-linuxwow -- very useful. thanks ChaosPrincess#asahi-dev · 2023-07-15 18:12
svenah, bootargs after m1n1#asahi-dev · 2023-07-15 18:12
ChaosPrincessthat should explain it#asahi-dev · 2023-07-15 18:12
ChaosPrincesssid-linux: https://github.com/AsahiLinux/docs/wiki/SW:MachO-Boot-Protocol#asahi-dev · 2023-07-15 18:12
svenisn’t the memory layout something like (bootargs)(adt)(m1n1)(sepfw)?#asahi-dev · 2023-07-15 18:11
sid-linuxif you look at chainload_image() in m1n1 src/chainload.c , there is a copying of SEPFW but no copying of the adt#asahi-dev · 2023-07-15 18:09
sid-linuxso while the pointer to the adt is in bootargs, it has to lie outside it#asahi-dev · 2023-07-15 18:09
sid-linuxmax bootargs size is 16K. However devtree size is 0x5C00 or ~376K#asahi-dev · 2023-07-15 18:03
jannauother things like the SEP firmware is copied#asahi-dev · 2023-07-15 18:02
jannauas fresh as it is after iboot ran. the adt is in the bootargs and remains at it's location#asahi-dev · 2023-07-15 18:01
ChaosPrincessthe memory is still there, stage 2 is loaded at such an address that it does not overwrite the adt or other things you need to preserve#asahi-dev · 2023-07-15 17:59
sid-linuxbut I would have thought that we treat the memory as "fresh" when m1n1 stage 2 restarts#asahi-dev · 2023-07-15 17:58
sid-linuxaccording to my calculations ADT would be at something like 0x802_B30_000#asahi-dev · 2023-07-15 17:55
sid-linux (void *)(((u64)cur_boot_args.devtree) - cur_boot_args.virt_base + cur_boot_args.phys_base);#asahi-dev · 2023-07-15 17:55
sid-linux adt =#asahi-dev · 2023-07-15 17:54
sid-linuxHow is that possible -- how is the adt still available ?#asahi-dev · 2023-07-15 17:54
sid-linuxquestion regarding m1n1 adt. When the stage 1 m1n1 overwrites itself with the stage 2 m1n1, the chainloaded m1n1 still has access to the adt.#asahi-dev · 2023-07-15 16:53
ChaosPrincesseiln: so, that ipc.bin link expired, but does that look correct? https://paste.bingner.com/paste/nmgha#asahi-dev · 2023-07-15 16:06
eilnaha, ty#asahi-dev · 2023-07-15 16:04
ChaosPrincessyes, they are different, and normal m1n1 code does not work with them#asahi-dev · 2023-07-15 16:03
eilnChaosPrincess: i recall the ane dapf writes were slightly different so i played safe. this is much better, thank you#asahi-dev · 2023-07-15 15:57
ChaosPrincesseiln: you should replace w_tun_c with this: https://paste.bingner.com/paste/c9ry8#asahi-dev · 2023-07-15 15:53
eilnoh well, i've gotta figure out CISP_CMD_START first#asahi-dev · 2023-07-15 15:53
eilni'm worried calls like CISP_CMD_CH_AE_BIAS_EXPOSURE_SET aren't one-time, static params though (unlike, say, CISP_CMD_CH_COLOR_CAL_DATA_SET)#asahi-dev · 2023-07-15 15:52
eilnmarcan: makes sense. and if i can figure out one "ioctl", the 400 others should be relatively straightforward