UDL's fbdev doesn't work for user-space apps
noralf at tronnes.org
Tue Dec 12 21:58:04 UTC 2017
Den 04.12.2017 12.32, skrev Alexey Brodkin:
> I'm trying to use DisplayLink USB2.0-to-HDMI adapter as the one and only
> video output and I want to get Xserver working on top of that.
> I'm not very familiar with all the parts of Linux GPU/video stack
> (especially its user-space counterpart) so my assumptions might be wrong
> in that case please correct me.
> My first [probably incorrect] assumption is Xserver requires fbdev (/dev/fbX)
> and it cannot use DRI video card natively. Is that correct?
> So to get /ded/fb0 with UDL I just enabled CONFIG_DRM_UDL & CONFIG_DRM_FBDEV_EMULATION.
> That gave me boot console on HDMI screen and I was full of expectations.
> But when I tried to use /dev/fb0 from whatever user-space app nothing got
> displayed on the screen... as well as no error messages appeared.
> After eyeballing at UDL code (especially in comparison with QXC which uses deferredio
> as well) I noticed that in UDL fb_deferred_io_init() is called from udl_fb_open(),
> i.e. .fb_open call-back (in other words every time user-space app opens /dev/fb0)
> while in QXC this is done only once and much earlier in qxlfb_create(), which is
> called with .fb_probe call-back. So moved fb_deferred_io_init() in UDL driver from
> udl_fb_open() to udlfb_create() which is also called from .fb_probe.
> With that change I finally got video output via fbdev from user-space app,
> but only on the first run. The next attempt to run inevitably ends with
> kernel crash showing the following stack-trace (having half of the new screen
> rendered on display):
> Stack Trace:
> random: crng init done
> I'm wondering if UDL driver (its DRM flavor) was ever tested for
> fbdev in user-space? If so and it really works for somebody
> maybe I'm doing something terribly wrong - in that case any comments
> are very welcome.
udl uses shmem buffers which doesn't work with fbdev deferred io.
They fight over page->lru and page->mapping. See this commit:
drm/udl: disable fb_defio by default
> One interesting note: it seems like pure DRI stuff works like a charm.
> I may run kmscube perfectly fine without any changes whatsoever and do it
> many times in a row.
> Thanks in advance,
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
More information about the dri-devel