Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/fb-helper: Add multi buffer support for cma fbdev

This patch add a config to support to create multi buffer for cma fbdev.
Such as double buffer and triple buffer.

Cma fbdev is convient to add a legency fbdev. And still many Android
devices use fbdev now and at least double buffer is needed for these
Android devices, so that a buffer flip can be operated. It will need
some time for Android device vendors to abondon legency fbdev. So multi
buffer for fbdev is needed.

Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
[s.christ@phytec.de: Picking patch from
https://lkml.org/lkml/2015/9/14/188]
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/075ffb50cc16ab055b5d47b30163401bb356ab51.1487175046.git-series.maxime.ripard@free-electrons.com

authored by

Xinliang Liu and committed by
Daniel Vetter
5f152576 cd252356

+19
+9
drivers/gpu/drm/Kconfig
··· 99 99 100 100 If in doubt, say "Y". 101 101 102 + config DRM_FBDEV_OVERALLOC 103 + int "Overallocation of the fbdev buffer" 104 + depends on DRM_FBDEV_EMULATION 105 + default 100 106 + help 107 + Defines the fbdev buffer overallocation in percent. Default 108 + is 100. Typical values for double buffering will be 200, 109 + triple buffering 300. 110 + 102 111 config DRM_LOAD_EDID_FIRMWARE 103 112 bool "Allow to specify an EDID data set instead of probing for it" 104 113 depends on DRM_KMS_HELPER
+10
drivers/gpu/drm/drm_fb_helper.c
··· 48 48 MODULE_PARM_DESC(fbdev_emulation, 49 49 "Enable legacy fbdev emulation [default=true]"); 50 50 51 + static int drm_fbdev_overalloc = CONFIG_DRM_FBDEV_OVERALLOC; 52 + module_param(drm_fbdev_overalloc, int, 0444); 53 + MODULE_PARM_DESC(drm_fbdev_overalloc, 54 + "Overallocation of the fbdev buffer (%) [default=" 55 + __MODULE_STRING(CONFIG_DRM_FBDEV_OVERALLOC) "]"); 56 + 51 57 static LIST_HEAD(kernel_fb_helper_list); 52 58 static DEFINE_MUTEX(kernel_fb_helper_lock); 53 59 ··· 1583 1577 sizes.fb_width = sizes.surface_width = 1024; 1584 1578 sizes.fb_height = sizes.surface_height = 768; 1585 1579 } 1580 + 1581 + /* Handle our overallocation */ 1582 + sizes.surface_height *= drm_fbdev_overalloc; 1583 + sizes.surface_height /= 100; 1586 1584 1587 1585 /* push down into drivers */ 1588 1586 ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes);