On Sun, Sep 08, 2019 at 12:21:45AM +0200, megous hlavni wrote:
> On Thu, Sep 05, 2019 at 06:30:42PM -0700, 张宁 wrote:
> > Update my test result:
> > 1, use 1st UI layer as primary plane and 3rd UI layer as cursor plane.
> > display normally but slow with fbdev
> > display abnormally (only cursor shows) with modesetting (lima enabled)
> You can "fix" this by switching to console and back. I've debugged this
> somewhat and it the sun4i drm driver is probably buggy. The drm layers/
> framebuffers are exactly same before and after the switch.
> I have not yet dumped mixer registers before/after, but I suspect, there
> will be some difference, for whatever reason.
So I have dumped registers, and found out this:
first Xorg run:
0x01101000 : 00000201
0x01101080 : 00000030
BLD_FILL_COLOR_CTL: (aka SUN8I_MIXER_BLEND_PIPE_CTL)
BLD_CH_RTCTL: (aka SUN8I_MIXER_BLEND_ROUTE)
after switch to console and back to Xorg:
0x01101000 : 00000301
0x01101080 : 00000031
P1_EN and P0_EN
This is despite the layers config being exactly the same as indicated
sun4i-drm driver just doesn't handle layer change correctly in all cases.
For example when enabling a layer, it may disable a different layer if
old_zpos matches the zpos of the other layer.
I've made a fix for this:
So with these two patches, Xorg server/modesetting driver will use the cursor
plane, and plane enable/switching issues are gone (in general, even if you
don't use the cursor plane patch).
Anyway, this makes Xorg server work nicely with lima/panfrost without the
need to hack Xorg's modesetting driver to use non-cursor plane for cursor.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20190907222145.4yfa6qy2uwjlkrut%40core.my.home