Hi,
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:
mixer0:
first Xorg run:
0x01101000 : 00000201
0x01101080 : 00000030
BLD_FILL_COLOR_CTL: (aka SUN8I_MIXER_BLEND_PIPE_CTL)
P1_EN
BLD_CH_RTCTL: (aka SUN8I_MIXER_BLEND_ROUTE)
P0_RTCTL channel0
P1_RTCTL channel3
after switch to console and back to Xorg:
0x01101000 : 00000301
0x01101080 : 00000031
BLD_FILL_COLOR_CTL:
P1_EN and P0_EN
BLD_CH_RTCTL:
P0_RTCTL channel1
P1_RTCTL channel3
This is despite the layers config being exactly the same as indicated
in /sys/kernel/debug/dri/0/{state,framebuffer}.
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:
https://megous.com/git/linux/commit/?h=private-5.3&id=c186b256a869bab09103075a133f3c0d5f7b48cc
https://megous.com/git/linux/commit/?h=private-5.3&id=5af208e90de5ced30350fc0fba8419e9662e9bb7
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.
regards,
o.
> To view this discussion on the web, visit
https://groups.google.com/d/msgid/linux-sunxi/20190907222145.4yfa6qy2uwjlkrut%40core.my.home.