All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] drm: Reuse temporary memory for format conversion
@ 2023-09-20 11:10 Thomas Zimmermann
  2023-09-20 11:10 ` [PATCH 1/8] drm/format-helper: Add struct drm_xfrm_buf to cache " Thomas Zimmermann
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Thomas Zimmermann @ 2023-09-20 11:10 UTC (permalink / raw)
  To: javierm, jfalempe, jose.exposito89, arthurgrillo, mairacanal,
	maarten.lankhorst, mripard, airlied, daniel, noralf
  Cc: Thomas Zimmermann, dri-devel

DRM's format-conversion helpers require temporary memory. Pass the
buffer from the caller and keep it allocated over several calls. Allow
the caller to preallocate the buffer memory.

The motivation for this patchset is the recent work on a DRM panic
handler. The panic handler requires format conversion to display an
error to the screen. But allocating memory during kernel panics is
fragile. The changes in this patchset enable the DRM panic handler to
preallocate buffer storage before the panic occurs.

As an additonal benefit, drivers can now keep the temporary storage
across multiple display updates. Avoiding memory allocation reduces
the CPU overhead of the format helpers.

Patch 1 adds struct drm_xfrm_buf, a simple interface to pass around
the buffer storage. Patch 2 moves the memory management from the format
helpers into their callers. Drivers release the temporary storage at
the end of their display-update functions.

Patches 3 to 8 update three drivers to keep the allocated memory for
all of a device's lifetime. Managed cleanup releases the buffer as part
of releaseing the device. As additional benefit, buffer allocation now
happens in atomic_check helpers. The driver thus detects OOM errors
before the display update begins.

Tested with simpledrm.

Thomas Zimmermann (8):
  drm/format-helper: Add struct drm_xfrm_buf to cache format conversion
  drm/format-helper: Pass xfrm buffer to format-conversion helpers
  drm/simpledrm: Store xfrm buffer in device instance
  drm/simpledrm: Preallocate xfrm buffer in plane's atomic_check
  drm/ofdrm: Store xfrm buffer in device instance
  drm/ofdrm: Preallocate xfrm buffer in plane's atomic_check
  drm/ssd130x: Store xfrm buffer in device instance
  drm/ssd130x: Preallocate xfrm buffer in plane's atomic_check

 drivers/gpu/drm/drm_format_helper.c           | 204 +++++++++++++-----
 drivers/gpu/drm/drm_mipi_dbi.c                |   7 +-
 drivers/gpu/drm/gud/gud_pipe.c                |  21 +-
 drivers/gpu/drm/solomon/ssd130x.c             |  31 ++-
 drivers/gpu/drm/solomon/ssd130x.h             |   3 +
 .../gpu/drm/tests/drm_format_helper_test.c    |  33 +--
 drivers/gpu/drm/tiny/cirrus.c                 |   5 +-
 drivers/gpu/drm/tiny/ofdrm.c                  |  18 +-
 drivers/gpu/drm/tiny/repaper.c                |   5 +-
 drivers/gpu/drm/tiny/simpledrm.c              |  45 +++-
 drivers/gpu/drm/tiny/st7586.c                 |   5 +-
 include/drm/drm_format_helper.h               |  74 +++++--
 12 files changed, 352 insertions(+), 99 deletions(-)

-- 
2.42.0


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

end of thread, other threads:[~2023-09-20 11:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20 11:10 [PATCH 0/8] drm: Reuse temporary memory for format conversion Thomas Zimmermann
2023-09-20 11:10 ` [PATCH 1/8] drm/format-helper: Add struct drm_xfrm_buf to cache " Thomas Zimmermann
2023-09-20 11:10 ` [PATCH 2/8] drm/format-helper: Pass xfrm buffer to format-conversion helpers Thomas Zimmermann
2023-09-20 11:40   ` Jani Nikula
2023-09-20 11:10 ` [PATCH 3/8] drm/simpledrm: Store xfrm buffer in device instance Thomas Zimmermann
2023-09-20 11:10 ` [PATCH 4/8] drm/simpledrm: Preallocate xfrm buffer in plane's atomic_check Thomas Zimmermann
2023-09-20 11:10 ` [PATCH 5/8] drm/ofdrm: Store xfrm buffer in device instance Thomas Zimmermann
2023-09-20 11:10 ` [PATCH 6/8] drm/ofdrm: Preallocate xfrm buffer in plane's atomic_check Thomas Zimmermann
2023-09-20 11:10 ` [PATCH 7/8] drm/ssd130x: Store xfrm buffer in device instance Thomas Zimmermann
2023-09-20 11:10 ` [PATCH 8/8] drm/ssd130x: Preallocate xfrm buffer in plane's atomic_check Thomas Zimmermann
2023-09-20 11:30   ` Thomas Zimmermann

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.