Skip to content

drm: Provide fbdev emulation per memory manager

Thomas Zimmermann dri-devel linux-fbdev linux-renesas-soc stable 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest43 patches 11 repliesIn review
  2. v243 patches 34 repliesSuperseded
  3. v143 patches 40 repliesSuperseded

Changes in v3 from the cover letter

- fbdev-dma: init fb_ops with DMAMEM initializer (Javier)
- fbdev-shmem: clarify get_page usage (Javier) v2:
- fbdev-shmem: use drm_driver_legacy_fb_format() (Geert)
- fix a few typos

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/43drm/fbdev-generic: Do not set physical framebuffer addressdrivers/gpu/drm/drm_fbdev_generic.c+0 -10 replies
2/43fbdev/deferred-io: Move pageref setup into separate helperdrivers/video/fbdev/core/fb_defio.c+30 -120 replies
3/43fbdev/deferred-io: Clean up pageref on lastclosedrivers/video/fbdev/core/fb_defio.c+11 -60 replies
4/43fbdev/deferred-io: Test screen_buffer for vmalloc'ed memorydrivers/video/fbdev/core/fb_defio.c+3 -30 replies
5/43fbdev/deferred-io: Test smem_start for I/O memorydrivers/video/fbdev/core/fb_defio.c+2 -20 replies
6/43fbdev/deferred-io: Always call get_page() for framebuffer pagesdrivers/video/fbdev/core/fb_defio.c+5 -40 replies
7/43fbdev/deferred-io: Provide get_page hook in struct fb_deferred_iodrivers/video/fbdev/core/fb_defio.c include/linux/fb.h+5 -00 replies
8/43drm/fbdev: Add fbdev-shmemdrivers/gpu/drm/Makefile drivers/gpu/drm/drm_fbdev_shmem.c include/drm/drm_fbdev_shmem.h+332 -00 replies
9/43drm/ast: Use fbdev-shmemdrivers/gpu/drm/ast/ast_drv.c+2 -20 replies
10/43drm/gud: Use fbdev-shmemdrivers/gpu/drm/gud/gud_drv.c+2 -20 replies
11/43drm/hyperv: Use fbdev-shmemdrivers/gpu/drm/hyperv/hyperv_drm_drv.c+2 -20 replies
12/43drm/mgag200: Use fbdev-shmemdrivers/gpu/drm/mgag200/mgag200_drv.c+2 -20 replies
13/43drm/solomon: Use fbdev-shmemdrivers/gpu/drm/solomon/ssd130x.c+2 -20 replies
14/43drm/tiny/cirrus: Use fbdev-shmemdrivers/gpu/drm/tiny/cirrus.c+2 -20 replies
15/43drm/tiny/gm12u320: Use fbdev-shmemdrivers/gpu/drm/tiny/gm12u320.c+2 -20 replies
16/43drm/tiny/ofdrm: Use fbdev-shmemdrivers/gpu/drm/tiny/ofdrm.c+2 -20 replies
17/43drm/tiny/simpledrm: Use fbdev-shmemdrivers/gpu/drm/tiny/simpledrm.c+2 -20 replies
18/43drm/udl: Use fbdev-shmemdrivers/gpu/drm/udl/udl_drv.c+2 -20 replies
19/43drm/virtio: Use fbdev-shmemdrivers/gpu/drm/virtio/virtgpu_drv.c+2 -20 replies
20/43drm/vkms: Use fbdev-shmemdrivers/gpu/drm/vkms/vkms_drv.c+2 -20 replies
21/43drm/fbdev-dma: Implement damage handling and deferred I/Odrivers/gpu/drm/drm_fbdev_dma.c+51 -148 replies
22/43drm/arm/komeda: Use fbdev-dmadrivers/gpu/drm/arm/display/komeda/komeda_drv.c+2 -20 replies
23/43drm/hisilicon/kirin: Use fbdev-dmadrivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c+2 -20 replies
24/43drm/imx/lcdc: Use fbdev-dmadrivers/gpu/drm/imx/lcdc/imx-lcdc.c+2 -20 replies
25/43drm/ingenic: Use fbdev-dmadrivers/gpu/drm/ingenic/ingenic-drm-drv.c+2 -20 replies
26/43drm/mediatek: Use fbdev-dmadrivers/gpu/drm/mediatek/mtk_drm_drv.c+2 -20 replies
27/43drm/panel/panel-ilitek-9341: Use fbdev-dmadrivers/gpu/drm/panel/panel-ilitek-ili9341.c+2 -20 replies
28/43drm/renesas/rcar-du: Use fbdev-dmadrivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c+2 -22 replies
29/43drm/renesas/rz-du: Use fbdev-dmadrivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c+2 -20 replies
30/43drm/renesas/shmobile: Use fbdev-dmadrivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c+2 -20 replies
31/43drm/rockchip: Use fbdev-dmadrivers/gpu/drm/rockchip/rockchip_drm_drv.c+2 -21 reply
32/43drm/tiny/hx8357d: Use fbdev-dmadrivers/gpu/drm/tiny/hx8357d.c+2 -20 replies
33/43drm/tiny/ili9163: Use fbdev-dmadrivers/gpu/drm/tiny/ili9163.c+2 -20 replies
34/43drm/tiny/ili9225: Use fbdev-dmadrivers/gpu/drm/tiny/ili9225.c+2 -20 replies
35/43drm/tiny/ili9341: Use fbdev-dmadrivers/gpu/drm/tiny/ili9341.c+2 -20 replies
36/43drm/tiny/ili9486: Use fbdev-dmadrivers/gpu/drm/tiny/ili9486.c+2 -20 replies
37/43drm/tiny/mi0283qt: Use fbdev-dmadrivers/gpu/drm/tiny/mi0283qt.c+2 -20 replies
38/43drm/tiny/panel-mipi-dbi: Use fbdev-dmadrivers/gpu/drm/tiny/panel-mipi-dbi.c+2 -20 replies
39/43drm/tiny/repaper: Use fbdev-dmadrivers/gpu/drm/tiny/repaper.c+2 -20 replies
40/43drm/tiny/st7586: Use fbdev-dmadrivers/gpu/drm/tiny/st7586.c+2 -20 replies
41/43drm/tiny/st7735r: Use fbdev-dmadrivers/gpu/drm/tiny/st7735r.c+2 -20 replies
42/43drm/fbdev-generic: Convert to fbdev-ttmDocumentation/gpu/drm-kms-helpers.rst drivers/gpu/drm/Makefile drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +11 more+77 -770 replies
43/43drm/fbdev: Clean up fbdev documentationDocumentation/gpu/drm-kms-helpers.rst Documentation/gpu/todo.rst drivers/gpu/drm/drm_drv.c +2 more+14 -280 replies

Reviews trailers per patch

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

PatchJocelyn FalempeJavier Martinez CanillasZack RusinSui JingfengMaxime RipardNoralf TrønnesDeepak RawatHans de GoedeDmitry OsipenkoMaíra CanalLiviu DudauPaul CercueilLaurent PinchartBiju DasDavid LechnerKieran BinghamHeiko StuebnerAlexander Stein
1/43R-b R-b R-b T-b A-b
2/43R-b
3/43R-b
4/43R-b
5/43R-b
6/43R-b
7/43R-b
8/43R-b
9/43R-b
10/43A-b
11/43R-b
12/43R-b
13/43R-b
14/43R-b
15/43R-b
16/43R-b
17/43R-b
18/43R-b
19/43R-b T-b
20/43R-b A-b
21/43R-b T-b
22/43A-b
23/43R-b
24/43R-b
25/43A-b
26/43R-b
27/43R-b
28/43R-b R-b
29/43R-b T-b
30/43R-b
31/43R-b A-b
32/43R-b
33/43R-b
34/43A-b
35/43R-b
36/43R-b
37/43A-b
38/43A-b
39/43A-b
40/43A-b
41/43A-b
42/43R-b
43/43R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 18 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/43] drm: Provide fbdev emulation per memory manager

DRM provides 3 different memory managers with slightly different
characteristics: DMA-based, SHMEM-based and TTM. This affects fbdev emulation as each requires different handling of mmap(). This series reworks fbdev emulation to provide an optimized emulation for each of the memory managers.

Patch 1 fixes a minor bug in fbdev-generic.

Patches 2 to 8 implement fbdev-shmem, which is optimized for drivers with SHMEM-based allocation. Patches 2 to 7 prepare deferred I/O to support driver-custom page lookups. When the mmap'ed framebuffer sees a pagefault, the deferred-I/O code can ask the graphics driver of the page (instead of trying to detect it by itself). Using this hook, patch 8 implements fbdev-shmem. The code is similar to fbdev-generic, but does not require an additional shadow buffer for mmap(). Mmap'ed pages are instead provided from the GEM buffer object. That saves a few MiB of framebuffer memory and copying between the internal buffers.

Patches 9 to 20 convert SHMEM-based drivers to fbdev-shmem.

Patch 21 adds damage handling and deferred I/O to fbdev-dma. Such code has been tested on the DMA-based omapdrm and can be adopted for all drivers.

Patches 22 to 41 convert DMA-based drivers to fbdev-dma. These drivers could not use it because of the missing support for damage handling.

Patch 42 renames fbdev-generic to fbdev-ttm. Only TTM-based drivers still use it, so building it can be linked to TTM as well.

Patch 43 cleans up the documentation.

Tested with simpledrm, vc4 and amdgpu.

v3:
- fbdev-dma: init fb_ops with DMAMEM initializer (Javier)
- fbdev-shmem: clarify get_page usage (Javier) v2:
- fbdev-shmem: use drm_driver_legacy_fb_format() (Geert)
- fix a few typos

Thomas Zimmermann (43):
drm/fbdev-generic: Do not set physical framebuffer address fbdev/deferred-io: Move pageref setup into separate helper fbdev/deferred-io: Clean up pageref on lastclose fbdev/deferred-io: Test screen_buffer for vmalloc'ed memory fbdev/deferred-io: Test smem_start for I/O memory fbdev/deferred-io: Always call get_page() for framebuffer pages fbdev/deferred-io: Provide get_page hook in struct fb_deferred_io drm/fbdev: Add fbdev-shmem
drm/ast: Use fbdev-shmem
drm/gud: Use fbdev-shmem
drm/hyperv: Use fbdev-shmem
drm/mgag200: Use fbdev-shmem
drm/solomon: Use fbdev-shmem
drm/tiny/cirrus: Use fbdev-shmem
drm/tiny/gm12u320: Use fbdev-shmem
drm/tiny/ofdrm: Use fbdev-shmem
drm/tiny/simpledrm: Use fbdev-shmem
drm/udl: Use fbdev-shmem
drm/virtio: Use fbdev-shmem
drm/vkms: Use fbdev-shmem
drm/fbdev-dma: Implement damage handling and deferred I/O drm/arm/komeda: Use fbdev-dma
drm/hisilicon/kirin: Use fbdev-dma
drm/imx/lcdc: Use fbdev-dma
drm/ingenic: Use fbdev-dma
drm/mediatek: Use fbdev-dma drm/panel/panel-ilitek-9341: Use fbdev-dma drm/renesas/rcar-du: Use fbdev-dma
drm/renesas/rz-du: Use fbdev-dma
drm/renesas/shmobile: Use fbdev-dma
drm/rockchip: Use fbdev-dma
drm/tiny/hx8357d: Use fbdev-dma
drm/tiny/ili9163: Use fbdev-dma
drm/tiny/ili9225: Use fbdev-dma
drm/tiny/ili9341: Use fbdev-dma
drm/tiny/ili9486: Use fbdev-dma
drm/tiny/mi0283qt: Use fbdev-dma drm/tiny/panel-mipi-dbi: Use fbdev-dma drm/tiny/repaper: Use fbdev-dma
drm/tiny/st7586: Use fbdev-dma
drm/tiny/st7735r: Use fbdev-dma
drm/fbdev-generic: Convert to fbdev-ttm
drm/fbdev: Clean up fbdev documentation

 Documentation/gpu/drm-kms-helpers.rst         |  12 +-
 Documentation/gpu/todo.rst                    |  13 -
 drivers/gpu/drm/Makefile                      |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |   6 +-
 .../gpu/drm/arm/display/komeda/komeda_drv.c   |   4 +-
 drivers/gpu/drm/ast/ast_drv.c                 |   4 +-
 drivers/gpu/drm/drm_drv.c                     |   2 +-
 drivers/gpu/drm/drm_fb_helper.c               |  11 +-
 drivers/gpu/drm/drm_fbdev_dma.c               |  65 +++-
 drivers/gpu/drm/drm_fbdev_shmem.c             | 316 ++++++++++++++++++
 .../{drm_fbdev_generic.c => drm_fbdev_ttm.c}  |  81 +++--
 drivers/gpu/drm/gud/gud_drv.c                 |   4 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c   |   4 +-
 .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c   |   4 +-
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c       |   4 +-
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c           |   4 +-
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c     |   4 +-
 drivers/gpu/drm/loongson/Kconfig              |   1 +
 drivers/gpu/drm/loongson/lsdc_drv.c           |   4 +-
 drivers/gpu/drm/mediatek/mtk_drm_drv.c        |   4 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c         |   4 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c         |   6 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9341.c  |   4 +-
 drivers/gpu/drm/qxl/qxl_drv.c                 |   4 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c |   4 +-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  |   4 +-
 .../gpu/drm/renesas/shmobile/shmob_drm_drv.c  |   4 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c   |   4 +-
 drivers/gpu/drm/solomon/ssd130x.c             |   4 +-
 drivers/gpu/drm/tiny/bochs.c                  |   4 +-
 drivers/gpu/drm/tiny/cirrus.c                 |   4 +-
 drivers/gpu/drm/tiny/gm12u320.c               |   4 +-
 drivers/gpu/drm/tiny/hx8357d.c                |   4 +-
 drivers/gpu/drm/tiny/ili9163.c                |   4 +-
 drivers/gpu/drm/tiny/ili9225.c                |   4 +-
 drivers/gpu/drm/tiny/ili9341.c                |   4 +-
 drivers/gpu/drm/tiny/ili9486.c                |   4 +-
 drivers/gpu/drm/tiny/mi0283qt.c               |   4 +-
 drivers/gpu/drm/tiny/ofdrm.c                  |   4 +-
 drivers/gpu/drm/tiny/panel-mipi-dbi.c         |   4 +-
 drivers/gpu/drm/tiny/repaper.c                |   4 +-
 drivers/gpu/drm/tiny/simpledrm.c              |   4 +-
 drivers/gpu/drm/tiny/st7586.c                 |   4 +-
 drivers/gpu/drm/tiny/st7735r.c                |   4 +-
 drivers/gpu/drm/udl/udl_drv.c                 |   4 +-
 drivers/gpu/drm/vboxvideo/vbox_drv.c          |   4 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c          |   4 +-
 drivers/gpu/drm/vkms/vkms_drv.c               |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c           |   4 +-
 drivers/video/fbdev/core/fb_defio.c           |  82 +++--
 include/drm/drm_fbdev_generic.h               |  15 -
 include/drm/drm_fbdev_shmem.h                 |  15 +
 include/drm/drm_fbdev_ttm.h                   |  15 +
 include/drm/drm_mode_config.h                 |   4 +-
 include/linux/fb.h                            |   1 +
 55 files changed, 593 insertions(+), 210 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_fbdev_shmem.c
 rename drivers/gpu/drm/{drm_fbdev_generic.c => drm_fbdev_ttm.c} (76%)
 delete mode 100644 include/drm/drm_fbdev_generic.h
 create mode 100644 include/drm/drm_fbdev_shmem.h
 create mode 100644 include/drm/drm_fbdev_ttm.h
Signature · 1 line
2.44.0