Skip to contentSkip to conversation

fbdev: Remove udlfb driver

PATCH In review Thomas Zimmermann 5 participants 15 messages Nov 30, 2020 – Dec 2, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: Remove udlfb driver

Udlfb has been superseded by DRM's udl. The DRM driver is better by any means and actively maintained. Remove udlfb.

---
 CREDITS                      |    5 +
 Documentation/fb/index.rst   |    1 -
 Documentation/fb/udlfb.rst   |  162 ---
 MAINTAINERS                  |    9 -
 drivers/video/fbdev/Kconfig  |   17 +-
 drivers/video/fbdev/Makefile |    1 -
 drivers/video/fbdev/udlfb.c  | 1994 ----------------------------------
 7 files changed, 6 insertions(+), 2183 deletions(-)
 delete mode 100644 Documentation/fb/udlfb.rst
 delete mode 100644 drivers/video/fbdev/udlfb.c
CREDITS +5 -0
index 748301954ab7..fed3518c4dd8 100644
@@ -3620,6 +3620,11 @@ S: 145 Howard St.
 S: Northborough, MA 01532
 S: USA
 
+N: Bernie Thompson
+E: [email protected]
+W: http://plugable.com/category/projects/udlfb/
+D: DisplayLink USB 2.0 framebuffer driver
+
 N: Doug Thompson
 E: [email protected]
 D: EDAC
Documentation/fb/index.rst +0 -1
index baf02393d8ee..8136c84328e2 100644
@@ -36,7 +36,6 @@ Frame Buffer
     sstfb
     tgafb
     tridentfb
-    udlfb
     uvesafb
     vesafb
     viafb
Documentation/fb/udlfb.rst deleted +0 -162

162 lines not on this page · raw message

MAINTAINERS +0 -9
index c5a399541d6a..2b445f87e1ef 100644
@@ -5178,15 +5178,6 @@ F:	fs/quota/
 F:	include/linux/quota*.h
 F:	include/uapi/linux/quota*.h
 
-DISPLAYLINK USB 2.0 FRAMEBUFFER DRIVER (UDLFB)
-M:	Bernie Thompson <[email protected]>
-L:	[email protected]
-S:	Maintained
-W:	http://plugable.com/category/projects/udlfb/
-F:	Documentation/fb/udlfb.rst
-F:	drivers/video/fbdev/udlfb.c
-F:	include/video/udlfb.h
-
 DISTRIBUTED LOCK MANAGER (DLM)
 M:	Christine Caulfield <[email protected]>
 M:	David Teigland <[email protected]>
drivers/video/fbdev/Kconfig +1 -16
index 4f02db65dede..41189b31c5d6 100644
@@ -558,7 +558,7 @@ config FB_STI
 	  BIOS routines contained in a ROM chip in HP PA-RISC based machines.
 	  Enabling this option will implement the linux framebuffer device
 	  using calls to the STI BIOS routines for initialisation.
-	
+
 	  If you enable this option, you will get a planar framebuffer device
 	  /dev/fb which will work on the most common HP graphic cards of the
 	  NGLE family, including the artist chips (in the 7xx and Bxxx series),
@@ -1939,21 +1939,6 @@ config FB_SMSCUFX
 	  (USB 3.0) devices.
 	  To compile as a module, choose M here: the module name is smscufx.
 
-config FB_UDL
-	tristate "Displaylink USB Framebuffer support"
-	depends on FB && USB
-	select FB_MODE_HELPERS
-	select FB_SYS_FILLRECT
-	select FB_SYS_COPYAREA
-	select FB_SYS_IMAGEBLIT
-	select FB_SYS_FOPS
-	select FB_DEFERRED_IO
-	help
-	  This is a kernel framebuffer driver for DisplayLink USB devices.
-	  Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and
-	  mplayer -vo fbdev. Supports all USB 2.0 era DisplayLink devices.
-	  To compile as a module, choose M here: the module name is udlfb.
-
 config FB_IBM_GXT4500
 	tristate "Framebuffer support for IBM GXT4000P/4500P/6000P/6500P adaptors"
 	depends on FB
drivers/video/fbdev/Makefile +0 -1
index 477b9624b703..49b5dd0bef02 100644
@@ -106,7 +106,6 @@ obj-$(CONFIG_FB_COBALT)           += cobalt_lcdfb.o
 obj-$(CONFIG_FB_IBM_GXT4500)	  += gxt4500.o
 obj-$(CONFIG_FB_PS3)		  += ps3fb.o
 obj-$(CONFIG_FB_SM501)            += sm501fb.o
-obj-$(CONFIG_FB_UDL)		  += udlfb.o
 obj-$(CONFIG_FB_SMSCUFX)	  += smscufx.o
 obj-$(CONFIG_FB_XILINX)           += xilinxfb.o
 obj-$(CONFIG_FB_SH_MOBILE_LCDC)	  += sh_mobile_lcdcfb.o
drivers/video/fbdev/udlfb.c deleted +0 -1994

1,994 lines not on this page · raw message

Signature · 6 lines
2.29.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 2 lines · Thomas Zimmermann

Udlfb has been superseded by DRM's udl. The DRM driver is better by any means and actively maintained. Remove udlfb.

Hi

I am using udlfb and it's definitely better than the DRM driver. The DRM driver will crash the kernel if you unplug the device while Xorg is running. The framebuffer driver doesn't crash in this case. (I have a cat and the cat sometimes unplugs cables and I don't want to reboot the system because of it :-)

The framebuffer driver is faster, it keeps back buffer and updates only data that differ between the front and back buffer. The DRM driver doesn't have such optimization, it will update everything in a given rectangle - this increases USB traffic and makes video playback more jerky.

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

If you seach for someone to maintain the framebuffer driver, I can do it.

Mikulas

Quoted 12 lines
---
 CREDITS                      |    5 +
 Documentation/fb/index.rst   |    1 -
 Documentation/fb/udlfb.rst   |  162 ---
 MAINTAINERS                  |    9 -
 drivers/video/fbdev/Kconfig  |   17 +-
 drivers/video/fbdev/Makefile |    1 -
 drivers/video/fbdev/udlfb.c  | 1994 ----------------------------------
 7 files changed, 6 insertions(+), 2183 deletions(-)
 delete mode 100644 Documentation/fb/udlfb.rst
 delete mode 100644 drivers/video/fbdev/udlfb.c

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 7 lines · Mikulas Patocka
Quoted 2 lines · Thomas Zimmermann

Udlfb has been superseded by DRM's udl. The DRM driver is better by any means and actively maintained. Remove udlfb.

Quoted 7 lines

Hi

I am using udlfb and it's definitely better than the DRM driver. The DRM driver will crash the kernel if you unplug the device while Xorg is running. The framebuffer driver doesn't crash in this case. (I have a cat and the cat sometimes unplugs cables and I don't want to reboot the system because of it :-)

This should be a lot better in recent kernels, there's been tons of fixes for drm hotunplug. Might be there's still bugs in the drm/udl driver.

Quoted 9 lines

The framebuffer driver is faster, it keeps back buffer and updates only data that differ between the front and back buffer. The DRM driver doesn't have such optimization, it will update everything in a given rectangle - this increases USB traffic and makes video playback more jerky.

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

Quoted 1 line

If you seach for someone to maintain the framebuffer driver, I can do it.

We're looking for people to port the missing features over to the drm drivers. The problem is that fbdev is full of security bugs, and we're fixing them by removing the features. So that's why there's some push to sunset at much as possible.
-Daniel

Quoted 21 lines

Mikulas

Quoted 12 lines
---
 CREDITS                      |    5 +
 Documentation/fb/index.rst   |    1 -
 Documentation/fb/udlfb.rst   |  162 ---
 MAINTAINERS                  |    9 -
 drivers/video/fbdev/Kconfig  |   17 +-
 drivers/video/fbdev/Makefile |    1 -
 drivers/video/fbdev/udlfb.c  | 1994 ----------------------------------
 7 files changed, 6 insertions(+), 2183 deletions(-)
 delete mode 100644 Documentation/fb/udlfb.rst
 delete mode 100644 drivers/video/fbdev/udlfb.c

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 9 lines · Daniel Vetter
Quoted 5 lines · Mikulas Patocka

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

Mikulas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 11 lines · Mikulas Patocka
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Mikulas Patocka

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Quoted 8 lines
Quoted 2 lines

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

The generic fbdev emulation still has a defio implementation. We could try to make it more efficient maybe, but it should be all there. The module option disappeared since you now should always get it by default.

Quoted 3 lines

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

Now I'm confused, I thought you wanted to use fbdev /dev/fb* nodes? Those should support defio. And if you want your applications to use drm modesetting natively, they have to be drm master anyway. You can't use the DIRTYFB ioctl to upload fbdev contents. So I'm a bit confused. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 18 lines · Daniel Vetter
Quoted 17 lines · Mikulas Patocka
Quoted 9 lines · Daniel Vetter
Quoted 5 lines · Mikulas Patocka

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

Quoted 6 lines
Quoted 2 lines

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

The generic fbdev emulation still has a defio implementation. We could try to make it more efficient maybe, but it should be all there. The module option disappeared since you now should always get it by default.

Yes, it's there. I've tried to run links on the current DRM UDL driver and it displays correctly - except, that the page list gets sometimes corrupted and a crash happens.

Quoted 9 lines
Quoted 3 lines

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

Now I'm confused, I thought you wanted to use fbdev /dev/fb* nodes? Those should support defio. And if you want your applications to use drm modesetting natively, they have to be drm master anyway. You can't use the DIRTYFB ioctl to upload fbdev contents. So I'm a bit confused. -Daniel

Yes. I was confused about it too. You can't use DRM ioctls on /dev/fb.

Mikulas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to Mikulas Patocka

Hi

Am 30.11.20 um 19:39 schrieb Mikulas Patocka:

Quoted 17 lines · Daniel Vetter
Quoted 10 lines · Mikulas Patocka
Quoted 5 lines

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

Quoted 7 lines

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

That's confusing. DIRTYFB is only for DRM.

And why can links not run as DRM master mode? If it renders to the terminal, it should act like a composer. In that case it almost certainly wants master status.

Best regards
Thomas

Quoted 3 lines

Mikulas

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
Quoted 24 lines · Thomas Zimmermann

Hi

Am 30.11.20 um 19:39 schrieb Mikulas Patocka:

Quoted 21 lines · Daniel Vetter
Quoted 10 lines · Mikulas Patocka
Quoted 5 lines

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

Quoted 5 lines
Quoted 3 lines

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

That's confusing. DIRTYFB is only for DRM.

Yes, you're right.

Quoted 6 lines

And why can links not run as DRM master mode? If it renders to the terminal, it should act like a composer. In that case it almost certainly wants master status.

Best regards
Thomas

How can a userspace program acquire master mode without being suid?

Is there some "Hello World!" program that shows how to use DRM? I'm not an expert in DRM, but if there were some tutorial+documentation, I could consider porting "links" to it.

Mikulas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Hi

Am 01.12.20 um 12:20 schrieb Mikulas Patocka:

Quoted 36 lines · Thomas Zimmermann
Quoted 25 lines

Hi

Am 30.11.20 um 19:39 schrieb Mikulas Patocka:

Quoted 21 lines · Daniel Vetter
Quoted 10 lines · Mikulas Patocka
Quoted 5 lines

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

Quoted 5 lines
Quoted 3 lines

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

That's confusing. DIRTYFB is only for DRM.

Yes, you're right.

Quoted 8 lines
Quoted 6 lines

And why can links not run as DRM master mode? If it renders to the terminal, it should act like a composer. In that case it almost certainly wants master status.

Best regards
Thomas

How can a userspace program acquire master mode without being suid?

For my understanding, there's no easy solution to that. :/

I guess we (DRM devs) have to treat fbdev as the solution for use cases such as ours.

For the unplug issue, I'll try to reproduce and fix it.

For the performance problems, we might be able to squeeze a few more cycles out of it.

Best regards
Thomas

Quoted 7 lines

Is there some "Hello World!" program that shows how to use DRM? I'm not an expert in DRM, but if there were some tutorial+documentation, I could consider porting "links" to it.

Mikulas

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

Am 02.12.20 um 08:55 schrieb Thomas Zimmermann:

Quoted 43 lines

Hi

Am 01.12.20 um 12:20 schrieb Mikulas Patocka:

Quoted 40 lines · Thomas Zimmermann
Quoted 25 lines

Hi

Am 30.11.20 um 19:39 schrieb Mikulas Patocka:

Quoted 21 lines · Daniel Vetter
Quoted 10 lines · Mikulas Patocka
Quoted 5 lines

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

Quoted 5 lines
Quoted 3 lines

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

That's confusing. DIRTYFB is only for DRM.

Yes, you're right.

Quoted 4 lines

And why can links not run as DRM master mode? If it renders to the terminal, it should act like a composer. In that case it almost certainly wants master status.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Best regards
Thomas

How can a userspace program acquire master mode without being suid?

For my understanding, there's no easy solution to that. :/

I guess we (DRM devs) have to treat fbdev as the solution for use cases such as ours.

s/ours/yours

Quoted 16 lines

For the unplug issue, I'll try to reproduce and fix it.

For the performance problems, we might be able to squeeze a few more cycles out of it.

Best regards
Thomas

Quoted 7 lines

Is there some "Hello World!" program that shows how to use DRM? I'm not an expert in DRM, but if there were some tutorial+documentation, I could consider porting "links" to it.

Mikulas

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to Thomas Zimmermann
Quoted 7 lines · On Wed, 2 Dec 2020 08:55:52 +0100 Thomas Zimmermann <[email protected]> wrote:

Hi

Am 01.12.20 um 12:20 schrieb Mikulas Patocka:

Quoted 4 lines · Thomas Zimmermann

...

Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

And why can links not run as DRM master mode? If it renders to the terminal, it should act like a composer. In that case it almost certainly wants master status.

Best regards
Thomas

How can a userspace program acquire master mode without being suid?

For my understanding, there's no easy solution to that. :/

Hi,

there are several ways, though whether they are "easy" depends on your mindset.

The best thing is to connect to logind D-Bus API and ask that for session control, set up your session, and logind will open all input and DRM devices for you, and logind will even handle most of the complicated setup, DRM master and VT-switching for you.

Or, if no-one else has the DRM device open and you open it, you automatically become DRM master. AFAIU, after recent kernel changes, it is even possible to use dropMaster and setMaster after this without being root, as long as you once in the file description lifetime had DRM master.

Since this is about switching from fbdev to KMS API, you already have all the tricky, complicated, arcane code to deal with tty setup and VT-switching.

However, doing all that patching to all apps you want to use is such an effort, that I'd ask if it would not be easier to just run a light-weight Wayland compositor and run your apps in Wayland mode. Of course, that requires choosing apps that run on Wayland to begin with, so maybe it's not for you.

Thanks,
pq

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
In reply to Thomas Zimmermann
Quoted 44 lines · Thomas Zimmermann

Hi

Am 01.12.20 um 12:20 schrieb Mikulas Patocka:

Quoted 40 lines · Thomas Zimmermann
Quoted 25 lines

Hi

Am 30.11.20 um 19:39 schrieb Mikulas Patocka:

Quoted 21 lines · Daniel Vetter
Quoted 10 lines · Mikulas Patocka
Quoted 5 lines

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

Hm this should in general work on drm drivers. Without that it's clear the switch-over isn't really ready yet.

I fixed it with this patch two years ago:
https://lists.freedesktop.org/archives/dri-devel/2018-June/179023.html

But the patch never went through and the fb_defio feature was removed in the kernel 5.6 (commit d0c4fc5a4814e431c15272935c8dc973c18073aa).

Quoted 5 lines
Quoted 3 lines

Without fb_defio, the only other possibility how to update the screen is the ioctl DRM_IOCTL_MODE_DIRTYFB. But this ioctl requires master mode, so user programs like "links -g" can't issue it.

That's confusing. DIRTYFB is only for DRM.

Yes, you're right.

Quoted 4 lines

And why can links not run as DRM master mode? If it renders to the terminal, it should act like a composer. In that case it almost certainly wants master status.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Best regards
Thomas

How can a userspace program acquire master mode without being suid?

For my understanding, there's no easy solution to that. :/

If you're absolutely the only thing running, the first one to open the card* node wins. But usually you have something like logind managing this for you (for vt switching), since ad-hoc this is a very fragile scheme.

I'm not exactly sure how logind gives you an already opened drm device in master mode, that's a bit tricky. Without either being suid root or participating in the logind scheme you won't be able to vt switch though.

But bare metal kms usage should work I as-is.
-Daniel

Quoted 28 lines

I guess we (DRM devs) have to treat fbdev as the solution for use cases such as ours.

For the unplug issue, I'll try to reproduce and fix it.

For the performance problems, we might be able to squeeze a few more cycles out of it.

Best regards
Thomas

Quoted 7 lines

Is there some "Hello World!" program that shows how to use DRM? I'm not an expert in DRM, but if there were some tutorial+documentation, I could consider porting "links" to it.

Mikulas

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw
In reply to Mikulas Patocka

Hi

Am 30.11.20 um 15:31 schrieb Mikulas Patocka:

Quoted 7 lines · Thomas Zimmermann
Quoted 3 lines

Udlfb has been superseded by DRM's udl. The DRM driver is better by any means and actively maintained. Remove udlfb.

Quoted 7 lines

Hi

I am using udlfb and it's definitely better than the DRM driver. The DRM driver will crash the kernel if you unplug the device while Xorg is running. The framebuffer driver doesn't crash in this case. (I have a cat and the cat sometimes unplugs cables and I don't want to reboot the system because of it :-)

What's the exact STR here? Just open the /dev/fb* and pull the cable.

Do I need a cat? :)

Quoted 4 lines

The framebuffer driver is faster, it keeps back buffer and updates only data that differ between the front and back buffer. The DRM driver doesn't have such optimization, it will update everything in a given rectangle - this increases USB traffic and makes video playback more jerky.

That's not quite true, but not false either. I think we could optimize what we have.

Quoted 5 lines

The framebuffer driver supports programs running full-screen directly on the framebuffer console, such as web browser "links -g", image viewer "fbi", postscript+pdf viewer "fbgs", ZX Spectrum emulator "fuse-sdl", movie player "mplayer -vo fbdev". The DRM driver doesn't run them.

I would expect that most programs have an SDL2 backend. (?) IIRC SDL2 has support for DRI interfaces.

Quoted 2 lines

If you seach for someone to maintain the framebuffer driver, I can do it.

I'm looking for reasons why udlfb is still around. What I got from this thread is the possible crash and a lack of DRM's fbdev performance. Thanks for the feedback.

Best regards
Thomas

Quoted 17 lines

Mikulas

Quoted 12 lines
---
  CREDITS                      |    5 +
  Documentation/fb/index.rst   |    1 -
  Documentation/fb/udlfb.rst   |  162 ---
  MAINTAINERS                  |    9 -
  drivers/video/fbdev/Kconfig  |   17 +-
  drivers/video/fbdev/Makefile |    1 -
  drivers/video/fbdev/udlfb.c  | 1994 ----------------------------------
  7 files changed, 6 insertions(+), 2183 deletions(-)

delete mode 100644 Documentation/fb/udlfb.rst
delete mode 100644 drivers/video/fbdev/udlfb.c

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
Quoted 18 lines · Thomas Zimmermann

Hi

Am 30.11.20 um 15:31 schrieb Mikulas Patocka:

Quoted 7 lines · Thomas Zimmermann
Quoted 3 lines

Udlfb has been superseded by DRM's udl. The DRM driver is better by any means and actively maintained. Remove udlfb.

Quoted 7 lines

Hi

I am using udlfb and it's definitely better than the DRM driver. The DRM driver will crash the kernel if you unplug the device while Xorg is running. The framebuffer driver doesn't crash in this case. (I have a cat and the cat sometimes unplugs cables and I don't want to reboot the system because of it :-)

Quoted 3 lines

What's the exact STR here? Just open the /dev/fb* and pull the cable.

Do I need a cat? :)

When I run links -g on the DRM driver, it works at first, but after some unplug/plug I got this:

[  282.174963] general protection fault, probably for non-canonical address 0xdead0000000000f8: 0000 [#1] PREEMPT SMP
[  282.177439] CPU: 9 PID: 3377 Comm: links Not tainted 5.10.0-rc6 #1
[  282.178843] Hardware name: empty empty/S3992-E, BIOS 'V1.06   ' 06/09/2009
[  282.180325] RIP: 0010:fb_deferred_io_mkwrite+0x7c/0x100 [fb]
[  282.181865] Code: ff 83 e2 01 48 0f 44 c3 f0 48 0f ba 28 00 0f 82 83 00 00 00 49 8b 45 28 49 39 c4 48 8d 50 f8 74 5d 48 39 d3 74 1c 48 8b 4b 20 <48> 39 4a 20 77 4e 48 8b 42 08 4c 39 e0 48 8d 50 f8 74 41 48 39 d3
[  282.185341] RSP: 0000:ffff888348293de8 EFLAGS: 00010216
[  282.187166] RAX: dead000000000100 RBX: ffffea0004182980 RCX: 0000000000000000
[  282.189071] RDX: dead0000000000f8 RSI: 0000000000000801 RDI: ffffffffa045c048
[  282.191021] RBP: ffff888106af1c00 R08: 000000005fc6128b R09: 000000003626d41e
[  282.193006] R10: 0000000000000008 R11: ffff88a04fffc000 R12: ffffffffa045c068
[  282.195015] R13: ffffffffa045c040 R14: ffffffffa045c048 R15: fff000003fffffff
[  282.197077] FS:  00007fa64cbf4a00(0000) GS:ffff88a00fcc0000(0000) knlGS:0000000000000000
[  282.199293] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  282.201484] CR2: 00007fa63f272008 CR3: 000000105b2e0000 CR4: 00000000000006e0
[  282.203728] Call Trace:
[  282.205927]  do_page_mkwrite+0x56/0xc0
[  282.208125]  ? __do_fault+0x2d/0xe0
[  282.210257]  handle_mm_fault+0xafc/0x15e0
[  282.212350]  exc_page_fault+0x1ac/0x4a0
[  282.214408]  ? asm_exc_page_fault+0x8/0x30
[  282.216473]  asm_exc_page_fault+0x1e/0x30
[  282.218462] RIP: 0033:0x7fa64641f3a8
[  282.220469] Code: c3 48 81 fa 00 08 00 00 77 a8 48 83 fa 40 77 16 f3 0f 7f 07 f3 0f 7f 47 10 f3 0f 7f 44 17 f0 f3 0f 7f 44 17 e0 c3 48 8d 4f 40 <f3> 0f 7f 07 48 83 e1 c0 f3 0f 7f 44 17 f0 f3 0f 7f 47 10 f3 0f 7f
[  282.224730] RSP: 002b:00007ffe6da66ba8 EFLAGS: 00010206
[  282.226881] RAX: 00007fa63f272000 RBX: 00007fa64cbf4990 RCX: 00007fa63f272040
[  282.229094] RDX: 00000000003f4800 RSI: 0000000000000000 RDI: 00007fa63f272000
[  282.231339] RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffffffffffff
[  282.233614] R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000f00
[  282.235927] R13: 00000000003f4800 R14: 00000000003f4800 R15: 0000000000000005
[  282.238262] Modules linked in: mousedev hid_generic usbhid hid iptable_mangle ipt_REJECT nf_reject_ipv4 tun xt_MASQUERADE iptable_nat xt_tcpudp iscsi_target_mod target_core_pscsi target_core_file ip6table_filter ip6_tables iptable_filter ip_tables x_tables af_packet target_core_mod cpufreq_powersave cpufreq_ondemand cpufreq_userspace configfs
cpufreq_conservative autofs4 binfmt_misc bridge stp llc snd_usb_audio snd_hwdep snd_usbmidi_lib snd_rawmidi snd_pcm snd_timer snd soundcore dmi_sysfs nf_nat_ftp nf_conntrack_ftp nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 lm85 hwmon_vid udl drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea fb font fbdev drm drm_panel_orientation_quirks backlight ipv6 ohci_pci amd64_edac_mod edac_mce_amd kvm_amd kvm irqbypass tg3 pcspkr ptp pps_core ehci_pci ohci_hcd ehci_hcd libphy usbcore k10temp hwmon e100 usb_common mii i2c_piix4 pata_serverworks rtc_cmos floppy acpi_cpufreq button processor spadfs evdev
[  282.257235] ---[ end trace d7968a41c1fbf717 ]---
[  282.267115] RIP: 0010:fb_deferred_io_mkwrite+0x7c/0x100 [fb]
[  282.270350] Code: ff 83 e2 01 48 0f 44 c3 f0 48 0f ba 28 00 0f 82 83 00 00 00 49 8b 45 28 49 39 c4 48 8d 50 f8 74 5d 48 39 d3 74 1c 48 8b 4b 20 <48> 39 4a 20 77 4e 48 8b 42 08 4c 39 e0 48 8d 50 f8 74 41 48 39 d3
[  282.276893] RSP: 0000:ffff888348293de8 EFLAGS: 00010216
[  282.280202] RAX: dead000000000100 RBX: ffffea0004182980 RCX: 0000000000000000
[  282.283564] RDX: dead0000000000f8 RSI: 0000000000000801 RDI: ffffffffa045c048
[  282.286965] RBP: ffff888106af1c00 R08: 000000005fc6128b R09: 000000003626d41e
[  282.290628] R10: 0000000000000008 R11: ffff88a04fffc000 R12: ffffffffa045c068
[  282.294039] R13: ffffffffa045c040 R14: ffffffffa045c048 R15: fff000003fffffff
[  282.297430] FS:  00007fa64cbf4a00(0000) GS:ffff88900fd00000(0000) knlGS:0000000000000000

When I try to run Xorg (from Debian 9) with the kernel 5.10-rc6, it doesn't work at all, I get this crash:

[   451.002] (EE) FBDEV(0): FBIOPUTCMAP: Device or resource busy
[   451.002] (==) FBDEV(0): DPMS enabled
[   451.002] (--) RandR disabled
[   451.008] (II) SELinux: Disabled on system
[   451.008] (II) AIGLX: Screen 0 is not DRI2 capable
[   451.008] (EE) AIGLX: reverting to software rendering
[   451.011] (II) IGLX: enabled GLX_MESA_copy_sub_buffer
[   451.011] (II) IGLX: Loaded and initialized swrast
[   451.011] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[   451.012] (II) modeset(G0): Damage tracking initialized
[   451.012] (EE)
[   451.012] (EE) Backtrace:
[   451.013] (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4a) [0x5611eb3b973a]
[   451.013] (EE) 1: /usr/lib/xorg/Xorg (0x5611eb200000+0x1bd4c9) [0x5611eb3bd4c9]
[   451.013] (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7fd7dbb16000+0x110e0) [0x7fd7dbb270e0]
[   451.013] (EE) 3: /usr/lib/xorg/Xorg (RRSetChanged+0x92) [0x5611eb3175f2]
[   451.013] (EE) 4: /usr/lib/xorg/Xorg (RRScreenSetSizeRange+0x54) [0x5611eb31c1b4]
[   451.013] (EE) 5: /usr/lib/xorg/Xorg (xf86RandR12CreateScreenResources+0x310) [0x5611eb2d59d0]
[   451.013] (EE) 6: /usr/lib/xorg/Xorg (0x5611eb200000+0xc8b60) [0x5611eb2c8b60]
[   451.013] (EE) 7: /usr/lib/xorg/Xorg (0x5611eb200000+0x590c1) [0x5611eb2590c1]
[   451.013] (EE) 8: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf1) [0x7fd7db7972e1]
[   451.013] (EE) 9: /usr/lib/xorg/Xorg (_start+0x2a) [0x5611eb242f0a]
[   451.013] (EE)
[   451.013] (EE) Segmentation fault at address 0xb8
[   451.013] (EE)
Fatal server error:
[   451.013] (EE) Caught signal 11 (Segmentation fault). Server aborting
[   451.013] (EE)
[   451.013] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[   451.013] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   451.013] (EE)
[   451.063] (EE) Server terminated with error (1). Closing log file.

Mikulas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel