Skip to content

drm/udl: Rework URB allocation

Thomas Zimmermann dri-devel sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11drm/udl: Release URB in udl_put_urb()drivers/gpu/drm/udl/udl_drv.h drivers/gpu/drm/udl/udl_main.c+18 -121 reply
2/11drm/udl: Do not use URB completion handler for error cleanupdrivers/gpu/drm/udl/udl_drv.h drivers/gpu/drm/udl/udl_main.c drivers/gpu/drm/udl/udl_modeset.c +1 more+4 -50 replies
3/11drm/udl: Store per-URB allocation length in struct urb_nodedrivers/gpu/drm/udl/udl_drv.h drivers/gpu/drm/udl/udl_main.c+8 -70 replies
4/11drm/udl: Allocate bulk URBs in helper functionsdrivers/gpu/drm/udl/udl_main.c+47 -273 replies
5/11drm/udl: Free bulk URBs in helper functionsdrivers/gpu/drm/udl/udl_main.c+10 -60 replies
6/11drm/udl: Rework the error handling in udl_submit_urb()drivers/gpu/drm/udl/udl_main.c+10 -40 replies
7/11drm/udl: Managed cleanup of URB cachedrivers/gpu/drm/udl/udl_drv.c drivers/gpu/drm/udl/udl_drv.h drivers/gpu/drm/udl/udl_main.c+22 -240 replies
8/11drm/udl: Track number of URBs in flightdrivers/gpu/drm/udl/udl_drv.h drivers/gpu/drm/udl/udl_main.c+34 -260 replies
9/11drm/udl: Synchronize pending URBs on each framedrivers/gpu/drm/udl/udl_modeset.c+18 -02 replies
10/11drm/udl: Allocate URBs on demanddrivers/gpu/drm/udl/udl_drv.h drivers/gpu/drm/udl/udl_main.c+44 -803 replies
11/11drm/udl: Implement URB cache as LIFO stackdrivers/gpu/drm/udl/udl_main.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] drm/udl: Rework URB allocation

Udl caches once-allocated URBs for later use. By default, it has a fixed number of 20 URBs in flight at most. Depending on the USB, this can either consume too much bandwidth or keep free bandwidth unused.

Replace the fixed-size cache with dynamic allocation of the URBs required. Adapt page-flip rate according to the actually available bandwidth on the USB.

Patches 1 to 6 clean up the code, fix a few minor issue and provide a clean interface for allocating and freeing URBs.

Patch 7 switches the URB cache to managed release. As before, the cache collects all outstanding URBs as part of the USB device removal.

Patches 8 to 11 implement dynamic allocation of URBs. The URB cache tracks the number of URBs in flight and allocates new ones of the cache has been exhausted. The udl driver now sends out as many URBs as necessary for the current frame without limitting itself to 20 URBs at a time. To avoid overloading the USB, udl waits in atomic_begin() for the previous frame's URBs to complete. This adapts page-flip rate to the bandwidth available on the USB.

Patch 11 contains a minor improvement of the cache locality.

Tested with superttuxkart and vkcube on weston.

Note that display output might not happen faster in any way. This series only addresses one of many bottlenecks (e.g., message packing, software rendering).

Thomas Zimmermann (11):
drm/udl: Release URB in udl_put_urb()
drm/udl: Do not use URB completion handler for error cleanup drm/udl: Store per-URB allocation length in struct urb_node drm/udl: Allocate bulk URBs in helper functions drm/udl: Free bulk URBs in helper functions drm/udl: Rework the error handling in udl_submit_urb() drm/udl: Managed cleanup of URB cache
drm/udl: Track number of URBs in flight
drm/udl: Synchronize pending URBs on each frame drm/udl: Allocate URBs on demand
drm/udl: Implement URB cache as LIFO stack

 drivers/gpu/drm/udl/udl_drv.c      |   2 -
 drivers/gpu/drm/udl/udl_drv.h      |   8 +-
 drivers/gpu/drm/udl/udl_main.c     | 280 +++++++++++++++--------------
 drivers/gpu/drm/udl/udl_modeset.c  |  20 ++-
 drivers/gpu/drm/udl/udl_transfer.c |   2 +-
 5 files changed, 168 insertions(+), 144 deletions(-)

base-commit: 7d502136b31169f6b5575f7f89c3da60cdf7891d

Signature · 1 line
2.56.0