#asahi-dev · 2023-09-08 13:09
marcansven: also dma-ranges is NOT ignored#asahi-dev · 2023-09-08 13:09
marcanah yeah maybe that was it, I was trying to use the dma_mask to limit iommu page table levels and failing miserably#asahi-dev · 2023-09-08 11:07
marcanwe need to get rid of the remaining users of apple,asc-dram-mask, I think only t8103 dcp has anything nonzero there and should be changed to dma-range (and then this removes a bunch of code from dcp)#asahi-dev · 2023-09-08 10:56
marcanand there's logic in the DART code that allows address space truncation (which is what the hardware does) as long as the range is smaller than the DART address space and does not straddle natural boundaries#asahi-dev · 2023-09-08 10:56
marcanthat's why we now have apple,dma-range = <0x100 0x0 0x10 0x0>;#asahi-dev · 2023-09-08 10:54
marcanI spent way too long figuring this mess out#asahi-dev · 2023-09-08 10:54
marcansven: turned out that function is useless because by the time the driver probe() is called, the iommu aperture is already initialized#asahi-dev · 2023-09-08 10:48
marcanand MTP too I think#asahi-dev · 2023-09-08 10:48
marcanIIRC I made DCP use that (which fixed a bunch of weird)#asahi-dev · 2023-09-08 03:32
marcanand yeah, for ane you're allowed to use the drm_mm stuff if necessary since that's in accel/ which is morally drm, so if it makes sense there I wouldn't worry about it, but for ISP it'd be nice (and probably simplify things quite a bit) to switch back to the regular iova allocator#asahi-dev · 2023-09-08 03:31
marcanpresumably it doesn't matter where in that AS you allocate, right?#asahi-dev · 2023-09-08 03:30
marcanyou can tell the iommu stuff how many bits of address space you have, then it'll restrict itself to that range#asahi-dev · 2023-09-08 03:30
marcaneiln: does it need to be bottom up?#asahi-dev · 2023-09-07 16:20
marcanthere's so much junk in this firmware, like Face ID stuff...#asahi-dev · 2023-09-07 16:02
marcanother than that no, I think#asahi-dev · 2023-09-07 16:02
marcanGPU has some stuff#asahi-dev · 2023-09-07 16:02
marcant8103 -> pallas, t600x -> astraeus, t8112 -> triton, t602x -> helios (yes another set of codenames)#asahi-dev · 2023-09-07 16:01
marcanand yeah I think so#asahi-dev · 2023-09-07 16:01
marcanactually it's the same firmware so yeah#asahi-dev · 2023-09-07 15:59
marcan(though I kind of hope/assume it's identical to t6021)#asahi-dev · 2023-09-07 15:59
marcanbtw, does anyone have a t6020 *laptop*? I think that's the only ISP SoC variant I can't personally test (because I have the mini...)#asahi-dev · 2023-09-07 15:58
marcanmore like no time#asahi-dev · 2023-09-07 15:57
marcanand also rushing to ship#asahi-dev · 2023-09-07 15:57
marcanyeah...#asahi-dev · 2023-09-07 15:56
marcanthe random hardcoded addresses/values in kexts make me cry#asahi-dev · 2023-09-07 15:55
marcanthis is like the only coproc that has a statically allocated heap not carved out in iBoot#asahi-dev · 2023-09-07 15:55
marcanman why is apple so damn inconsistent about everything#asahi-dev · 2023-09-07 15:54
marcannot sure about the rest#asahi-dev · 2023-09-07 15:54
marcanat least the heap has to go at a specific iova, but I just took care of that one#asahi-dev · 2023-09-07 15:51
marcanI'll try to look at the DART mess next#asahi-dev · 2023-09-07 15:51
marcananyway, let me know what you think of those changes#asahi-dev · 2023-09-07 15:50
marcan(the drm stuff is more... peculiar since it's intended for GPUs)#asahi-dev · 2023-09-07 15:50
marcanbtw, why the drm_mm/manual iova management? I'm not sure if the DRM folks will want non-drm drivers using that infra, but I'd normally expect the regular kernel iommu/iova allocators to do all that for you?#asahi-dev · 2023-09-07 15:48
marcanI *think* the logic in isp.c for the heap sizes is correct for all the combinations we care about. I think. Might've guesstimated based on nearby versions :p#asahi-dev · 2023-09-07 15:47
marcanalso started adding t8112 but that's half-assed#asahi-dev · 2023-09-07 15:47
marcanthat moves the heap alloc to m1n1 which removes the slightly dodgy thing of allocating it as a surface. the driver still needs to parse the heap base+size to compute the region top, but that's not that bad.#asahi-dev · 2023-09-07 15:47
marcandidn't break it on t8103 at least :p#asahi-dev · 2023-09-07 15:47
marcaneiln: I need to get some sleep, but I pushed a bunch of stuff to m1n1 & linux under the isp/heap-alloc branch on both#asahi-dev · 2023-09-07 15:10
marcanthen that's a good reason to do it in m1n1#asahi-dev · 2023-09-07 15:10
marcanah, ew#asahi-dev · 2023-09-07 15:05
marcanlook at drivers/gpu/drm/asahi/hw/* if you want pain :p#asahi-dev · 2023-09-07 15:05
marcanit should be if it's mostly hardware stuff#asahi-dev · 2023-09-07 15:01
marcanby hardcoded values I mean apple_isp_hw_t8103 etc#asahi-dev · 2023-09-07 15:01
marcanbut it's not board type#asahi-dev · 2023-09-07 15:00
marcanthere is a register#asahi-dev · 2023-09-07 14:56
marcanstill might though#asahi-dev · 2023-09-07 14:54
marcanI'm starting to doubt whether it actually makes sense to alloc in m1n1, since you have a pile of per-hw hardcoded values in the kernel anyway#asahi-dev · 2023-09-07 14:51
marcaneiln: so I think the heap top thing is per ISP hardware rev, not per firmware#asahi-dev · 2023-09-07 13:29
marcan_jannau__: this is allocated by macOS#asahi-dev · 2023-09-07 13:28
marcan(I like putting stupid stuff in m1n1)