pbrobinson__ has quit [Remote host closed the connection]
pbrobinson has joined #panfrost
Googulator has joined #panfrost
<Googulator>
Not directly Panfrost-related, but since most development of pancsf is happening on RK3588, I'm asking here: what's the planned way forward with VOP2 support in mainline?
<Googulator>
Right now, we have ported versions of VOP2 and its associated drivers in bbrezillon 's tree, as well as in midstream, but there's a different VOP2 driver in mainline that stands in the way.
f11f12 has quit [Quit: Leaving]
<bbrezillon>
Googulator: the VOP2 + HDMI stuff in my tree are really just hacks
<Googulator>
I don't know if it's feasible to make it any less of a hack
<Googulator>
(if by "hack" you mean it's not a proper continuation of the upstream version's history)
<bbrezillon>
I can't tell when this will happen, but the plan is to extend existing drivers (dw-hdmi + rockchip VOP2) to support what we want to support
<Googulator>
I looked into that, but it seems very problematic in the case of VOP2
<Googulator>
(HDMI is doable)
<bbrezillon>
by hack I mean rockchip has forked the drivers and heavily diverged from the upstream version, and what I did was just copy the drivers and get it to work on 6.something
<bbrezillon>
what's the problem with VOP2?
<Googulator>
Upstream VOP2 isn't merely divergent, it has no obvious common history with the downstream one
<CounterPillow>
because downstream vop2 was first and then someone at pengutronix made a cleaned up upstream vop2
<Googulator>
Several years ago, Rockchip upstreamed a minimal, gutted version of the original VOP driver, with only basic features kept
<Googulator>
Then someone (pengutronix?) added support for RK356x VOP2 (but not RK3588) to that driver
<bbrezillon>
sure, I meant, what makes it impossible to extend the upstream VOP2 driver to support the use cases supported by the downstream one?
<Googulator>
The downstream driver heavily relies on those features of the common VOP1/2 driver that were cut from upstream
Danct12 has joined #panfrost
<bbrezillon>
you shouldn't think in term of "how can I port the downstream driver to upstream kernels?", but rather "how can I port a specific feature I need to the upstream kernel, and port it in a way that make it acceptable upstream"
<CounterPillow>
^
<bbrezillon>
same goes for dw-hdmi-qp, we certainly don't want to fork dw-hdmi as they did
<Googulator>
My issue is, the original downstream driver, pre-gutting, would now probably be acceptable, since the formerly Android-exclusive DRM/DRI features that probably lead to a gutted version being submitted, are all now upstreamed
<CounterPillow>
hahahahahaa no it wouldn't be
<bbrezillon>
and for the samsung hdmi-phy, we probably want to abstract hdmi phys through the phy framework, so the dw-hdmi driver can use a phy that's not designware
<CounterPillow>
1. it doesn't use regmaps properly iirc, 2. they messed up locking, 3. they include half a clock driver in the middle of it as a C file just to do some calculations
<robmur01>
dw-hdmi-rockchip has already been wanting to support external phys *properly* since RK3328...
<bbrezillon>
4. It's not using the DRM API correctly :-)
<CounterPillow>
right, it was some half-atomic thing
<Googulator>
(by the original downstream driver, I mean VOP/VOP2, not HDMI)
<CounterPillow>
yes we understood that
<bbrezillon>
Googulator: sure, I was just pointing out that porting dw-hdmi-qp is not as trivial as you might think
<bbrezillon>
because we don't want it done the way it's done in the downstream tree
<bbrezillon>
(or in my hacky branch)
<Googulator>
For HDMI, I agree, extending the existing upstream driver is probably the way to go
<Googulator>
But with VOP2, while it may be possible to extend the current upstream one to support _some_ of the RK3588's functionality, I don't see it ever reaching parity with the downstream driver
<bbrezillon>
hence my original question, what makes it impossible to port downstream VOP2 features to upstream VOP2 driver?
<CounterPillow>
If you think making downstream VOP2 conform to upstream standards is easier than implementing RK3588 support for upstream VOP2 then your calibration on that is way off.
<bbrezillon>
the key here is to incrementally add features to upstream VOP2 so it eventually reaches the feature-set available in rockchip's downstream driver
<Googulator>
The problem is, we don't even really know what's missing
<Googulator>
Because it was stripped down without any history surviving
<CounterPillow>
You have to read the code to port things usually, yes.
<bbrezillon>
yeah, what CounterPillow said, read the code, read the TRMs, and port the features you need
<bbrezillon>
not the ones you might want to support one day
<bbrezillon>
of course, that doesn't mean you shouldn't plan for those advanced features
<bbrezillon>
but trying to port all the features at once is the best way to get burnt
<CounterPillow>
And if you submit code for upstream inclusion, you need to be able to justify the code's existence and correctness, which means you need to understand the code, at which point you can just add the feature to upstream vop2 anyway.
<robmur01>
bbrezillon: looks OK at a glance, although if it were me I'd be inclined to refactor a bit harder to just pass data through to __arm_lpae_alloc_pages() instead of cfg+cookie (more consistent with previous changes)
<robmur01>
undecided about the amount of sanity-checking, but we can revisit that once we get as far as proper review :)
pbrobinson has quit [Ping timeout: 480 seconds]
pbrobinson has joined #panfrost
Mangy_Dog has quit [Remote host closed the connection]
<bbrezillon>
robmur01: I tried that, and it didn't work because iop is allocated in the io-pgtable backend, but iop->{cfg,cookie,fmt} is initialized by the core in alloc_io_pgtable_ops() after the backend ->alloc() function returns
<robmur01>
Oh, right, because we allocate the pgd up-front from there. Oh well. :(
<bbrezillon>
I mean, I could add an extra iop->{cfg,cookie} = *cfg,cookie in the arm pgtable driver, but I wasn't sure
<bbrezillon>
re sanity checking => that's mostly here to catch iommu drivers trying to pass custom allocators to a pgtable driver that doesn't support it
<bbrezillon>
I guess that's just based on personal experience trying to figure out why my code doesn't work when I'm actually trying to use a feature that's not supported but the framework lets pass the feature flag/props without complaining :-)
<bbrezillon>
I'll probably post those patches along with the panthor patches
Googulator has quit [Read error: Connection reset by peer]