Skip to content

drm: fb-helper/ssd130x: Add support for DRM_FORMAT_R1

Geert Uytterhoeven dri-devel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 16 repliesIn review
  2. v18 patches 25 repliesApplied

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8drm/dumb-buffers: Fix drm_mode_create_dumb() for bpp < 8drivers/gpu/drm/drm_dumb_buffers.c+2 -12 replies
2/8drm/ssd130x: Fix screen clearingdrivers/gpu/drm/solomon/ssd130x.c+39 -82 replies
3/8drm/ssd130x: Use bool for ssd130x_deviceinfo flagsdrivers/gpu/drm/solomon/ssd130x.h+2 -22 replies
4/8drm/ssd130x: Add support for DRM_FORMAT_R1drivers/gpu/drm/solomon/ssd130x.c+51 -254 replies
5/8drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2()drivers/gpu/drm/drm_client.c+5 -84 replies
6/8drm/fb-helper: Pass buffer format via drm_fb_helper_surface_sizedrivers/gpu/drm/drm_fb_helper.c drivers/gpu/drm/drm_fbdev_generic.c include/drm/drm_fb_helper.h+7 -51 reply
7/8drm/fb-helper: Add support for DRM_FORMAT_R1drivers/gpu/drm/drm_fb_helper.c+30 -111 reply
8/8drm/ssd130x: Switch preferred_bpp/depth to 1drivers/gpu/drm/solomon/ssd130x.c+2 -20 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchJavier Martinez Canillas
1/8R-b T-b
2/8R-b T-b
3/8R-b T-b
4/8R-b T-b
5/8R-b T-b
6/8R-b T-b
7/8R-b T-b
8/8R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] drm: fb-helper/ssd130x: Add support for DRM_FORMAT_R1

Hi all,

The native display format of ssd1306 OLED displays is monochrome light-on-dark (R1). This patch series adds support for the R1 buffer format to both the ssd130x DRM driver and the FB helpers, so monochrome applications (including fbdev emulation and the text console) not only look better, but also avoid the overhead of back-and-forth conversions between R1 and XR24.

This series consists of 4 parts:
- Patches 1-2 contain fixes,
- Patch 3 contains a small improvement,
- Patch 4 adds R1 support to the ssd130x DRM driver,
- Patches 5-6 update the DRM client and FB helper code to avoid calling drm_mode_legacy_fb_format() where the exact buffer format is already known, to prepare for R1 support,
- Patch 7 adds support for R1 to fbdev emulation and the text console,
- Patch 8 switches ssd130x to R1 for fbdev emulation and the text console.

Changes compared to v1[1]:
- Drop "[PATCH 1/8] drm/ssd130x: Fix pitch calculation in

    ssd130x_fb_blit_rect()" (already applied),
  - Drop "[PATCH/RFC 3/8] drm/ssd130x: Bail out early if data_array is
    not yet available" (no longer needed),
  - New patch "[PATCH v2 2/8] drm/ssd130x: Fix screen clearing",
  - New patch "[PATCH v2 3/8] drm/ssd130x: Use bool for
    ssd130x_deviceinfo flags",

- Add Reviewed-by, Tested-by,
- Rework on top op commit 8c3926367ac9df6c ("drm/ssd130x: Use shadow-buffer helpers when managing plane's state") in drm/drm-next,
- Do not allocate intermediate buffer when not needed,
- s/drm_mode_create_dumb/drm_client_buffer_addfb/ in one-line summary,
- Fix accidental debug level increase.

This has been tested on an Adafruit FeatherWing 128x32 OLED, connected to an OrangeCrab ECP5 FPGA board running a 64 MHz VexRiscv RISC-V softcore, using the fbdev text console.

Thanks for your comments!

P.S. Note that the biggest hurdle was the copious use of the
drm_mode_legacy_fb_format() helper in various places. This helper cannot decide between C1 and R1 without knowledge of the capabilities of the full display pipeline. Instead of special-casing its return value in three callers, I did so in only one place, and got rid of two of these calls in the call chain. I think Thomas' grand plan is to replace preferred_{bpp,depth} by a preferred fourcc format? That would simplify things a lot...

[1] "[PATCH 0/8] drm: fb-helper/ssd130x: Add support for DRM_FORMAT_R1"

    https://lore.kernel.org/r/[email protected]

Geert Uytterhoeven (8):
drm/dumb-buffers: Fix drm_mode_create_dumb() for bpp < 8 drm/ssd130x: Fix screen clearing
drm/ssd130x: Use bool for ssd130x_deviceinfo flags drm/ssd130x: Add support for DRM_FORMAT_R1
drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2() drm/fb-helper: Pass buffer format via drm_fb_helper_surface_size drm/fb-helper: Add support for DRM_FORMAT_R1 drm/ssd130x: Switch preferred_bpp/depth to 1

 drivers/gpu/drm/drm_client.c        |  13 ++-
 drivers/gpu/drm/drm_dumb_buffers.c  |   3 +-
 drivers/gpu/drm/drm_fb_helper.c     |  42 ++++++---
 drivers/gpu/drm/drm_fbdev_generic.c |   9 +-
 drivers/gpu/drm/solomon/ssd130x.c   | 127 ++++++++++++++++++++--------
 drivers/gpu/drm/solomon/ssd130x.h   |   4 +-
 include/drm/drm_fb_helper.h         |   2 +
 7 files changed, 138 insertions(+), 62 deletions(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds