From: "Noralf Trønnes" <noralf@tronnes.org> To: dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org Cc: "Noralf Trønnes" <noralf@tronnes.org> Subject: [PATCH 00/10] Generic USB Display driver Date: Wed, 29 Apr 2020 14:48:20 +0200 [thread overview] Message-ID: <20200429124830.27475-1-noralf@tronnes.org> (raw) Hi, A while back I had the idea to turn a Raspberry Pi Zero into a $5 USB to HDMI/SDTV/DSI/DPI display adapter. This series adds a USB host driver and a device/gadget driver to achieve that. The reason for calling it 'Generic' is so anyone can make a USB display/adapter against this driver, all that's needed is to add a USB vid:pid. I was hoping to have someone working on a microcontroller based USB display by now, but unfortunately that has been delayed. It would have been nice to have a microcontroller implementation to ensure that I haven't made things unnecessary difficult to implement. Performance The one thing that decides how useful this all is, is how smooth an experience it gives. My hope was that it should not be noticeably laggy with ordinary office use on 1920x1080@RG16. I'm pleased to see that it's also possible to watch youtube movies, although not in fullscreen. Some of the main factors that affects performance: - Display resolution - Userspace providing damage reports (FB_DAMAGE_CLIPS or DRM_IOCTL_MODE_DIRTYFB) - Color depth (DRM_CAP_DUMB_PREFERRED_DEPTH = 16 if RGB565) - How well the frames compress (lz4) - Gadget device memory bandwidth, CPU power for decompression - (Big endian hosts will have to do byte swapping on the frames) I've tested these: - xorg-server on Pi4. This was nice and smooth since it uses DRM_IOCTL_MODE_DIRTYFB and honours DRM_CAP_DUMB_PREFERRED_DEPTH. - Ubuntu 20.04 GNOME on x86. This was useable, but not so good for movies. GNOME doesn't look at DRM_CAP_DUMB_PREFERRED_DEPTH and doesn't set FB_DAMAGE_CLIPS on the pageflips. I've made a short video to show what it looks like[1]. I have used a Pi4 as the gadget during development since it has much better memory bandwith (4000 vs 200 MBps)[2] and CPU than the PiZ. They both have the same gadget controller (dwc2). I did an RFC [3] of this 2 months ago where I looked at doing a Multi Function USB device. I gave up on that when I realised how much work the review process would be. So I stripped down to my original idea. I have made sure that the drivers will tolerate another USB interface of type VENDOR, so it's still possible for the display to be part of a multi function device. Noralf. [1] https://youtu.be/AhGZWwUm8JU [2] https://magpi.raspberrypi.org/articles/raspberry-pi-specs-benchmarks [3] https://patchwork.freedesktop.org/series/73508/ Noralf Trønnes (10): backlight: Add backlight_device_get_by_name() drm: Add backlight helper drm/client: Add drm_client_init_from_id() drm/client: Add drm_client_framebuffer_flush() drm/client: Add drm_client_modeset_check() drm/client: Add a way to set modeset, properties and rotation drm/format-helper: Add drm_fb_swab() drm: Add Generic USB Display driver drm/gud: Add functionality for the USB gadget side usb: gadget: function: Add Generic USB Display support .../ABI/testing/configfs-usb-gadget-gud_drm | 10 + Documentation/gpu/drm-kms-helpers.rst | 6 + MAINTAINERS | 10 + drivers/gpu/drm/Kconfig | 9 + drivers/gpu/drm/Makefile | 2 + drivers/gpu/drm/drm_backlight_helper.c | 154 +++ drivers/gpu/drm/drm_client.c | 79 +- drivers/gpu/drm/drm_client_modeset.c | 174 ++- drivers/gpu/drm/drm_format_helper.c | 61 +- drivers/gpu/drm/drm_mipi_dbi.c | 2 +- drivers/gpu/drm/gud/Kconfig | 20 + drivers/gpu/drm/gud/Makefile | 5 + drivers/gpu/drm/gud/gud_drm_connector.c | 629 +++++++++ drivers/gpu/drm/gud/gud_drm_drv.c | 624 +++++++++ drivers/gpu/drm/gud/gud_drm_gadget.c | 1169 +++++++++++++++++ drivers/gpu/drm/gud/gud_drm_internal.h | 66 + drivers/gpu/drm/gud/gud_drm_pipe.c | 423 ++++++ drivers/usb/gadget/Kconfig | 12 + drivers/usb/gadget/function/Makefile | 2 + drivers/usb/gadget/function/f_gud_drm.c | 678 ++++++++++ drivers/video/backlight/backlight.c | 21 + include/drm/drm_backlight_helper.h | 9 + include/drm/drm_client.h | 44 +- include/drm/drm_connector.h | 10 + include/drm/drm_format_helper.h | 4 +- include/drm/gud_drm.h | 369 ++++++ include/linux/backlight.h | 1 + 27 files changed, 4563 insertions(+), 30 deletions(-) create mode 100644 Documentation/ABI/testing/configfs-usb-gadget-gud_drm create mode 100644 drivers/gpu/drm/drm_backlight_helper.c create mode 100644 drivers/gpu/drm/gud/Kconfig create mode 100644 drivers/gpu/drm/gud/Makefile create mode 100644 drivers/gpu/drm/gud/gud_drm_connector.c create mode 100644 drivers/gpu/drm/gud/gud_drm_drv.c create mode 100644 drivers/gpu/drm/gud/gud_drm_gadget.c create mode 100644 drivers/gpu/drm/gud/gud_drm_internal.h create mode 100644 drivers/gpu/drm/gud/gud_drm_pipe.c create mode 100644 drivers/usb/gadget/function/f_gud_drm.c create mode 100644 include/drm/drm_backlight_helper.h create mode 100644 include/drm/gud_drm.h -- 2.23.0
WARNING: multiple messages have this Message-ID (diff)
From: "Noralf Trønnes" <noralf@tronnes.org> To: dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org Subject: [PATCH 00/10] Generic USB Display driver Date: Wed, 29 Apr 2020 14:48:20 +0200 [thread overview] Message-ID: <20200429124830.27475-1-noralf@tronnes.org> (raw) Hi, A while back I had the idea to turn a Raspberry Pi Zero into a $5 USB to HDMI/SDTV/DSI/DPI display adapter. This series adds a USB host driver and a device/gadget driver to achieve that. The reason for calling it 'Generic' is so anyone can make a USB display/adapter against this driver, all that's needed is to add a USB vid:pid. I was hoping to have someone working on a microcontroller based USB display by now, but unfortunately that has been delayed. It would have been nice to have a microcontroller implementation to ensure that I haven't made things unnecessary difficult to implement. Performance The one thing that decides how useful this all is, is how smooth an experience it gives. My hope was that it should not be noticeably laggy with ordinary office use on 1920x1080@RG16. I'm pleased to see that it's also possible to watch youtube movies, although not in fullscreen. Some of the main factors that affects performance: - Display resolution - Userspace providing damage reports (FB_DAMAGE_CLIPS or DRM_IOCTL_MODE_DIRTYFB) - Color depth (DRM_CAP_DUMB_PREFERRED_DEPTH = 16 if RGB565) - How well the frames compress (lz4) - Gadget device memory bandwidth, CPU power for decompression - (Big endian hosts will have to do byte swapping on the frames) I've tested these: - xorg-server on Pi4. This was nice and smooth since it uses DRM_IOCTL_MODE_DIRTYFB and honours DRM_CAP_DUMB_PREFERRED_DEPTH. - Ubuntu 20.04 GNOME on x86. This was useable, but not so good for movies. GNOME doesn't look at DRM_CAP_DUMB_PREFERRED_DEPTH and doesn't set FB_DAMAGE_CLIPS on the pageflips. I've made a short video to show what it looks like[1]. I have used a Pi4 as the gadget during development since it has much better memory bandwith (4000 vs 200 MBps)[2] and CPU than the PiZ. They both have the same gadget controller (dwc2). I did an RFC [3] of this 2 months ago where I looked at doing a Multi Function USB device. I gave up on that when I realised how much work the review process would be. So I stripped down to my original idea. I have made sure that the drivers will tolerate another USB interface of type VENDOR, so it's still possible for the display to be part of a multi function device. Noralf. [1] https://youtu.be/AhGZWwUm8JU [2] https://magpi.raspberrypi.org/articles/raspberry-pi-specs-benchmarks [3] https://patchwork.freedesktop.org/series/73508/ Noralf Trønnes (10): backlight: Add backlight_device_get_by_name() drm: Add backlight helper drm/client: Add drm_client_init_from_id() drm/client: Add drm_client_framebuffer_flush() drm/client: Add drm_client_modeset_check() drm/client: Add a way to set modeset, properties and rotation drm/format-helper: Add drm_fb_swab() drm: Add Generic USB Display driver drm/gud: Add functionality for the USB gadget side usb: gadget: function: Add Generic USB Display support .../ABI/testing/configfs-usb-gadget-gud_drm | 10 + Documentation/gpu/drm-kms-helpers.rst | 6 + MAINTAINERS | 10 + drivers/gpu/drm/Kconfig | 9 + drivers/gpu/drm/Makefile | 2 + drivers/gpu/drm/drm_backlight_helper.c | 154 +++ drivers/gpu/drm/drm_client.c | 79 +- drivers/gpu/drm/drm_client_modeset.c | 174 ++- drivers/gpu/drm/drm_format_helper.c | 61 +- drivers/gpu/drm/drm_mipi_dbi.c | 2 +- drivers/gpu/drm/gud/Kconfig | 20 + drivers/gpu/drm/gud/Makefile | 5 + drivers/gpu/drm/gud/gud_drm_connector.c | 629 +++++++++ drivers/gpu/drm/gud/gud_drm_drv.c | 624 +++++++++ drivers/gpu/drm/gud/gud_drm_gadget.c | 1169 +++++++++++++++++ drivers/gpu/drm/gud/gud_drm_internal.h | 66 + drivers/gpu/drm/gud/gud_drm_pipe.c | 423 ++++++ drivers/usb/gadget/Kconfig | 12 + drivers/usb/gadget/function/Makefile | 2 + drivers/usb/gadget/function/f_gud_drm.c | 678 ++++++++++ drivers/video/backlight/backlight.c | 21 + include/drm/drm_backlight_helper.h | 9 + include/drm/drm_client.h | 44 +- include/drm/drm_connector.h | 10 + include/drm/drm_format_helper.h | 4 +- include/drm/gud_drm.h | 369 ++++++ include/linux/backlight.h | 1 + 27 files changed, 4563 insertions(+), 30 deletions(-) create mode 100644 Documentation/ABI/testing/configfs-usb-gadget-gud_drm create mode 100644 drivers/gpu/drm/drm_backlight_helper.c create mode 100644 drivers/gpu/drm/gud/Kconfig create mode 100644 drivers/gpu/drm/gud/Makefile create mode 100644 drivers/gpu/drm/gud/gud_drm_connector.c create mode 100644 drivers/gpu/drm/gud/gud_drm_drv.c create mode 100644 drivers/gpu/drm/gud/gud_drm_gadget.c create mode 100644 drivers/gpu/drm/gud/gud_drm_internal.h create mode 100644 drivers/gpu/drm/gud/gud_drm_pipe.c create mode 100644 drivers/usb/gadget/function/f_gud_drm.c create mode 100644 include/drm/drm_backlight_helper.h create mode 100644 include/drm/gud_drm.h -- 2.23.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2020-04-29 12:58 UTC|newest] Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-29 12:48 Noralf Trønnes [this message] 2020-04-29 12:48 ` [PATCH 00/10] Generic USB Display driver Noralf Trønnes 2020-04-29 12:48 ` [PATCH 01/10] backlight: Add backlight_device_get_by_name() Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-04-30 8:32 ` Lee Jones 2020-04-30 8:32 ` Lee Jones 2020-04-30 9:20 ` Noralf Trønnes 2020-04-30 9:20 ` Noralf Trønnes 2020-04-30 10:15 ` Lee Jones 2020-04-30 10:15 ` Lee Jones 2020-04-30 10:42 ` Noralf Trønnes 2020-04-30 10:42 ` Noralf Trønnes 2020-04-30 14:02 ` Daniel Vetter 2020-04-30 14:02 ` Daniel Vetter 2020-05-04 7:10 ` Lee Jones 2020-05-04 7:10 ` Lee Jones 2020-05-03 7:13 ` Sam Ravnborg 2020-05-03 7:13 ` Sam Ravnborg 2020-04-29 12:48 ` [PATCH 02/10] drm: Add backlight helper Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-04-29 14:13 ` Hans de Goede 2020-04-29 14:13 ` Hans de Goede 2020-04-29 18:40 ` Noralf Trønnes 2020-04-29 18:40 ` Noralf Trønnes 2020-04-30 15:36 ` Hans de Goede 2020-04-30 15:36 ` Hans de Goede 2020-05-04 12:06 ` Daniel Vetter 2020-05-04 12:06 ` Daniel Vetter 2020-05-04 15:54 ` Noralf Trønnes 2020-05-04 15:54 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 03/10] drm/client: Add drm_client_init_from_id() Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 04/10] drm/client: Add drm_client_framebuffer_flush() Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-05-03 7:48 ` Sam Ravnborg 2020-05-03 7:48 ` Sam Ravnborg 2020-05-03 9:54 ` Noralf Trønnes 2020-05-03 9:54 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 05/10] drm/client: Add drm_client_modeset_check() Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-05-03 8:03 ` Sam Ravnborg 2020-05-03 8:03 ` Sam Ravnborg 2020-05-03 10:02 ` Noralf Trønnes 2020-05-03 10:02 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 06/10] drm/client: Add a way to set modeset, properties and rotation Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-05-03 8:47 ` Sam Ravnborg 2020-05-03 8:47 ` Sam Ravnborg 2020-05-03 10:50 ` Noralf Trønnes 2020-05-03 10:50 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 07/10] drm/format-helper: Add drm_fb_swab() Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-05-03 10:29 ` Sam Ravnborg 2020-05-03 10:29 ` Sam Ravnborg 2020-05-03 13:38 ` Noralf Trønnes 2020-05-03 13:38 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 08/10] drm: Add Generic USB Display driver Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-05-02 17:58 ` Noralf Trønnes 2020-05-02 17:58 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 09/10] drm/gud: Add functionality for the USB gadget side Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-04-29 12:48 ` [PATCH 10/10] usb: gadget: function: Add Generic USB Display support Noralf Trønnes 2020-04-29 12:48 ` Noralf Trønnes 2020-05-01 13:22 ` [PATCH 00/10] Generic USB Display driver Noralf Trønnes 2020-05-01 13:22 ` Noralf Trønnes
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200429124830.27475-1-noralf@tronnes.org \ --to=noralf@tronnes.org \ --cc=dri-devel@lists.freedesktop.org \ --cc=linux-usb@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.