On 11/08/2023 20:26, Robin Murphy wrote: > On 2023-08-11 17:56, Daniel Stone wrote: >> Hi, >> >> On 11/08/2023 17:35, Robin Murphy wrote: >>> On 2023-08-09 17:53, Boris Brezillon wrote: >>>> +obj-$(CONFIG_DRM_PANTHOR) += panthor.o >>> >>> FWIW I still think it would be nice to have a minor >>> directory/Kconfig/Makefile reshuffle and a trivial bit of extra >>> registration glue to build both drivers into a single module. It >>> seems like it could be a perpetual source of confusion to end users >>> where Mesa "panfrost" is the right option but kernel "panfrost" is >>> the wrong one. Especially when pretty much every other GPU driver is >>> also just one big top-level module to load for many different >>> generations of hardware. Plus it would mean that if someone did want >>> to have a go at deduplicating the resource-wrangling boilerplate for >>> OPPs etc. in future, there's more chance of being able to do so >>> meaningfully. >> >> It might be nice to point it out, but to be fair Intel and AMD both >> have two (or more) drivers, as does Broadcom/RPi. As does, err ... Mali. > > Indeed, I didn't mean to imply that I'm not aware that e.g. gma500 is to > i915 what lima is to panfrost. It was more that unlike the others where > there's a pretty clear line in the sand between "driver for old > hardware" and "driver for the majority of recent hardware", this one > happens to fall splat in the middle of the current major generation such > that panfrost is the correct module for Mali Bifrost but also the wrong > one for Mali Bifrost... :/ Well panfrost.ko is the correct module for all Bifrost ;) It's Valhall that's the confusing one. I would hope that for most users they can just build both panfrost and panthor and everything will "Just Work (tm)". I'm not sure how much users are actually aware of the architecture family of their GPU. I think at the moment (until marketing mess it up) there's also the 'simple' rule: * Mali T* is Midgard and supported by panfrost.ko * Mali Gxx (two digits) is Bifrost or first-generation Valhall and supported by panfrost.ko * Mali Gxxx (three digits) is Valhall CSF and supported by panthor. (and Immortalis is always three digits and Valhall CSF). > >> I can see the point, but otoh if someone's managed to build all the >> right regulator/clock/etc modules to get a working system, they'll >> probably manage to figure teh GPU side out? > > Maybe; either way I guess it's not really my concern, since I'm the only > user that *I* have to support, and I do already understand it. From the > upstream perspective I mostly just want to hold on to the hope of not > having to write my io-pgtable bugs twice over if at all possible :) I agree it would be nice to merge some of the common code, I'm hoping this is something that might be possible in the future. But at the moment the focus is on trying to get basic support for the new GPUs without the danger of regressing the old GPUs. And, to be honest, for a fair bit of the common code in panfrost/panthorm it's common to a few other drivers too. So the correct answer might well be to try to add more generic helpers (devfreq, clocks, power domains all spring to mind - there's a lot of boiler plate and nothing very special about Mali). Steve