mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC 0/4] drm: Add Fresco Logic FL2000 USB display driver
@ 2026-11-06  2:34 Angel Gabriel Crispin Valdivia via B4 Relay
  2026-11-06  2:34 ` [PATCH RFC 1/4] drm/fl2000: Add USB driver with register and I2C access Angel Gabriel Crispin Valdivia via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Angel Gabriel Crispin Valdivia via B4 Relay @ 2026-11-06  2:34 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Angel Gabriel Crispin Valdivia
  Cc: linux-kernel, dri-devel

Hi,

This series adds a DRM driver for USB display adapters built around the
Fresco Logic FL2000DX (USB ID 1d5c:2000). These are sold under many
brands as cheap USB 3.0 to VGA/HDMI dongles; the HDMI variants pair the
FL2000 with an ITE IT66121 HDMI transmitter on the FL2000's I2C bus.
Today these adapters only work on Linux with out-of-tree drivers.

The driver started as Artem Mygaiev's out-of-tree fl2000_drm driver,
itself partly based on Fresco Logic's reference driver; their copyright
lines are kept. I ported it to current kernels, fixed the problems found
on real hardware (EDID, bridge lifetime across USB resets, crashes on
disconnect, frames that were never terminated, imported buffers read
from the wrong VRAM), added the analog VGA output and cleaned it up for
submission.

I intend to maintain this driver for the long term: patch 1 adds a
MAINTAINERS entry with me as maintainer, I have the hardware to test
on, and I will keep following review and bug reports on dri-devel.

The series builds the driver up in four steps, each of which compiles
on its own:

  1. USB driver, FL2000 register access (regmap) and I2C adapter
  2. IT66121 HDMI transmitter bridge, including the EDID fallback
  3. frame streaming over bulk URBs
  4. the KMS pipeline, which makes the display usable, including the
     analog VGA output of adapters that have both connectors

It is posted as an RFC because there are design points I would like
feedback on before doing the larger reworks:

1. IT66121 support. The series carries its own small IT66121 bridge
   (fl2000_it66121.c) instead of reusing drivers/gpu/drm/bridge/
   ite-it66121.c, because I could not find a way to use the in-tree
   driver on a PC: it depends on OF (x86 distribution kernels have no
   CONFIG_OF), reads bus-width and its next bridge through of_graph,
   requires a reset GPIO the FL2000 boards do not have, and DRM has no
   bridge lookup without OF. It also reads the EDID through its DDC
   engine, which on these boards is not connected to the monitor (the
   EDID is read with the FL2000 I2C engine instead).
   Reusing it would take converting ite-it66121 to the fwnode API with an
   optional reset GPIO, a fwnode-based bridge lookup in drm_bridge.c, and
   a small bridge of this driver providing the EDID. Is that the direction
   you would like, or is a private IT66121 bridge acceptable for a USB
   device like this one?

2. Hotplug. The bridge attaches with DRM_BRIDGE_ATTACH_NO_CONNECTOR and
   the HDMI connector comes from drm_bridge_connector. The bridge
   reports DETECT and EDID only: the IT66121 interrupt reaches the host
   through the FL2000 interrupt endpoint, which makes the driver send a
   hotplug event for the device, so there is no DRM_BRIDGE_OP_HPD and
   the connector is also polled. Would reporting HPD with
   drm_bridge_hpd_notify() from that path be preferred?

3. The FL2000 exposes three USB interfaces, and the state they share
   (regmap, I2C adapter, IT66121 client, component match) is kept as
   drvdata and devres of the struct usb_device rather than of an
   interface, so that it survives the unbind/rebind cycles of
   usb_reset_device(). Is there a better established pattern for a
   multi-interface device that needs this?

4. Pixel conversion. The stream converts with its own small line
   converters instead of drm_fb_xrgb8888_to_*(). The framebuffer is
   usually imported from the primary GPU and sits in write-combined
   VRAM; the format helpers read such I/O memory with memcpy_fromio(),
   which takes ~88 ms per 1080p frame, while drm_memcpy_from_wc() into a
   cached line buffer takes ~8 ms. The converters also apply the
   FL2000's 32-bit word swap and only touch the damaged rectangle of a
   shadow frame. Would a helper that reads its source through
   drm_memcpy_from_wc() be welcome, so this could go away?

5. VGA detection. The chip has a single monitor sense input, which on
   the adapter I have follows whichever monitor is plugged in, HDMI or
   VGA. The VGA connector therefore reports a monitor when the chip
   senses one and the IT66121 hot plug line is low, which means a
   monitor on VGA is not reported while one is on HDMI (clone mode
   needs video=VGA-1:e). Is this an acceptable way to do it, and is
   there a better signal I should look for in the chip?

The rest of the pipeline follows the current helpers: regular atomic
plane/CRTC/encoder objects with managed initialisation, a cursor plane
blended by the CPU, GEM SHMEM with shadow-plane access, the DRM vblank
timer (the FL2000 has no vblank interrupt) and fbdev emulation through
drm_client_setup().

Other known limitations: RGB565, used when the USB link cannot carry
RGB888 (2560x1080 on USB 3.0, 640x480 on USB 2.0, as there is no
compression), has not been tested on hardware; and adapters with a VGA
connector only, without an IT66121, are not supported: the analog output
is only added next to the HDMI one.

Tested on x86_64 (amdgpu laptop, GNOME Wayland) with a UGREEN USB 3.0
adapter with HDMI and VGA connectors: a 1920x1080 monitor on HDMI, and
an old 1366x768 monitor without a usable EDID on VGA. EDID, mode
setting, the desktop and the cursor work, at 59 frames per second on
the link.
Every patch builds without warnings with W=1 on top of drm-misc-next,
sparse is clean, and the series passes checkpatch --strict.

Tool use, as described in Documentation/process/generated-content.rst: I
used an AI coding assistant (Claude Code with Anthropic Claude models)
extensively while preparing this series. It helped port the driver to the
current APIs, clean it up to kernel style, write the shadow-frame
streaming and the cursor plane, track down and fix the hangs on unplug,
and draft the commit messages and this letter. I reviewed the result and
tested it on the hardware described above; the Signed-off-by lines are
mine. The series was generated and checked (per-patch builds, checkpatch)
by scripts in the out-of-tree repository this driver is developed in.

---
Angel Gabriel Crispin Valdivia (4):
      drm/fl2000: Add USB driver with register and I2C access
      drm/fl2000: Add ITE IT66121 HDMI transmitter support
      drm/fl2000: Add frame streaming
      drm/fl2000: Add KMS display pipeline

 MAINTAINERS                                  |    7 +
 drivers/gpu/drm/Kconfig                      |    1 +
 drivers/gpu/drm/Makefile                     |    1 +
 drivers/gpu/drm/fl2000/Kconfig               |   19 +
 drivers/gpu/drm/fl2000/Makefile              |   13 +
 drivers/gpu/drm/fl2000/fl2000.h              |  192 +++++
 drivers/gpu/drm/fl2000/fl2000_drm.c          |  986 ++++++++++++++++++++++++
 drivers/gpu/drm/fl2000/fl2000_drv.c          |  281 +++++++
 drivers/gpu/drm/fl2000/fl2000_i2c.c          |  182 +++++
 drivers/gpu/drm/fl2000/fl2000_interrupt.c    |  237 ++++++
 drivers/gpu/drm/fl2000/fl2000_it66121.c      | 1030 ++++++++++++++++++++++++++
 drivers/gpu/drm/fl2000/fl2000_it66121.h      |   19 +
 drivers/gpu/drm/fl2000/fl2000_it66121_regs.h |  283 +++++++
 drivers/gpu/drm/fl2000/fl2000_registers.c    |  320 ++++++++
 drivers/gpu/drm/fl2000/fl2000_registers.h    |  272 +++++++
 drivers/gpu/drm/fl2000/fl2000_streaming.c    |  993 +++++++++++++++++++++++++
 drivers/gpu/drm/fl2000/fl2000_vga.c          |  256 +++++++
 17 files changed, 5092 insertions(+)
---
base-commit: 41ecf852c07391687beb129e12a231760b5d783f
change-id: 20261105-fl2000-upstream-3fc2e1f00d24

Best regards,
--  
Angel Gabriel Crispin Valdivia <angelcrispinvaldivia@gmail.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-06  9:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06  2:34 [PATCH RFC 0/4] drm: Add Fresco Logic FL2000 USB display driver Angel Gabriel Crispin Valdivia via B4 Relay
2026-11-06  2:34 ` [PATCH RFC 1/4] drm/fl2000: Add USB driver with register and I2C access Angel Gabriel Crispin Valdivia via B4 Relay
2026-11-06  2:34 ` [PATCH RFC 2/4] drm/fl2000: Add ITE IT66121 HDMI transmitter support Angel Gabriel Crispin Valdivia via B4 Relay
2026-11-06  2:34 ` [PATCH RFC 3/4] drm/fl2000: Add frame streaming Angel Gabriel Crispin Valdivia via B4 Relay
2026-11-06  2:34 ` [PATCH RFC 4/4] drm/fl2000: Add KMS display pipeline Angel Gabriel Crispin Valdivia via B4 Relay
2026-11-06  9:59   ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®