#
…

2021-08-30

00:51skipwich has joined #asahi-re
01:18quarkyalice has quit [Ping timeout: 480 seconds]
01:43chadmed has joined #asahi-re
01:47chadmed has quit [Remote host closed the connection]
02:52phiologe has joined #asahi-re
02:54austriancoder has quit [Read error: Connection reset by peer]
02:55austriancoder has joined #asahi-re
02:56PhilippvK has quit [Ping timeout: 480 seconds]
02:59marcanalyssa: so actually what that rt bandwidth thing does is call function-bw_req_interrupt0 from the ADT (which is a link to elsewhere)
02:59marcanthen I think most of the structure is actually just uninitialized garbage
02:59marcanbut there are three physmem pointers returned, to registers
03:00marcanI think one is actually reg + bit
03:03marcanthis is good, I thought this was going to be some mess involving Math™
03:03marcanlooks like it's just telling it about some IRQ or something
03:10marcanturns out it was 90% uninitialized memory bullshit
03:10marcanit's just telling DCP about some registers
03:10alyssarock on !
03:10marcanI expect the bit will change for dispext, need to see where that comes from
03:11alyssathough err
03:11alyssawhy can't the dcp use sr_map_device_memory for that
03:11marcanprobably because the bit or something? this is calling out to some other RTBandwidth service
03:12marcanlook, don't try to make sense of this
03:12alyssaactually you know what i'm done trying to apply logic to this pile of hacks
03:12marcanwe know it's a mess :p
03:12marcanit's our job to stick it to apple and make the linux version orders of magnitude more beautiful ;)
03:12alyssaI want to say the mess I've produced is not that
03:13marcanit's okay, review will take care of that :D
03:13alyssathen again i can only imagine what dcp.kext looks like 😋
03:14alyssa 14 files changed, 1684 insertions(+), 18 deletions(-)
03:14alyssa^ that gets us to "hello KMS" on the DCP
03:15alyssaTomorrow will be ~~cleaning up the pile of hacks~~ adding more hacks so I get 4k@60 on linux
03:15marcanyou really care about your 4K don't you :p
03:15alyssaLook my chromebook is 2400x1600 on a laptop screen
03:16alyssaso no I am not putting up with 1080 on a 27" monitor
03:16alyssaforefront on the pile of hacks is the mess of a DT i've made
03:17alyssahave a DCP driver and a KMS driver and they are independent modules with mutual references in their private structs it's not good
03:17marcanthey should probably be a single driver tbh :p
03:17alyssathis is a kludge to workaround linux only allowing a device to have a single IOMMU
03:17alyssabecause why would a single device need multiple independent IOMMUs? :v
03:18marcanwell, you can still have different devices from Linux's point of view, managed by one driver
03:18alyssasven linked me to your clock gate thing as an example..?
03:18marcanthat's kind of different, that's multiple devices sharing one register mapping
03:18alyssathe KMS driver needs to "own" disp0 stream 0, so that way framebuffer memory can be allocated by the DRM core and be automatically mapped with no driver twiddling
03:19marcanbut I mean, you can have different drivers in one module that just happen to know about each other and share all kinds of private data
03:19alyssaon the other hand, the DCP module needs to "own" the DCP dart so the rtkit crap can just do dma_alloc_coherent properly
03:19alyssaHum, alright. That seems sane
03:20alyssain the DT is that modeled as sibling nodes or as parent/child?
03:20marcansibling nodes with a reference, like interrupt-parent and such
03:20alyssaOkay, that's what I have now
03:20marcanso pick one that will be the "parent" driver that kicks everything off, then that defers probing until everything else is probed
03:20alyssaalthough then I needed deferred probe nonsense --- yeah
03:20marcanyeah I think this is all kosher
03:21alyssaalright, won't worry so much then
03:21marcanthis is how apple does it anyway so...
03:21marcanthere's prior art there too :p
03:21marcan(just they make a mess of it)
03:22alyssa+ /* XXX: need to validate the DCP is allowed to access */
03:22alyssaoh meant to ask about this
03:22marcanfor mappings?
03:22alyssamap_physical, the DCP only calls it with disp0 regs, yeah?
03:23alyssa(Obviously letting a copro map whatever memory it wants defeats the purpose of having an IOMMU)
03:23marcanit only call it right after sr_mapDeviceMemoryWithIndex(PROV, 4, 256, 0x23b3d0000, 0x4000)
03:23marcanwhich is looking up disp0, yes
03:24marcanso we should just check that it's one of the disp0 ranges I guess
03:24marcanpossibly a subset
03:25marcanin this case it's disp0 index 4, though for us that might be a different index, in which case we'd want a mapping table anyway
03:25alyssathat's what I assumed but am trying to check my assumptions off you since you complained I don't ask enough questions 😋
03:25alyssaI see no reason not to just include the regs in Apple order in the DT
03:25marcandepends on what they do and what sense they make
03:25alyssasince AFAIK we have no reason to touch those registers ourselves ever
03:25marcanapple do some insane stuff with reg ranges
03:25marcanlike mapping pmgr stuff in every goddamn device
03:26marcanalso we *might* end up doing hacks on disp0 regs eventually
03:26marcanbut for now you can just use the same ranges, sure
03:26marcaneventually I'd probably want a mapping table
03:26marcanlike {4, <reference to what we call that range>} and then the map call can just check that what is being mapped is something in that table (resolved)
03:27alyssa<reference> being a reference to a DT name/index/handle/whatever?
03:27alyssa(so the regs are still in the DT, not hardcoded)
03:27marcanyeah, however we choose to represent it
03:27marcancould just be an offset from disp0 base or some disp0 subrange or whatever
03:27alyssaof the disp0 regs only suspicious one is
03:27alyssa addr = 0x0000000071800000
03:27alyssa size = 0x0000000000800000, Container:
03:28marcanI don't see that in disp0?
03:28alyssaoh er that was dispext0 i'm tired
03:28alyssa addr = 0x0000000031800000
03:28alyssa size = 0x0000000000800000, Container:
03:29marcan0x231800000.... is DCP
03:29marcan0x230000000..... is disp0
03:29marcansee the big comment at the top of dcp.py
03:29marcanI did some snooping on the reg ranges
03:29marcansee what I said about the regs being a mess?
03:29marcanapple seriously doesn't care, they have drivers poking other devices' registers *everywhere*
03:30alyssa....I feel better about my own code now
03:31marcanbbl, lunch :p
03:33alyssabbl sleep :p
04:31thunfisch has quit [Quit: frrrp!]
04:39thunfisch has joined #asahi-re
12:07Emantor has quit [Quit: ZNC - http://znc.in]
12:07Emantor has joined #asahi-re
13:30jbowen has joined #asahi-re
14:05yuyichao has quit [Ping timeout: 480 seconds]
14:37PhilippvK has joined #asahi-re
14:40phiologe has quit [Ping timeout: 480 seconds]
16:37X-Scale has joined #asahi-re
16:46skoobasteeve_ has joined #asahi-re
16:51skoobasteeve has quit [Ping timeout: 480 seconds]
17:02phiologe has joined #asahi-re
17:05PhilippvK has quit [Ping timeout: 480 seconds]
17:12PhilippvK has joined #asahi-re
17:15phiologe has quit [Ping timeout: 480 seconds]
23:35riker77_ has joined #asahi-re
23:37riker77 has quit [Ping timeout: 480 seconds]
23:37riker77_ is now known as riker77
…