drm: Provide client setup helper and convert drivers
Subsystems (77)
Thomas Zimmermann
maintainerPATCH 1/86 drm/fbdev-helper: Move color-mode lookup into 4CC format helper
In reply to Thomas ZimmermannThe color mode specified on the kernel command line gives the user's preferred color depth and number of bits per pixel. Move the color-mode-to-format conversion form fbdev helpers into a 4CC helper, so that is can be shared among DRM clients.
--- drivers/gpu/drm/drm_fb_helper.c | 70 +++++++-------------------------- drivers/gpu/drm/drm_fourcc.c | 30 +++++++++++++- include/drm/drm_fourcc.h | 1 + 3 files changed, 45 insertions(+), 56 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +15 -55
@@ -1441,67 +1441,27 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,EXPORT_SYMBOL (drm_fb_helper_pan_display);static uint32_t drm_fb_helper_find_format (struct drm_fb_helper *fb_helper,const uint32_t *formats, -size_t format_count,uint32_t bpp,uint32_t depth) +size_t format_count,unsigned int color_mode) {struct drm_device *dev = fb_helper->dev;uint32_t format;size_t i; -/* -* Do not consider YUV or other complicated formats -* for framebuffers. This means only legacy formats -* are supported (fmt->depth is a legacy field), but -* the framebuffer emulation can only deal with such -* formats, specifically RGB/BGA formats. -*/ - format =drm_mode_legacy_fb_format (bpp, depth); -if (!format) - goto err; + format =drm_driver_color_mode_format (dev, color_mode); +if (!format) { +drm_info (dev,"unsupported color mode of %d\n" , color_mode); +return DRM_FORMAT_INVALID ; + }for (i =0 ; i < format_count; ++i) {if (formats[i] == format)return format; } - -err: -/* We found nothing. */ -drm_warn (dev,"bpp/depth value of %u/%u not supported\n" , bpp, depth); +drm_warn (dev,"format %p4cc not supported\n" , &format);return DRM_FORMAT_INVALID ; } -static uint32_t drm_fb_helper_find_color_mode_format (struct drm_fb_helper *fb_helper, -const uint32_t *formats,size_t format_count, -unsigned int color_mode) -{ -struct drm_device *dev = fb_helper->dev; -uint32_t bpp, depth; - -switch (color_mode) { -case 1 : -case 2 : -case 4 : -case 8 : -case 16 : -case 24 : - bpp = depth = color_mode; -break ; -case 15 : - bpp =16 ; - depth =15 ; -break ; -case 32 : - bpp =32 ; - depth =24 ; -break ; -default : -drm_info (dev,"unsupported color mode of %d\n" , color_mode); -return DRM_FORMAT_INVALID ; - } - -return drm_fb_helper_find_format (fb_helper, formats, format_count, bpp, depth); -} -static int __drm_fb_helper_find_sizes (struct drm_fb_helper *fb_helper,struct drm_fb_helper_surface_size *sizes) {
@@ -1531,10 +1491,10 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper,if (!cmdline_mode->bpp_specified)continue ; - surface_format =drm_fb_helper_find_color_mode_format (fb_helper, - plane->format_types, - plane->format_count, - cmdline_mode->bpp); + surface_format =drm_fb_helper_find_format (fb_helper, + plane->format_types, + plane->format_count, + cmdline_mode->bpp);if (surface_format !=DRM_FORMAT_INVALID )break ;/* found supported format */ }
@@ -1544,10 +1504,10 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper,break ;/* found supported format */ /* try preferred color mode */ - surface_format =drm_fb_helper_find_color_mode_format (fb_helper, - plane->format_types, - plane->format_count, - fb_helper->preferred_bpp); + surface_format =drm_fb_helper_find_format (fb_helper, + plane->format_types, + plane->format_count, + fb_helper->preferred_bpp);if (surface_format !=DRM_FORMAT_INVALID )break ;/* found supported format */ }
drivers/gpu/drm/drm_fourcc.c +29 -1
@@ -36,7 +36,6 @@* @depth: bit depth per pixel * * Computes a drm fourcc pixel format code for the given @bpp/@depth values. -* Useful in fbdev emulation code, since that deals in those values. */ uint32_t drm_mode_legacy_fb_format (uint32_t bpp,uint32_t depth) {
@@ -140,6 +139,35 @@ uint32_t drm_driver_legacy_fb_format(struct drm_device *dev, }EXPORT_SYMBOL (drm_driver_legacy_fb_format); +/** +* drm_driver_color_mode_format - Compute DRM 4CC code from color mode +* @dev: DRM device +* @color_mode: command-line color mode +* +* Computes a DRM 4CC pixel format code for the given color mode using +* drm_driver_color_mode(). The color mode is in the format used and the +* kernel command line. It specifies the number of bits per pixel +* and color depth in a single value. +* +* Useful in fbdev emulation code, since that deals in those values. The +* helper does not consider YUV or other complicated formats. This means +* only legacy formats are supported (fmt->depth is a legacy field), but +* the framebuffer emulation can only deal with such formats, specifically +* RGB/BGA formats. +*/ +uint32_t drm_driver_color_mode_format (struct drm_device *dev,unsigned int color_mode) +{ +switch (color_mode) { +case 15 : +return drm_driver_legacy_fb_format (dev,16 ,15 ); +case 32 : +return drm_driver_legacy_fb_format (dev,32 ,24 ); +default : +return drm_driver_legacy_fb_format (dev, color_mode, color_mode); + } +} +EXPORT_SYMBOL (drm_driver_color_mode_format); +/* * Internal function to query information for a given format. See * drm_format_info() for the public API.
include/drm/drm_fourcc.h +1 -0
@@ -313,6 +313,7 @@ drm_get_format_info(struct drm_device *dev,uint32_t drm_mode_legacy_fb_format (uint32_t bpp,uint32_t depth);uint32_t drm_driver_legacy_fb_format (struct drm_device *dev,uint32_t bpp,uint32_t depth); +uint32_t drm_driver_color_mode_format (struct drm_device *dev,unsigned int color_mode);unsigned int drm_format_info_block_width (const struct drm_format_info *info,int plane); unsigned int drm_format_info_block_height(const struct drm_format_info *info,
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 2/86 drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info
In reply to Thomas ZimmermannCall vga_switcheroo_client_fb_set() with the PCI device from the instance of struct fb_info. All fbdev clients now run these calls. For non-PCI devices or drivers without vga-switcheroo, this does nothing. For i915 and radeon, it allows these drivers to use a common fbdev client.
The device is the same as the one stored in struct drm_client and struct drm_fb_helper, so there is no difference in behavior. Some NULL-pointer checks are being removed, where those pointers cannot be NULL.
--- drivers/gpu/drm/drm_fb_helper.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +11 -4
@@ -562,8 +562,12 @@ EXPORT_SYMBOL(drm_fb_helper_release_info);*/ void drm_fb_helper_unregister_info (struct drm_fb_helper *fb_helper) { -if (fb_helper && fb_helper->info) -unregister_framebuffer (fb_helper->info); +struct fb_info *info = fb_helper->info; +struct device *dev = info->device; + +if (dev_is_pci (dev)) +vga_switcheroo_client_fb_set (to_pci_dev (dev),NULL ); +unregister_framebuffer (fb_helper->info); }EXPORT_SYMBOL (drm_fb_helper_unregister_info);
@@ -1615,6 +1619,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)struct drm_client_dev *client = &fb_helper->client;struct drm_device *dev = fb_helper->dev;struct drm_fb_helper_surface_size sizes; +struct fb_info *info;int ret; ret =drm_fb_helper_find_sizes (fb_helper, &sizes);
@@ -1632,9 +1637,11 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)strcpy (fb_helper->fb->comm,"[fbcon]" ); + info = fb_helper->info; +/* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */ -if (dev_is_pci (dev->dev)) -vga_switcheroo_client_fb_set (to_pci_dev (dev->dev), fb_helper->info); +if (dev_is_pci (info->device)) +vga_switcheroo_client_fb_set (to_pci_dev (info->device), info);return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainercover drm: Provide client setup helper and convert drivers
Provide drm_client_setup() to initialize in-kernel DRM clients. Then convert all drivers to the new interface. Remove old interfaces for the fbdev client.
So far, the only supported DRM client in the kernel is for fbdev emulation with its fbcon support. Long term, we want to move away from fbcon. Possible replacements are DRM-based loggers, boot-up logos or maybe even a console. The exact kind of client should be configurable by the user. You can find examples of such clients at
[1] and [2].
To do this, we need one single interface for drivers to initialize the configured in-kernel clients, replacing the current call to initialize fbdev emulation. The fbdev emulation also depends on the DRM driver's management, so drivers differ in what fbdev code they run. We need to abstract this as well.
This patchset addresses these topics. While there are many patches, most of them are small, straight-forward changes to drivers or rearrange existing code.
Patches 1 to 3 add a driver-neutral setup function for the fbdev client. The new callback fbdev_probe in struct drm_driver creates the GEM buffer for fbdev output. It replaces the existing callback fb_probe from struct drm_fb_helper_funcs, which currently does the same. The client code is equal to code in exisisting fbdev emulation, except for its use of fbdev_probe.
Patch 4 adds drm_client_setup(), a client-agnostic interface to initialize the in-kernel DRM clients. It only supports the new fbdev emulation setup, but additional clients will be added here. Hopefully this will hide future changes to DRM client initialization from drivers.
Patches 5 to 49 rework all drivers with GEM memory management based on DMA helpers. This is fairly straigh-forward. The fbdev-dma helpers provide an implementation of the fbdev_probe helpers. Each driver sets the new callback in its instance of struct drm_driver and calls drm_client_setup(). Then the old fbdev-dma client goes away.
Patches 50 to 63 do the same for drivers with SHMEM-based GEM memory management. The fbdev client code is again the same as before, except for the fbdev_probe callback.
Patches 64 to 73 do the same for drivers with TTM-based GEM memory management.
Patches 74 to 85 do the same for the remaining drivers with custom fbdev emulation. As before, the new fbdev client code is mostly the same the old one; except for the fbdev_probe function. The changes for i915/xe and omapdrm are a bit mor einvolved, but nothing too complicated.
Patch 86 removes the obsolete fb_probe callback from struct drm_fb_helper_funcs.
This patchset has been tested on various hardware with the various memory managers involved.
[1] https://lore.kernel.org/dri-devel/[email protected]/
[2] https://lists.freedesktop.org/archives/dri-devel/2019-March/212113.html
Thomas Zimmermann (86):
drm/fbdev-helper: Move color-mode lookup into 4CC format helper drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info drm/fbdev: Add memory-agnostic fbdev client
drm: Add client-agnostic setup helper
drm/fbdev-dma: Support struct drm_driver.fbdev_probe drm/arcgpu: Run DRM default client setup drm/arm/komeda: Run DRM default client setup drm/arm/hdlcd: Run DRM default client setup drm/arm/malidp: Run DRM default client setup drm/aspeed: Run DRM default client setup drm/atmel-hdlcd: Run DRM default client setup drm/fsl-dcu: Run DRM default client setup drm/hisilicon/kirin: Run DRM default client setup drm/hx8357d: Run DRM default client setup
drm/ili9163: Run DRM default client setup
drm/ili9225: Run DRM default client setup
drm/ili9341: Run DRM default client setup
drm/ili9486: Run DRM default client setup
drm/imx/dcss: Run DRM default client setup drm/imx/ipuv3: Run DRM default client setup drm/imx/lcdc: Run DRM default client setup
drm/ingenic: Run DRM default client setup
drm/kmb: Run DRM default client setup
drm/logicvc: Run DRM default client setup
drm/mcde: Run DRM default client setup
drm/mediatek: Run DRM default client setup
drm/meson: Run DRM default client setup
drm/mi0283qt: Run DRM default client setup drm/mxsfb/lcdif: Run DRM default client setup drm/msxfb: Run DRM default client setup drm/panel/ili9341: Run DRM default client setup drm/panel-mipi-dbi: Run DRM default client setup drm/pl111: Run DRM default client setup drm/renesas/rcar-du: Run DRM default client setup drm/renesas/rz-du: Run DRM default client setup drm/renesas/shmobile: Run DRM default client setup drm/repaper: Run DRM default client setup
drm/rockchip: Run DRM default client setup
drm/sti: Run DRM default client setup
drm/stm: Run DRM default client setup
drm/sun4i: Run DRM default client setup
drm/tidss: Run DRM default client setup
drm/tilcdc: Run DRM default client setup
drm/st7586: Run DRM default client setup
drm/st7735r: Run DRM default client setup
drm/tve200: Run DRM default client setup
drm/vc4: Run DRM default client setup
drm/xlnx: Run DRM default client setup
drm/fbdev-dma: Remove obsolete setup function drm/fbdev-shmem: Support struct drm_driver.fbdev_probe drm/ast: Run DRM default client setup
drm/cirrus: Run DRM default client setup
drm/gm12u320: Run DRM default client setup
drm/gud: Run DRM default client setup
drm/hyperv_drm: Run DRM default client setup drm/mgag200: Run DRM default client setup
drm/ofdrm: Use DRM default client setup
drm/simpledrm: Run DRM default client setup drm/solomon: Run DRM default client setup
drm/udl: Run DRM default client setup
drm/virtgpu: Run DRM default client setup
drm/vkms: Run DRM default client setup
drm/fbdev-shmem: Remove obsolete setup function drm/fbdev-ttm: Support struct drm_driver.fbdev_probe drm/amdgpu: Run DRM default client setup
drm/bochs: Run DRM default client setup drm/hisilicon/hibmc: Run DRM default client setup drm/loongson: Run DRM default client setup
drm/nouveau: Run DRM default client setup
drm/qxl: Run DRM default client setup
drm/vboxvideo: Run DRM default client setup
drm/vmwgfx: Run DRM default client setup
drm/fbdev-ttm: Remove obsolete setup function drm/armada: Run DRM default client setup drm/exynos-drm: Run DRM default client setup drm/gma500: Run DRM default client setup
drm/msm: Run DRM default client setup
drm/radeon: Run DRM default client setup
drm/tegra: Run DRM default client setup
drm/i915: Remove struct drm_fb_helper from struct intel_fbdev drm/i915: Move custom restore code into separate callback drm/i915: Move custom hotplug code into separate callback drm/{i915,xe}: Run DRM default client setup drm/omapdrm: Remove struct drm_fb_helper from struct omap_fbdev. drm/omapdrm: Run DRM default client setup drm/fb-helper: Remove struct drm_fb_helper.fb_probe
drivers/gpu/drm/Makefile | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +- .../gpu/drm/arm/display/komeda/komeda_drv.c | 4 +- .../gpu/drm/arm/display/komeda/komeda_kms.c | 2 + drivers/gpu/drm/arm/hdlcd_drv.c | 4 +- drivers/gpu/drm/arm/malidp_drv.c | 4 +- drivers/gpu/drm/armada/armada_drm.h | 11 +- drivers/gpu/drm/armada/armada_drv.c | 4 +- drivers/gpu/drm/armada/armada_fbdev.c | 115 +------- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +- drivers/gpu/drm/ast/ast_drv.c | 6 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 +- drivers/gpu/drm/drm_client_setup.c | 55 ++++ drivers/gpu/drm/drm_fb_helper.c | 109 +++----- drivers/gpu/drm/drm_fbdev_client.c | 132 +++++++++ drivers/gpu/drm/drm_fbdev_dma.c | 170 +++-------- drivers/gpu/drm/drm_fbdev_shmem.c | 170 +++-------- drivers/gpu/drm/drm_fbdev_ttm.c | 225 ++++----------- drivers/gpu/drm/drm_fourcc.c | 30 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 101 +------ drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 15 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 +- drivers/gpu/drm/gma500/fbdev.c | 100 +------ drivers/gpu/drm/gma500/psb_drv.c | 4 +- drivers/gpu/drm/gma500/psb_drv.h | 12 +- drivers/gpu/drm/gud/gud_drv.c | 4 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 +- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 2 + .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 +- drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 263 ++++++------------ drivers/gpu/drm/i915/display/intel_fbdev.h | 8 + drivers/gpu/drm/i915/i915_driver.c | 2 + drivers/gpu/drm/imx/dcss/dcss-kms.c | 4 +- drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 4 +- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 4 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +- drivers/gpu/drm/kmb/kmb_drv.c | 4 +- drivers/gpu/drm/logicvc/logicvc_drm.c | 11 +- drivers/gpu/drm/loongson/lsdc_drv.c | 4 +- drivers/gpu/drm/mcde/mcde_drv.c | 4 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +- drivers/gpu/drm/meson/meson_drv.c | 4 +- drivers/gpu/drm/mgag200/mgag200_drv.c | 5 +- drivers/gpu/drm/msm/msm_drv.c | 4 +- drivers/gpu/drm/msm/msm_drv.h | 13 +- drivers/gpu/drm/msm/msm_fbdev.c | 144 ++-------- drivers/gpu/drm/mxsfb/lcdif_drv.c | 4 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +- drivers/gpu/drm/omapdrm/omap_drv.c | 1 + drivers/gpu/drm/omapdrm/omap_drv.h | 3 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 161 +++-------- drivers/gpu/drm/omapdrm/omap_fbdev.h | 8 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 +- drivers/gpu/drm/pl111/pl111_drv.c | 4 +- drivers/gpu/drm/qxl/qxl_drv.c | 4 +- drivers/gpu/drm/radeon/radeon_drv.c | 13 +- drivers/gpu/drm/radeon/radeon_fbdev.c | 114 +------- drivers/gpu/drm/radeon/radeon_mode.h | 12 +- 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 | 5 +- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 +- drivers/gpu/drm/solomon/ssd130x.c | 4 +- drivers/gpu/drm/sti/sti_drv.c | 4 +- drivers/gpu/drm/stm/drv.c | 5 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +- drivers/gpu/drm/tegra/drm.c | 5 +- drivers/gpu/drm/tegra/drm.h | 12 +- drivers/gpu/drm/tegra/fbdev.c | 98 +------ drivers/gpu/drm/tidss/tidss_drv.c | 4 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 +- drivers/gpu/drm/tiny/arcpgu.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 | 9 +- drivers/gpu/drm/tiny/panel-mipi-dbi.c | 4 +- drivers/gpu/drm/tiny/repaper.c | 4 +- drivers/gpu/drm/tiny/simpledrm.c | 9 +- drivers/gpu/drm/tiny/st7586.c | 4 +- drivers/gpu/drm/tiny/st7735r.c | 4 +- drivers/gpu/drm/tve200/tve200_drv.c | 9 +- drivers/gpu/drm/udl/udl_drv.c | 4 +- drivers/gpu/drm/vboxvideo/vbox_drv.c | 4 +- drivers/gpu/drm/vc4/vc4_drv.c | 5 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 6 +- drivers/gpu/drm/vkms/vkms_drv.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 5 +- drivers/gpu/drm/xe/xe_device.c | 3 + drivers/gpu/drm/xlnx/zynqmp_kms.c | 4 +- include/drm/drm_client_setup.h | 12 + include/drm/drm_drv.h | 18 ++ include/drm/drm_fb_helper.h | 43 +-- include/drm/drm_fbdev_client.h | 19 ++ include/drm/drm_fbdev_dma.h | 13 +- include/drm/drm_fbdev_shmem.h | 13 +- include/drm/drm_fbdev_ttm.h | 15 +- include/drm/drm_fourcc.h | 1 + 107 files changed, 994 insertions(+), 1558 deletions(-) create mode 100644 drivers/gpu/drm/drm_client_setup.c create mode 100644 drivers/gpu/drm/drm_fbdev_client.c create mode 100644 include/drm/drm_client_setup.h create mode 100644 include/drm/drm_fbdev_client.h
base-commit: 70d6d55dea574b7b78ccf714699cc5d8d62fcc2c
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 3/86 drm/fbdev: Add memory-agnostic fbdev client
Add an fbdev client that can work with any memory manager. The client implementation is ther same as existing code in fbdev-dma or fbdev-shmem.
Provide struct drm_driver.fbdev_probe for the new client to allocate the surface GEM buffer. The new callback replaces fb_probe of struct drm_fb_helper_funcs, which does the same.
To use the new client, DRM drivers set fbdev_probe in their struct drm_driver instance and call drm_fbdev_client_setup(). Probing and creating the fbdev surface buffer is now independent from the other operations in struct drm_fb_helper.
--- drivers/gpu/drm/Makefile | 4 +- drivers/gpu/drm/drm_fb_helper.c | 15 ++-- drivers/gpu/drm/drm_fbdev_client.c | 132 +++++++++++++++++++++++++++++ include/drm/drm_drv.h | 18 ++++ include/drm/drm_fbdev_client.h | 19 +++++ 5 files changed, 181 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/drm_fbdev_client.c create mode 100644 include/drm/drm_fbdev_client.h
drivers/gpu/drm/Makefile +3 -1
@@ -144,7 +144,9 @@ drm_kms_helper-y := \ drm_self_refresh_helper.o \ drm_simple_kms_helper.o drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o -drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o +drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += \ + drm_fbdev_client.o \ + drm_fb_helper.o obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o #
drivers/gpu/drm/drm_fb_helper.c +9 -6
@@ -492,8 +492,8 @@ EXPORT_SYMBOL(drm_fb_helper_init);* @fb_helper: driver-allocated fbdev helper * * A helper to alloc fb_info and the member cmap. Called by the driver -* within the fb_probe fb_helper callback function. Drivers do not -* need to release the allocated fb_info structure themselves, this is +* within the struct &drm_driver.fbdev_probe callback function. Drivers do +* not need to release the allocated fb_info structure themselves, this is * automatically done when calling drm_fb_helper_fini(). * * RETURNS:
@@ -1612,7 +1612,7 @@ static int drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper,/* * Allocates the backing storage and sets up the fbdev info structure through -* the ->fb_probe callback. +* the ->fbdev_probe callback. */ static int drm_fb_helper_single_fb_probe (struct drm_fb_helper *fb_helper) {
@@ -1631,7 +1631,10 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper) }/* push down into drivers */ - ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); +if (dev->driver->fbdev_probe) + ret = dev->driver->fbdev_probe (fb_helper, &sizes); +else + ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes);if (ret <0 )return ret;
@@ -1705,7 +1708,7 @@ static void drm_fb_helper_fill_var(struct fb_info *info,* instance and the drm framebuffer allocated in &drm_fb_helper.fb. * * Drivers should call this (or their equivalent setup code) from their -* &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev +* &drm_driver.fbdev_probe callback after having allocated the fbdev * backing storage framebuffer. */ void drm_fb_helper_fill_info(struct fb_info *info,
@@ -1861,7 +1864,7 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)* Note that this also registers the fbdev and so allows userspace to call into * the driver through the fbdev interfaces. * -* This function will call down into the &drm_fb_helper_funcs.fb_probe callback +* This function will call down into the &drm_driver.fbdev_probe callback * to let the driver allocate and initialize the fbdev info structure and the * drm framebuffer used to back the fbdev. drm_fb_helper_fill_info() is provided * as a helper to setup simple default values for the fbdev info structure.
drivers/gpu/drm/drm_fbdev_client.c new file +132 -0
132 lines not on this page · raw message
include/drm/drm_drv.h +18 -0
@@ -34,6 +34,8 @@#include <drm/drm_device.h> +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ;struct drm_file ;struct drm_gem_object ;struct drm_master ;
@@ -366,6 +368,22 @@ struct drm_driver { struct drm_device *dev, uint32_t handle, uint64_t *offset); +/** +* @fbdev_probe +* +* Allocates and initialize the fb_info structure for fbdev emulation. +* Furthermore it also needs to allocate the DRM framebuffer used to +* back the fbdev. +* +* This callback is mandatory for fbdev support. +* +* Returns: +* +* 0 on success ot a negative error code otherwise. +*/ +int (*fbdev_probe)(struct drm_fb_helper *fbdev_helper, +struct drm_fb_helper_surface_size *sizes); +/** * @show_fdinfo: *
include/drm/drm_fbdev_client.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef DRM_FBDEV_CLIENT_H +#define DRM_FBDEV_CLIENT_H + +struct drm_device ; +struct drm_format_info ; + +#ifdef CONFIG_DRM_FBDEV_EMULATION +int drm_fbdev_client_setup (struct drm_device *dev,const struct drm_format_info *format); +#else +static inline int drm_fbdev_client_setup (struct drm_device *dev, +const struct drm_format_info *format) +{ +return 0 ; +} +#endif + +#endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 6/86 drm/arcgpu: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/arcpgu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/arcpgu.c +3 -1
@@ -7,6 +7,7 @@#include <linux/clk.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_drv.h>
@@ -371,6 +372,7 @@ static const struct drm_driver arcpgu_drm_driver = { .patchlevel = 0, .fops = &arcpgu_drm_ops,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , #ifdef CONFIG_DEBUG_FS .debugfs_init = arcpgu_debugfs_init, #endif
@@ -394,7 +396,7 @@ static int arcpgu_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_dma_setup (&arcpgu->drm,16 ); +drm_client_setup (&arcpgu->drm,drm_format_info (DRM_FORMAT_RGB565 ));return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 7/86 drm/arm/komeda: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The komeda driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++-- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_drv.c +2 -2
@@ -9,7 +9,7 @@#include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> -#include <drm/drm_fbdev_dma.h> +#include <drm/drm_client_setup.h> #include <drm/drm_module.h> #include <drm/drm_of.h> #include "komeda_dev.h"
@@ -84,7 +84,7 @@ static int komeda_platform_probe(struct platform_device *pdev) }dev_set_drvdata (dev, mdrv); -drm_fbdev_dma_setup (&mdrv->kms->base,32 ); +drm_client_setup (&mdrv->kms->base,NULL );return 0 ;
drivers/gpu/drm/arm/display/komeda/komeda_kms.c +2 -0
@@ -9,6 +9,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_managed.h>
@@ -58,6 +59,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)static const struct drm_driver komeda_kms_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (komeda_gem_dma_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &komeda_cma_fops, .name ="komeda" , .desc ="Arm Komeda Display Processor driver" ,
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 5/86 drm/fbdev-dma: Support struct drm_driver.fbdev_probe
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and reimplement the old fb_probe callback on top of it. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
This change allows the common fbdev client to run on top of DMA- based DRM drivers.
--- drivers/gpu/drm/drm_fbdev_dma.c | 60 ++++++++++++++++++++------------- include/drm/drm_fbdev_dma.h | 12 +++++++ 2 files changed, 48 insertions(+), 24 deletions(-)
drivers/gpu/drm/drm_fbdev_dma.c +36 -24
@@ -86,6 +86,40 @@ static const struct fb_ops drm_fbdev_dma_fb_ops = {static int drm_fbdev_dma_helper_fb_probe (struct drm_fb_helper *fb_helper,struct drm_fb_helper_surface_size *sizes) +{ +return drm_fbdev_dma_driver_fbdev_probe (fb_helper, sizes); +} + +static int drm_fbdev_dma_helper_fb_dirty (struct drm_fb_helper *helper, +struct drm_clip_rect *clip) +{ +struct drm_device *dev = helper->dev; +int ret; + +/* Call damage handlers only if necessary */ +if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) +return 0 ; + +if (helper->fb->funcs->dirty) { + ret = helper->fb->funcs->dirty (helper->fb,NULL ,0 ,0 , clip,1 ); +if (drm_WARN_ONCE (dev, ret,"Dirty helper failed: ret=%d\n" , ret)) +return ret; + } + +return 0 ; +} + +static const struct drm_fb_helper_funcs drm_fbdev_dma_helper_funcs = { + .fb_probe = drm_fbdev_dma_helper_fb_probe, + .fb_dirty = drm_fbdev_dma_helper_fb_dirty, +}; + +/* +* struct drm_fb_helper +*/ + +int drm_fbdev_dma_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes) {struct drm_client_dev *client = &fb_helper->client;struct drm_device *dev = fb_helper->dev;
@@ -119,6 +153,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, goto err_drm_client_buffer_delete; } + fb_helper->funcs = &drm_fbdev_dma_helper_funcs; fb_helper->buffer = buffer; fb_helper->fb = fb;
@@ -165,30 +200,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,drm_client_framebuffer_delete (buffer);return ret; } - -static int drm_fbdev_dma_helper_fb_dirty (struct drm_fb_helper *helper, -struct drm_clip_rect *clip) -{ -struct drm_device *dev = helper->dev; -int ret; - -/* Call damage handlers only if necessary */ -if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) -return 0 ; - -if (helper->fb->funcs->dirty) { - ret = helper->fb->funcs->dirty (helper->fb,NULL ,0 ,0 , clip,1 ); -if (drm_WARN_ONCE (dev, ret,"Dirty helper failed: ret=%d\n" , ret)) -return ret; - } - -return 0 ; -} - -static const struct drm_fb_helper_funcs drm_fbdev_dma_helper_funcs = { - .fb_probe = drm_fbdev_dma_helper_fb_probe, - .fb_dirty = drm_fbdev_dma_helper_fb_dirty, -}; +EXPORT_SYMBOL (drm_fbdev_dma_driver_fbdev_probe);/* * struct drm_client_funcs
include/drm/drm_fbdev_dma.h +12 -0
@@ -4,12 +4,24 @@#define DRM_FBDEV_DMA_H struct drm_device ; +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ;#ifdef CONFIG_DRM_FBDEV_EMULATION +int drm_fbdev_dma_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes); + +#define DRM_FBDEV_DMA_DRIVER_OPS \ + .fbdev_probe = drm_fbdev_dma_driver_fbdev_probe +void drm_fbdev_dma_setup (struct drm_device *dev,unsigned int preferred_bpp);#else static inline void drm_fbdev_dma_setup (struct drm_device *dev,unsigned int preferred_bpp) { } + +#define DRM_FBDEV_DMA_DRIVER_OPS \ + .fbdev_probe = NULL +#endif #endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 4/86 drm: Add client-agnostic setup helper
In reply to Thomas ZimmermannDRM may support multiple in-kernel clients that run as soon as a DRM driver has been registered. To select the client(s) in a single place, introduce drm_client_setup().
Drivers that call the new helper automatically instantiate the kernel's configured default clients. Only fbdev emulation is currently supported. Later versions can add support for DRM-based logging, a boot logo or even a console.
Some drivers handle the color mode for clients internally. Provide the helper drm_client_setup_with_color_mode() for them.
--- drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_client_setup.c | 55 ++++++++++++++++++++++++++++++ include/drm/drm_client_setup.h | 12 +++++++ 3 files changed, 68 insertions(+) create mode 100644 drivers/gpu/drm/drm_client_setup.c create mode 100644 include/drm/drm_client_setup.h
drivers/gpu/drm/Makefile +1 -0
@@ -129,6 +129,7 @@ drm_kms_helper-y := \ drm_atomic_helper.o \ drm_atomic_state_helper.o \ drm_bridge_connector.o \ + drm_client_setup.o \ drm_crtc_helper.o \ drm_damage_helper.o \ drm_encoder_slave.o \
drivers/gpu/drm/drm_client_setup.c new file +55 -0
55 lines not on this page · raw message
include/drm/drm_client_setup.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef DRM_CLIENT_SETUP_H +#define DRM_CLIENT_SETUP_H + +struct drm_device ; +struct drm_format_info ; + +void drm_client_setup (struct drm_device *dev,const struct drm_format_info *format); +void drm_client_setup_with_color_mode (struct drm_device *dev,unsigned int color_mode); + +#endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 8/86 drm/arm/hdlcd: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The hdlcd driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/arm/hdlcd_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/arm/hdlcd_drv.c +3 -1
@@ -23,6 +23,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_crtc.h> #include <drm/drm_debugfs.h> #include <drm/drm_drv.h>
@@ -228,6 +229,7 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);static const struct drm_driver hdlcd_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &fops, .name ="hdlcd" , .desc ="ARM HDLCD Controller DRM" ,
@@ -299,7 +301,7 @@ static int hdlcd_drm_bind(struct device *dev)if (ret) goto err_register; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 10/86 drm/aspeed: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The aspeed driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +2 -1
@@ -14,6 +14,7 @@#include <linux/reset.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_device.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -339,7 +340,7 @@ static int aspeed_gfx_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_dma_setup (&priv->drm,32 ); +drm_client_setup (&priv->drm,NULL );return 0 ; err_unload:
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 9/86 drm/arm/malidp: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The malidp driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/arm/malidp_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/arm/malidp_drv.c +3 -1
@@ -18,6 +18,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_crtc.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -562,6 +563,7 @@ static void malidp_debugfs_init(struct drm_minor *minor)static const struct drm_driver malidp_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (malidp_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , #ifdef CONFIG_DEBUG_FS .debugfs_init = malidp_debugfs_init, #endif
@@ -852,7 +854,7 @@ static int malidp_bind(struct device *dev)if (ret) goto register_fail; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 11/86 drm/atmel-hdlcd: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +3 -1
@@ -18,8 +18,10 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_module.h>
@@ -865,7 +867,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_dma_setup (ddev,24 ); +drm_client_setup (ddev,drm_format_info (DRM_FORMAT_RGB888 ));return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 14/86 drm/hx8357d: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/hx8357d.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/hx8357d.c +3 -1
@@ -17,6 +17,7 @@#include <linux/spi/spi.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -194,6 +195,7 @@ static const struct drm_driver hx8357d_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &hx8357d_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "hx8357d", .desc = "HX8357D",
@@ -256,7 +258,7 @@ static int hx8357d_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 13/86 drm/hisilicon/kirin: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The kirin driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 2 ++ drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +2 -0
@@ -25,6 +25,7 @@#include <drm/drm_crtc.h> #include <drm/drm_drv.h> #include <drm/drm_fb_dma_helper.h> +#include <drm/drm_fbdev_dma.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_dma_helper.h>
@@ -925,6 +926,7 @@ static const struct drm_driver ade_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ade_fops,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .name = "kirin", .desc = "Hisilicon Kirin620 SoC DRM Driver", .date = "20150718",
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +2 -2
@@ -18,8 +18,8 @@#include <linux/platform_device.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> -#include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_module.h>
@@ -237,7 +237,7 @@ static int kirin_drm_bind(struct device *dev)if (ret) goto err_kms_cleanup; -drm_fbdev_dma_setup (drm_dev,32 ); +drm_client_setup (drm_dev,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 15/86 drm/ili9163: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/ili9163.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/ili9163.c +3 -1
@@ -8,6 +8,7 @@#include <linux/spi/spi.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -113,6 +114,7 @@ static struct drm_driver ili9163_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9163_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "ili9163", .desc = "Ilitek ILI9163",
@@ -185,7 +187,7 @@ static int ili9163_probe(struct spi_device *spi)if (ret)return ret; -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 16/86 drm/ili9225: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/ili9225.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/ili9225.c +3 -1
@@ -17,6 +17,7 @@#include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_dma_helper.h>
@@ -360,6 +361,7 @@ static const struct drm_driver ili9225_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9225_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .name = "ili9225", .desc = "Ilitek ILI9225", .date = "20171106",
@@ -426,7 +428,7 @@ static int ili9225_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 25/86 drm/mcde: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The mcde driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/mcde/mcde_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/mcde/mcde_drv.c +3 -1
@@ -67,6 +67,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fb_dma_helper.h> #include <drm/drm_fbdev_dma.h>
@@ -212,6 +213,7 @@ static const struct drm_driver mcde_drm_driver = { .minor = 0, .patchlevel = 0, DRM_GEM_DMA_DRIVER_OPS, + DRM_FBDEV_DMA_DRIVER_OPS, };static int mcde_drm_bind (struct device *dev)
@@ -237,7 +239,7 @@ static int mcde_drm_bind(struct device *dev)if (ret <0 ) goto unbind; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 12/86 drm/fsl-dcu: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup_with_color_mode() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +3 -1
@@ -19,6 +19,7 @@#include <linux/regmap.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -156,6 +157,7 @@ static const struct drm_driver fsl_dcu_drm_driver = { .load = fsl_dcu_load, .unload = fsl_dcu_unload,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &fsl_dcu_drm_fops, .name = "fsl-dcu-drm", .desc = "Freescale DCU DRM",
@@ -333,7 +335,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)if (ret <0 ) goto put; -drm_fbdev_dma_setup (drm, legacyfb_depth); +drm_client_setup_with_color_mode (drm, legacyfb_depth);return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 21/86 drm/imx/lcdc: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/imx/lcdc/imx-lcdc.c +3 -1
@@ -3,6 +3,7 @@#include <drm/drm_bridge.h> #include <drm/drm_bridge_connector.h> +#include <drm/drm_client_setup.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -348,6 +349,7 @@ static struct drm_driver imx_lcdc_drm_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &imx_lcdc_drm_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .name = "imx-lcdc", .desc = "i.MX LCDC driver", .date = "20200716",
@@ -501,7 +503,7 @@ static int imx_lcdc_probe(struct platform_device *pdev)if (ret)return dev_err_probe (dev, ret,"Cannot register device\n" ); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 17/86 drm/ili9341: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/ili9341.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/ili9341.c +3 -1
@@ -16,6 +16,7 @@#include <linux/spi/spi.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -150,6 +151,7 @@ static const struct drm_driver ili9341_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9341_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "ili9341", .desc = "Ilitek ILI9341",
@@ -218,7 +220,7 @@ static int ili9341_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 18/86 drm/ili9486: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/ili9486.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/ili9486.c +3 -1
@@ -15,6 +15,7 @@#include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -172,6 +173,7 @@ static const struct drm_driver ili9486_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9486_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "ili9486", .desc = "Ilitek ILI9486",
@@ -247,7 +249,7 @@ static int ili9486_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 19/86 drm/imx/dcss: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The dcss driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/imx/dcss/dcss-kms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/imx/dcss/dcss-kms.c +3 -1
@@ -6,6 +6,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_bridge_connector.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -28,6 +29,7 @@ static const struct drm_mode_config_funcs dcss_drm_mode_config_funcs = {static const struct drm_driver dcss_kms_driver = { .driver_features =DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &dcss_cma_fops, .name ="imx-dcss" , .desc ="i.MX8MQ Display Subsystem" ,
@@ -145,7 +147,7 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)if (ret) goto cleanup_crtc; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return kms;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 22/86 drm/ingenic: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The ingenic driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +3 -1
@@ -24,6 +24,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> #include <drm/drm_bridge_connector.h> +#include <drm/drm_client_setup.h> #include <drm/drm_color_mgmt.h> #include <drm/drm_crtc.h> #include <drm/drm_damage_helper.h>
@@ -960,6 +961,7 @@ static const struct drm_driver ingenic_drm_driver_data = { .fops = &ingenic_drm_fops, .gem_create_object = ingenic_drm_gem_create_object,DRM_GEM_DMA_DRIVER_OPS , + DRM_FBDEV_DMA_DRIVER_OPS, }; static const struct drm_plane_funcs ingenic_drm_primary_plane_funcs = {
@@ -1399,7 +1401,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) goto err_clk_notifier_unregister; } -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 20/86 drm/imx/ipuv3: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup_with_color_mode() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/imx/ipuv3/imx-drm-core.c +3 -1
@@ -15,6 +15,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -163,6 +164,7 @@ static int imx_drm_dumb_create(struct drm_file *file_priv,static const struct drm_driver imx_drm_driver = { .driver_features =DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (imx_drm_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , .ioctls = imx_drm_ioctls, .num_ioctls =ARRAY_SIZE (imx_drm_ioctls), .fops = &imx_drm_driver_fops,
@@ -249,7 +251,7 @@ static int imx_drm_bind(struct device *dev)if (ret) goto err_poll_fini; -drm_fbdev_dma_setup (drm, legacyfb_depth); +drm_client_setup_with_color_mode (drm, legacyfb_depth);return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 24/86 drm/logicvc: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The logicvc driver specifies a preferred color mode from the value in struct drm_mode_config. Use it to select the default format.
--- drivers/gpu/drm/logicvc/logicvc_drm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/logicvc/logicvc_drm.c +5 -6
@@ -16,8 +16,10 @@#include <linux/types.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_print.h>
@@ -55,6 +57,7 @@ static struct drm_driver logicvc_drm_driver = { .minor = 0,DRM_GEM_DMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE (logicvc_drm_gem_dma_dumb_create), + DRM_FBDEV_DMA_DRIVER_OPS, };static struct regmap_config logicvc_drm_regmap_config = {
@@ -301,7 +304,6 @@ static int logicvc_drm_probe(struct platform_device *pdev)struct regmap *regmap =NULL ;struct resource res;void __iomem *base; -unsigned int preferred_bpp;int irq;int ret;
@@ -441,15 +443,12 @@ static int logicvc_drm_probe(struct platform_device *pdev)switch (drm_dev->mode_config.preferred_depth) {case 16 : - preferred_bpp =16 ; +drm_client_setup (drm_dev,drm_format_info (DRM_FORMAT_RGB565 ));break ; -case 24 : -case 32 :default : - preferred_bpp =32 ; +drm_client_setup (drm_dev,NULL );break ; } -drm_fbdev_dma_setup (drm_dev, preferred_bpp);return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 23/86 drm/kmb: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/kmb/kmb_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/kmb/kmb_drv.c +3 -1
@@ -14,6 +14,7 @@#include <linux/regmap.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -441,6 +442,7 @@ static const struct drm_driver kmb_driver = {/* GEM Operations */ .fops = &fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .name = "kmb-drm", .desc = "KEEMBAY DISPLAY DRIVER", .date = DRIVER_DATE,
@@ -561,7 +563,7 @@ static int kmb_probe(struct platform_device *pdev)if (ret) goto err_register; -drm_fbdev_dma_setup (&kmb->drm,0 ); +drm_client_setup (&kmb->drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 28/86 drm/mi0283qt: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/mi0283qt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/mi0283qt.c +3 -1
@@ -14,6 +14,7 @@#include <linux/spi/spi.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -154,6 +155,7 @@ static const struct drm_driver mi0283qt_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &mi0283qt_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "mi0283qt", .desc = "Multi-Inno MI0283QT",
@@ -226,7 +228,7 @@ static int mi0283qt_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 26/86 drm/mediatek: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The mediatek driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +3 -1
@@ -14,6 +14,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_fourcc.h>
@@ -610,6 +611,7 @@ static const struct drm_driver mtk_drm_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .dumb_create = mtk_gem_dumb_create, +DRM_FBDEV_DMA_DRIVER_OPS , .gem_prime_import = mtk_gem_prime_import, .gem_prime_import_sg_table = mtk_gem_prime_import_sg_table,
@@ -666,7 +668,7 @@ static int mtk_drm_bind(struct device *dev)if (ret <0 ) goto err_deinit; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 27/86 drm/meson: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The meson driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/meson/meson_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_drv.c +3 -1
@@ -17,6 +17,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -98,6 +99,7 @@ static const struct drm_driver meson_driver = {/* DMA Ops */ DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (meson_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS ,/* Misc */ .fops = &fops,
@@ -353,7 +355,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)if (ret) goto uninstall_irq; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 32/86 drm/panel-mipi-dbi: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/panel-mipi-dbi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/panel-mipi-dbi.c +3 -1
@@ -15,6 +15,7 @@#include <linux/spi/spi.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -264,6 +265,7 @@ static const struct drm_driver panel_mipi_dbi_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &panel_mipi_dbi_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "panel-mipi-dbi", .desc = "MIPI DBI compatible display panel",
@@ -388,7 +390,7 @@ static int panel_mipi_dbi_spi_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 34/86 drm/renesas/rcar-du: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The rcar-du driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c +3 -1
@@ -19,6 +19,7 @@#include <linux/wait.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -606,6 +607,7 @@ static const struct drm_driver rcar_du_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .dumb_create = rcar_du_dumb_create, .gem_prime_import_sg_table = rcar_du_gem_prime_import_sg_table, +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
@@ -716,7 +718,7 @@ static int rcar_du_probe(struct platform_device *pdev)drm_info (&rcdu->ddev,"Device %s probed\n" ,dev_name (&pdev->dev)); -drm_fbdev_dma_setup (&rcdu->ddev,32 ); +drm_client_setup (&rcdu->ddev,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 29/86 drm/mxsfb/lcdif: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The lcdif driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/mxsfb/lcdif_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/mxsfb/lcdif_drv.c +3 -1
@@ -16,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_encoder.h> #include <drm/drm_fbdev_dma.h>
@@ -243,6 +244,7 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);static const struct drm_driver lcdif_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &fops, .name ="imx-lcdif" , .desc ="i.MX LCDIF Controller DRM" ,
@@ -275,7 +277,7 @@ static int lcdif_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 31/86 drm/panel/ili9341: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ilitek-ili9341.c +3 -1
@@ -31,6 +31,7 @@#include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -591,6 +592,7 @@ static struct drm_driver ili9341_dbi_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9341_dbi_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "ili9341", .desc = "Ilitek ILI9341",
@@ -651,7 +653,7 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc,spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 33/86 drm/pl111: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup_with_color_mode() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/pl111/pl111_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/pl111/pl111_drv.c +3 -1
@@ -47,6 +47,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_fourcc.h>
@@ -225,6 +226,7 @@ static const struct drm_driver pl111_drm_driver = { .patchlevel = 0, .dumb_create = drm_gem_dma_dumb_create, .gem_prime_import_sg_table = pl111_gem_import_sg_table, + DRM_FBDEV_DMA_DRIVER_OPS,#if defined(CONFIG_DEBUG_FS ) .debugfs_init = pl111_debugfs_init,
@@ -305,7 +307,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,if (ret <0 ) goto dev_put; -drm_fbdev_dma_setup (drm, priv->variant->fb_depth); +drm_client_setup_with_color_mode (drm, priv->variant->fb_depth);return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 37/86 drm/repaper: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/repaper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/repaper.c +3 -1
@@ -22,6 +22,7 @@#include <linux/thermal.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h>
@@ -913,6 +914,7 @@ static const struct drm_driver repaper_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &repaper_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .name = "repaper", .desc = "Pervasive Displays RePaper e-ink panels", .date = "20170405",
@@ -1118,7 +1120,7 @@ static int repaper_probe(struct spi_device *spi)DRM_DEBUG_DRIVER ("SPI speed: %uMHz\n" , spi->max_speed_hz /1000000 ); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 41/86 drm/sun4i: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The sun4i driver specifies as preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +3 -1
@@ -16,6 +16,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -55,6 +56,7 @@ static const struct drm_driver sun4i_drv_driver = {/* GEM Operations */ DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (drm_sun4i_gem_dumb_create), + DRM_FBDEV_DMA_DRIVER_OPS, };static int sun4i_drv_bind (struct device *dev)
@@ -111,7 +113,7 @@ static int sun4i_drv_bind(struct device *dev)if (ret) goto finish_poll; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );dev_set_drvdata (dev, drm);
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 30/86 drm/msxfb: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The msxfb driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/mxsfb/mxsfb_drv.c +3 -1
@@ -19,6 +19,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -331,6 +332,7 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);static const struct drm_driver mxsfb_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &fops, .name ="mxsfb-drm" , .desc ="MXSFB Controller DRM" ,
@@ -364,7 +366,7 @@ static int mxsfb_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 80/86 drm/i915: Remove struct drm_fb_helper from struct intel_fbdev
In reply to Thomas ZimmermannStore instances of drm_fb_helper and struct intel_fbdev separately. This will allow i915 to use the common fbdev client, which allocates its own instance of struct drm_fb_helper.
There is at most one instance of each per DRM device, so both can be referenced directly from the i915 and DRM device structures. A later patchset might rework the common fbdev client to allow for storing both, drm_fb_helper and intel_fbdev, together in the same place.
--- drivers/gpu/drm/i915/display/intel_fbdev.c | 86 ++++++++++++---------- 1 file changed, 47 insertions(+), 39 deletions(-)
drivers/gpu/drm/i915/display/intel_fbdev.c +47 -39
@@ -42,6 +42,7 @@#include <drm/drm_fb_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_managed.h> #include "gem/i915_gem_mman.h" #include "gem/i915_gem_object.h"
@@ -55,7 +56,6 @@#include "intel_frontbuffer.h" struct intel_fbdev { -struct drm_fb_helper helper;struct intel_framebuffer *fb;struct i915_vma *vma;unsigned long vma_flags;
@@ -70,11 +70,6 @@ struct intel_fbdev {struct mutex hpd_lock; }; -static struct intel_fbdev *to_intel_fbdev (struct drm_fb_helper *fb_helper) -{ - return container_of(fb_helper, struct intel_fbdev, helper); -} -static struct intel_frontbuffer *to_frontbuffer (struct intel_fbdev *ifbdev) {return ifbdev->fb->frontbuffer;
@@ -91,7 +86,9 @@ FB_GEN_DEFAULT_DEFERRED_IOMEM_OPS(intel_fbdev,static int intel_fbdev_set_par (struct fb_info *info) { -struct intel_fbdev *ifbdev =to_intel_fbdev (info->par); +struct drm_fb_helper *fb_helper = info->par; +struct drm_i915_private *i915 =to_i915 (fb_helper->client.dev); +struct intel_fbdev *ifbdev = i915->display.fbdev.fbdev;int ret; ret =drm_fb_helper_set_par (info);
@@ -103,7 +100,9 @@ static int intel_fbdev_set_par(struct fb_info *info)static int intel_fbdev_blank (int blank,struct fb_info *info) { -struct intel_fbdev *ifbdev =to_intel_fbdev (info->par); +struct drm_fb_helper *fb_helper = info->par; +struct drm_i915_private *i915 =to_i915 (fb_helper->client.dev); +struct intel_fbdev *ifbdev = i915->display.fbdev.fbdev;int ret; ret =drm_fb_helper_blank (blank, info);
@@ -116,7 +115,9 @@ static int intel_fbdev_blank(int blank, struct fb_info *info)static int intel_fbdev_pan_display (struct fb_var_screeninfo *var,struct fb_info *info) { -struct intel_fbdev *ifbdev =to_intel_fbdev (info->par); +struct drm_fb_helper *fb_helper = info->par; +struct drm_i915_private *i915 =to_i915 (fb_helper->client.dev); +struct intel_fbdev *ifbdev = i915->display.fbdev.fbdev;int ret; ret =drm_fb_helper_pan_display (var, info);
@@ -128,8 +129,8 @@ static int intel_fbdev_pan_display(struct fb_var_screeninfo *var,static int intel_fbdev_mmap (struct fb_info *info,struct vm_area_struct *vma) { -struct intel_fbdev *fbdev =to_intel_fbdev (info->par); -struct drm_gem_object *bo =drm_gem_fb_get_obj (&fbdev->fb->base,0 ); +struct drm_fb_helper *fb_helper = info->par; +struct drm_gem_object *bo =drm_gem_fb_get_obj (fb_helper->fb,0 );struct drm_i915_gem_object *obj =to_intel_bo (bo);return i915_gem_fb_mmap (obj, vma);
@@ -138,9 +139,11 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)static void intel_fbdev_fb_destroy (struct fb_info *info) {struct drm_fb_helper *fb_helper = info->par; - struct intel_fbdev *ifbdev = container_of(fb_helper, struct intel_fbdev, helper); +struct drm_device *dev = fb_helper->client.dev; +struct drm_i915_private *i915 =to_i915 (dev); +struct intel_fbdev *ifbdev = i915->display.fbdev.fbdev; -drm_fb_helper_fini (&ifbdev->helper); +drm_fb_helper_fini (fb_helper);/* * We rely on the object-free to release the VMA pinning for
@@ -148,11 +151,11 @@ static void intel_fbdev_fb_destroy(struct fb_info *info)* trying to rectify all the possible error paths leading here. */ intel_fb_unpin_vma (ifbdev->vma, ifbdev->vma_flags); -drm_framebuffer_remove (&ifbdev->fb->base); +drm_framebuffer_remove (fb_helper->fb);drm_client_release (&fb_helper->client); -drm_fb_helper_unprepare (&ifbdev->helper); -kfree (ifbdev); +drm_fb_helper_unprepare (fb_helper); +kfree (fb_helper); }__diag_push ();
@@ -175,10 +178,10 @@ __diag_pop();static int intelfb_create (struct drm_fb_helper *helper,struct drm_fb_helper_surface_size *sizes) { -struct intel_fbdev *ifbdev =to_intel_fbdev (helper); -struct intel_framebuffer *fb = ifbdev->fb; -struct drm_device *dev = helper->dev; +struct drm_device *dev = helper->client.dev;struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; +struct intel_framebuffer *fb = ifbdev->fb;const struct i915_gtt_view view = { .type =I915_GTT_VIEW_NORMAL , };
@@ -243,7 +246,7 @@ static int intelfb_create(struct drm_fb_helper *helper, goto out_unpin; } - ifbdev->helper.fb = &fb->base; + helper->fb = &fb->base; info->fbops = &intelfb_ops;
@@ -253,7 +256,7 @@ static int intelfb_create(struct drm_fb_helper *helper,if (ret) goto out_unpin; -drm_fb_helper_fill_info (info, &ifbdev->helper, sizes); +drm_fb_helper_fill_info (info, dev->fb_helper, sizes);/* If the object is shmemfs backed, it will have given us zeroed pages. * If the object is stolen however, it will be full of whatever
@@ -468,6 +471,7 @@ static void intel_fbdev_suspend_worker(struct work_struct *work)static void intel_fbdev_hpd_set_suspend (struct drm_i915_private *i915,int state) {struct intel_fbdev *ifbdev = i915->display.fbdev.fbdev; +struct drm_device *dev = &i915->drm;bool send_hpd = false;mutex_lock (&ifbdev->hpd_lock);
@@ -478,7 +482,7 @@ static void intel_fbdev_hpd_set_suspend(struct drm_i915_private *i915, int stateif (send_hpd) {drm_dbg_kms (&i915->drm,"Handling delayed fbcon HPD event\n" ); -drm_fb_helper_hotplug_event (&ifbdev->helper); +drm_fb_helper_hotplug_event (dev->fb_helper); } }
@@ -497,7 +501,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronousif (!ifbdev->vma) goto set_suspend; - info = ifbdev->helper.info; + info = dev->fb_helper->info;if (synchronous) {/* Flush any pending work to turn the console on, and then
@@ -536,7 +540,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous !i915_gem_object_is_shmem(intel_fb_obj(&ifbdev->fb->base)))memset_io (info->screen_base,0 , info->screen_size); -drm_fb_helper_set_suspend (&ifbdev->helper, state); +drm_fb_helper_set_suspend (dev->fb_helper, state);console_unlock (); set_suspend:
@@ -556,8 +560,8 @@ static int intel_fbdev_output_poll_changed(struct drm_device *dev) ifbdev->hpd_waiting = true;mutex_unlock (&ifbdev->hpd_lock); -if (send_hpd && (ifbdev->vma || ifbdev->helper.deferred_setup)) -drm_fb_helper_hotplug_event (&ifbdev->helper); +if (send_hpd && (ifbdev->vma || dev->fb_helper->deferred_setup)) +drm_fb_helper_hotplug_event (dev->fb_helper);return 0 ; }
@@ -565,6 +569,7 @@ static int intel_fbdev_output_poll_changed(struct drm_device *dev)static int intel_fbdev_restore_mode (struct drm_i915_private *dev_priv) {struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; +struct drm_device *dev = &dev_priv->drm;int ret;if (!ifbdev)
@@ -573,7 +578,7 @@ static int intel_fbdev_restore_mode(struct drm_i915_private *dev_priv)if (!ifbdev->vma)return -ENOMEM ; - ret =drm_fb_helper_restore_fbdev_mode_unlocked (&ifbdev->helper); + ret =drm_fb_helper_restore_fbdev_mode_unlocked (dev->fb_helper);if (ret)return ret;
@@ -656,45 +661,48 @@ void intel_fbdev_setup(struct drm_i915_private *i915) {struct drm_device *dev = &i915->drm;struct intel_fbdev *ifbdev; +struct drm_fb_helper *fb_helper;int ret;if (!HAS_DISPLAY (i915))return ; - ifbdev =kzalloc (sizeof (*ifbdev),GFP_KERNEL ); + ifbdev =drmm_kzalloc (dev,sizeof (*ifbdev),GFP_KERNEL );if (!ifbdev)return ; -drm_fb_helper_prepare (dev, &ifbdev->helper,32 , &intel_fb_helper_funcs); i915->display.fbdev.fbdev = ifbdev;INIT_WORK (&i915->display.fbdev.suspend_work, intel_fbdev_suspend_worker);mutex_init (&ifbdev->hpd_lock); -if (intel_fbdev_init_bios (dev, ifbdev)) - ifbdev->helper.preferred_bpp = ifbdev->preferred_bpp; -else - ifbdev->preferred_bpp = ifbdev->helper.preferred_bpp; +if (!intel_fbdev_init_bios (dev, ifbdev)) + ifbdev->preferred_bpp =32 ; + + fb_helper =kzalloc (sizeof (*fb_helper),GFP_KERNEL ); +if (!fb_helper) +return ; +drm_fb_helper_prepare (dev, fb_helper, ifbdev->preferred_bpp, &intel_fb_helper_funcs); - ret =drm_client_init (dev, &ifbdev->helper.client,"intel-fbdev" , + ret =drm_client_init (dev, &fb_helper->client,"intel-fbdev" , &intel_fbdev_client_funcs);if (ret) {drm_err (dev,"Failed to register client: %d\n" , ret); goto err_drm_fb_helper_unprepare; } -drm_client_register (&ifbdev->helper.client); +drm_client_register (&fb_helper->client);return ; err_drm_fb_helper_unprepare: -drm_fb_helper_unprepare (&ifbdev->helper); +drm_fb_helper_unprepare (dev->fb_helper);mutex_destroy (&ifbdev->hpd_lock); -kfree (ifbdev); +kfree (fb_helper); }struct intel_framebuffer *intel_fbdev_framebuffer (struct intel_fbdev *fbdev) { -if (!fbdev || !fbdev->helper.fb) +if (!fbdev)return NULL ; -return to_intel_framebuffer (fbdev->helper.fb); +return fbdev->fb; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 35/86 drm/renesas/rz-du: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The rz-du driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c +3 -1
@@ -13,6 +13,7 @@#include <linux/platform_device.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -68,6 +69,7 @@ DEFINE_DRM_GEM_DMA_FOPS(rzg2l_du_fops);static const struct drm_driver rzg2l_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .dumb_create = rzg2l_du_dumb_create, +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &rzg2l_du_fops, .name ="rzg2l-du" , .desc ="Renesas RZ/G2L Display Unit" ,
@@ -149,7 +151,7 @@ static int rzg2l_du_probe(struct platform_device *pdev)drm_info (&rcdu->ddev,"Device %s probed\n" ,dev_name (&pdev->dev)); -drm_fbdev_dma_setup (&rcdu->ddev,32 ); +drm_client_setup (&rcdu->ddev,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 36/86 drm/renesas/shmobile: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c +4 -1
@@ -18,8 +18,10 @@#include <linux/slab.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_modeset_helper.h> #include <drm/drm_module.h>
@@ -101,6 +103,7 @@ DEFINE_DRM_GEM_DMA_FOPS(shmob_drm_fops);static const struct drm_driver shmob_drm_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &shmob_drm_fops, .name ="shmob-drm" , .desc ="Renesas SH Mobile DRM" ,
@@ -257,7 +260,7 @@ static int shmob_drm_probe(struct platform_device *pdev)if (ret <0 ) goto err_modeset_cleanup; -drm_fbdev_dma_setup (ddev,16 ); +drm_client_setup (ddev,drm_format_info (DRM_FORMAT_RGB565 ));return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 42/86 drm/tidss: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The tidss driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/tidss/tidss_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tidss/tidss_drv.c +3 -1
@@ -11,6 +11,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_crtc.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -109,6 +110,7 @@ static const struct drm_driver tidss_driver = { .fops = &tidss_fops, .release = tidss_release,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .name = "tidss", .desc = "TI Keystone DSS", .date = "20180215",
@@ -186,7 +188,7 @@ static int tidss_probe(struct platform_device *pdev) goto err_irq_uninstall; } -drm_fbdev_dma_setup (ddev,32 ); +drm_client_setup (ddev,NULL );dev_dbg (dev,"%s done\n" , __func__);
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 81/86 drm/i915: Move custom restore code into separate callback
In reply to Thomas Zimmermanni915's fbdev contains additional code for restoring the client that cannot be ported to the common fbdev client. Introduce the callback struct drm_fb_helper.fb_restore and implement it for i915. The fbdev helpers invoke the callback after restoring the fbdev client.
--- drivers/gpu/drm/drm_fb_helper.c | 3 +++ drivers/gpu/drm/i915/display/intel_fbdev.c | 12 ++++++++++-- include/drm/drm_fb_helper.h | 13 +++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +3 -0
@@ -245,6 +245,9 @@ __drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper,if (do_delayed)drm_fb_helper_hotplug_event (fb_helper); +if (fb_helper->funcs->fb_restore) + fb_helper->funcs->fb_restore (fb_helper); +return ret; }
drivers/gpu/drm/i915/display/intel_fbdev.c +10 -2
@@ -296,9 +296,19 @@ static int intelfb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect *clireturn 0 ; } +static void intelfb_restore (struct drm_fb_helper *fb_helper) +{ +struct drm_device *dev = fb_helper->client.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; + +intel_fbdev_invalidate (ifbdev); +} +static const struct drm_fb_helper_funcs intel_fb_helper_funcs = { .fb_probe = intelfb_create, .fb_dirty = intelfb_dirty, + .fb_restore = intelfb_restore, };/*
@@ -582,8 +592,6 @@ static int intel_fbdev_restore_mode(struct drm_i915_private *dev_priv)if (ret)return ret; -intel_fbdev_invalidate (ifbdev); -return 0 ; }
include/drm/drm_fb_helper.h +13 -0
@@ -99,6 +99,19 @@ struct drm_fb_helper_funcs {* 0 on success, or an error code otherwise. */ int (*fb_dirty)(struct drm_fb_helper *helper,struct drm_clip_rect *clip); + +/** +* @fb_restore: +* +* Driver callback to restore internal fbdev state. If set, fbdev +* emulation will invoke this callback after restoring the display +* mode. +* +* Only for i915. Do not use in new code. +* +* TODO: Fix i915 to not require this callback. +*/ +void (*fb_restore)(struct drm_fb_helper *helper); };/**
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 82/86 drm/i915: Move custom hotplug code into separate callback
In reply to Thomas Zimmermanni915's fbdev contains additional code for hotplugging a display that cannot be ported to the common fbdev client. Introduce the callback struct drm_fb_helper.fb_hotplug and implement it for i915. The fbdev helpers invoke the callback before handing the hotplug event.
--- drivers/gpu/drm/drm_fb_helper.c | 6 +++ drivers/gpu/drm/i915/display/intel_fbdev.c | 43 ++++++++++++---------- include/drm/drm_fb_helper.h | 13 +++++++ 3 files changed, 42 insertions(+), 20 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +6 -0
@@ -1938,6 +1938,12 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)if (!drm_fbdev_emulation || !fb_helper)return 0 ; +if (fb_helper->funcs->fb_hotplug) { + err = fb_helper->funcs->fb_hotplug (fb_helper); +if (err) +return err; + } +mutex_lock (&fb_helper->lock);if (fb_helper->deferred_setup) { err =__drm_fb_helper_initial_config_and_unlock (fb_helper);
drivers/gpu/drm/i915/display/intel_fbdev.c +23 -20
65 lines not on this page · raw message
include/drm/drm_fb_helper.h +13 -0
@@ -112,6 +112,19 @@ struct drm_fb_helper_funcs {* TODO: Fix i915 to not require this callback. */ void (*fb_restore)(struct drm_fb_helper *helper); + +/** +* @fb_hotplug: +* +* Driver callback to prepare hotplug event. If set, fbdev +* emulation will invoke this callback before sending a hotplug +* event. +* +* Only for i915. Do not use in new code. +* +* TODO: Fix i915 to not require this callback. +*/ +int (*fb_hotplug)(struct drm_fb_helper *helper); };/**
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 39/86 drm/sti: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The sti driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/sti/sti_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/sti/sti_drv.c +3 -1
@@ -15,6 +15,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_debugfs.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -136,6 +137,7 @@ static const struct drm_driver sti_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .fops = &sti_driver_fops,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = sti_drm_dbg_init,
@@ -203,7 +205,7 @@ static int sti_bind(struct device *dev)drm_mode_config_reset (ddev); -drm_fbdev_dma_setup (ddev,32 ); +drm_client_setup (ddev,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 40/86 drm/stm: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/stm/drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/stm/drv.c +4 -1
@@ -18,8 +18,10 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_module.h>
@@ -66,6 +68,7 @@ static const struct drm_driver drv_driver = { .patchlevel = 0, .fops = &drv_driver_fops,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (stm_gem_dma_dumb_create), + DRM_FBDEV_DMA_DRIVER_OPS, };static int drv_load (struct drm_device *ddev)
@@ -206,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_dma_setup (ddev,16 ); +drm_client_setup (ddev,drm_format_info (DRM_FORMAT_RGB565 ));return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 44/86 drm/st7586: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/st7586.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/st7586.c +3 -1
@@ -13,6 +13,7 @@#include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_dma_helper.h>
@@ -290,6 +291,7 @@ static const struct drm_driver st7586_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &st7586_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "st7586", .desc = "Sitronix ST7586",
@@ -371,7 +373,7 @@ static int st7586_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 52/86 drm/cirrus: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/cirrus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/cirrus.c +3 -1
@@ -27,6 +27,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_state_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h>
@@ -662,6 +663,7 @@ static const struct drm_driver cirrus_driver = { .fops = &cirrus_fops,DRM_GEM_SHMEM_DRIVER_OPS , + DRM_FBDEV_SHMEM_DRIVER_OPS, }; static int cirrus_pci_probe(struct pci_dev *pdev,
@@ -716,7 +718,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,if (ret)return ret; -drm_fbdev_shmem_setup (dev,16 ); +drm_client_setup (dev,drm_format_info (DRM_FORMAT_RGB565 ));return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 55/86 drm/hyperv_drm: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +3 -1
@@ -10,6 +10,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_shmem.h> #include <drm/drm_gem_shmem_helper.h>
@@ -36,6 +37,7 @@ static struct drm_driver hyperv_driver = { .fops = &hv_fops,DRM_GEM_SHMEM_DRIVER_OPS , + DRM_FBDEV_SHMEM_DRIVER_OPS, }; static int hyperv_pci_probe(struct pci_dev *pdev,
@@ -149,7 +151,7 @@ static int hyperv_vmbus_probe(struct hv_device *hdev, goto err_free_mmio; } -drm_fbdev_shmem_setup (dev,0 ); +drm_client_setup (dev,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 43/86 drm/tilcdc: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup_with_color_mode() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +3 -1
@@ -14,6 +14,7 @@#include <linux/pm_runtime.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_debugfs.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h>
@@ -374,7 +375,8 @@ static int tilcdc_init(const struct drm_driver *ddrv, struct device *dev) goto init_failed; priv->is_registered = true; -drm_fbdev_dma_setup (ddev, bpp); +drm_client_setup_with_color_mode (ddev, bpp); +return 0 ; init_failed:
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 53/86 drm/gm12u320: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/gm12u320.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/gm12u320.c +3 -1
@@ -9,6 +9,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_state_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h>
@@ -625,6 +626,7 @@ static const struct drm_driver gm12u320_drm_driver = { .fops = &gm12u320_fops,DRM_GEM_SHMEM_DRIVER_OPS , .gem_prime_import = gm12u320_gem_prime_import, + DRM_FBDEV_SHMEM_DRIVER_OPS, }; static const struct drm_mode_config_funcs gm12u320_mode_config_funcs = {
@@ -699,7 +701,7 @@ static int gm12u320_usb_probe(struct usb_interface *interface,if (ret) goto err_put_device; -drm_fbdev_shmem_setup (dev,0 ); +drm_client_setup (dev,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 47/86 drm/vc4: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/vc4/vc4_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vc4/vc4_drv.c +4 -1
@@ -32,8 +32,10 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_vblank.h> #include <soc/bcm2835/raspberrypi-firmware.h>
@@ -212,6 +214,7 @@ const struct drm_driver vc4_drm_driver = { .gem_create_object = vc4_create_object,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (vc4_bo_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , .ioctls = vc4_drm_ioctls, .num_ioctls = ARRAY_SIZE(vc4_drm_ioctls),
@@ -389,7 +392,7 @@ static int vc4_drm_bind(struct device *dev)if (ret <0 ) goto err; -drm_fbdev_dma_setup (drm,16 ); +drm_client_setup (drm,drm_format_info (DRM_FORMAT_RGB565 ));return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 50/86 drm/fbdev-shmem: Support struct drm_driver.fbdev_probe
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and reimplement the old fb_probe callback on top of it. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
This change allows the common fbdev client to run on top of SHMEM- based DRM drivers.
--- drivers/gpu/drm/drm_fbdev_shmem.c | 60 ++++++++++++++++++------------- include/drm/drm_fbdev_shmem.h | 11 ++++++ 2 files changed, 47 insertions(+), 24 deletions(-)
drivers/gpu/drm/drm_fbdev_shmem.c +36 -24
@@ -107,6 +107,40 @@ static struct page *drm_fbdev_shmem_get_page(struct fb_info *info, unsigned longstatic int drm_fbdev_shmem_helper_fb_probe (struct drm_fb_helper *fb_helper,struct drm_fb_helper_surface_size *sizes) +{ +return drm_fbdev_shmem_driver_fbdev_probe (fb_helper, sizes); +} + +static int drm_fbdev_shmem_helper_fb_dirty (struct drm_fb_helper *helper, +struct drm_clip_rect *clip) +{ +struct drm_device *dev = helper->dev; +int ret; + +/* Call damage handlers only if necessary */ +if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) +return 0 ; + +if (helper->fb->funcs->dirty) { + ret = helper->fb->funcs->dirty (helper->fb,NULL ,0 ,0 , clip,1 ); +if (drm_WARN_ONCE (dev, ret,"Dirty helper failed: ret=%d\n" , ret)) +return ret; + } + +return 0 ; +} + +static const struct drm_fb_helper_funcs drm_fbdev_shmem_helper_funcs = { + .fb_probe = drm_fbdev_shmem_helper_fb_probe, + .fb_dirty = drm_fbdev_shmem_helper_fb_dirty, +}; + +/* +* struct drm_driver +*/ + +int drm_fbdev_shmem_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes) {struct drm_client_dev *client = &fb_helper->client;struct drm_device *dev = fb_helper->dev;
@@ -139,6 +173,7 @@ static int drm_fbdev_shmem_helper_fb_probe(struct drm_fb_helper *fb_helper, goto err_drm_client_buffer_delete; } + fb_helper->funcs = &drm_fbdev_shmem_helper_funcs; fb_helper->buffer = buffer; fb_helper->fb = fb;
@@ -182,30 +217,7 @@ static int drm_fbdev_shmem_helper_fb_probe(struct drm_fb_helper *fb_helper,drm_client_framebuffer_delete (buffer);return ret; } - -static int drm_fbdev_shmem_helper_fb_dirty (struct drm_fb_helper *helper, -struct drm_clip_rect *clip) -{ -struct drm_device *dev = helper->dev; -int ret; - -/* Call damage handlers only if necessary */ -if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) -return 0 ; - -if (helper->fb->funcs->dirty) { - ret = helper->fb->funcs->dirty (helper->fb,NULL ,0 ,0 , clip,1 ); -if (drm_WARN_ONCE (dev, ret,"Dirty helper failed: ret=%d\n" , ret)) -return ret; - } - -return 0 ; -} - -static const struct drm_fb_helper_funcs drm_fbdev_shmem_helper_funcs = { - .fb_probe = drm_fbdev_shmem_helper_fb_probe, - .fb_dirty = drm_fbdev_shmem_helper_fb_dirty, -}; +EXPORT_SYMBOL (drm_fbdev_shmem_driver_fbdev_probe);/* * struct drm_client_funcs
include/drm/drm_fbdev_shmem.h +11 -0
@@ -4,12 +4,23 @@#define DRM_FBDEV_SHMEM_H struct drm_device ; +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ;#ifdef CONFIG_DRM_FBDEV_EMULATION +int drm_fbdev_shmem_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes); + +#define DRM_FBDEV_SHMEM_DRIVER_OPS \ + .fbdev_probe = drm_fbdev_shmem_driver_fbdev_probe +void drm_fbdev_shmem_setup (struct drm_device *dev,unsigned int preferred_bpp);#else static inline void drm_fbdev_shmem_setup (struct drm_device *dev,unsigned int preferred_bpp) { } + +#define DRM_FBDEV_SHMEM_DRIVER_OPS \ + .fbdev_probe = NULL#endif #endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 49/86 drm/fbdev-dma: Remove obsolete setup function
In reply to Thomas ZimmermannThe old setup function drm_fbdev_dma_setup() is unused. Remove it and its internal callbacks. New drivers should call drm_client_setup() instead.
--- drivers/gpu/drm/drm_fbdev_dma.c | 120 +------------------------------- include/drm/drm_fbdev_dma.h | 7 -- 2 files changed, 1 insertion(+), 126 deletions(-)
drivers/gpu/drm/drm_fbdev_dma.c +1 -119
@@ -2,15 +2,13 @@#include <linux/fb.h> -#include <drm/drm_crtc_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fbdev_dma.h> #include <drm/drm_fb_dma_helper.h> #include <drm/drm_fb_helper.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_dma_helper.h> -#include <drm/drm_fbdev_dma.h> -/* * struct fb_ops */
@@ -84,12 +82,6 @@ static const struct fb_ops drm_fbdev_dma_fb_ops = {* struct drm_fb_helper */ -static int drm_fbdev_dma_helper_fb_probe (struct drm_fb_helper *fb_helper, -struct drm_fb_helper_surface_size *sizes) -{ -return drm_fbdev_dma_driver_fbdev_probe (fb_helper, sizes); -} -static int drm_fbdev_dma_helper_fb_dirty (struct drm_fb_helper *helper,struct drm_clip_rect *clip) {
@@ -110,7 +102,6 @@ static int drm_fbdev_dma_helper_fb_dirty(struct drm_fb_helper *helper, }static const struct drm_fb_helper_funcs drm_fbdev_dma_helper_funcs = { - .fb_probe = drm_fbdev_dma_helper_fb_probe, .fb_dirty = drm_fbdev_dma_helper_fb_dirty, };
@@ -201,112 +192,3 @@ int drm_fbdev_dma_driver_fbdev_probe(struct drm_fb_helper *fb_helper,return ret; }EXPORT_SYMBOL (drm_fbdev_dma_driver_fbdev_probe); - -/* -* struct drm_client_funcs -*/ - -static void drm_fbdev_dma_client_unregister (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); - -if (fb_helper->info) { -drm_fb_helper_unregister_info (fb_helper); - }else { -drm_client_release (&fb_helper->client); -drm_fb_helper_unprepare (fb_helper); -kfree (fb_helper); - } -} - -static int drm_fbdev_dma_client_restore (struct drm_client_dev *client) -{ -drm_fb_helper_lastclose (client->dev); - -return 0 ; -} - -static int drm_fbdev_dma_client_hotplug (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); -struct drm_device *dev = client->dev; -int ret; - -if (dev->fb_helper) -return drm_fb_helper_hotplug_event (dev->fb_helper); - - ret =drm_fb_helper_init (dev, fb_helper); -if (ret) - goto err_drm_err; - -if (!drm_drv_uses_atomic_modeset (dev)) -drm_helper_disable_unused_functions (dev); - - ret =drm_fb_helper_initial_config (fb_helper); -if (ret) - goto err_drm_fb_helper_fini; - -return 0 ; - -err_drm_fb_helper_fini: -drm_fb_helper_fini (fb_helper); -err_drm_err: -drm_err (dev,"fbdev-dma: Failed to setup generic emulation (ret=%d)\n" , ret); -return ret; -} - -static const struct drm_client_funcs drm_fbdev_dma_client_funcs = { - .owner =THIS_MODULE , - .unregister = drm_fbdev_dma_client_unregister, - .restore = drm_fbdev_dma_client_restore, - .hotplug = drm_fbdev_dma_client_hotplug, -}; - -/** -* drm_fbdev_dma_setup() - Setup fbdev emulation for GEM DMA helpers -* @dev: DRM device -* @preferred_bpp: Preferred bits per pixel for the device. -* 32 is used if this is zero. -* -* This function sets up fbdev emulation for GEM DMA drivers that support -* dumb buffers with a virtual address and that can be mmap'ed. -* drm_fbdev_dma_setup() shall be called after the DRM driver registered -* the new DRM device with drm_dev_register(). -* -* Restore, hotplug events and teardown are all taken care of. Drivers that do -* suspend/resume need to call drm_fb_helper_set_suspend_unlocked() themselves. -* Simple drivers might use drm_mode_config_helper_suspend(). -* -* This function is safe to call even when there are no connectors present. -* Setup will be retried on the next hotplug event. -* -* The fbdev is destroyed by drm_dev_unregister(). -*/ -void drm_fbdev_dma_setup (struct drm_device *dev,unsigned int preferred_bpp) -{ -struct drm_fb_helper *fb_helper; -int ret; - -drm_WARN (dev, !dev->registered,"Device has not been registered.\n" ); -drm_WARN (dev, dev->fb_helper,"fb_helper is already set!\n" ); - - fb_helper =kzalloc (sizeof (*fb_helper),GFP_KERNEL ); -if (!fb_helper) -return ; -drm_fb_helper_prepare (dev, fb_helper, preferred_bpp, &drm_fbdev_dma_helper_funcs); - - ret =drm_client_init (dev, &fb_helper->client,"fbdev" , &drm_fbdev_dma_client_funcs); -if (ret) { -drm_err (dev,"Failed to register client: %d\n" , ret); - goto err_drm_client_init; - } - -drm_client_register (&fb_helper->client); - -return ; - -err_drm_client_init: -drm_fb_helper_unprepare (fb_helper); -kfree (fb_helper); -} -EXPORT_SYMBOL (drm_fbdev_dma_setup);
include/drm/drm_fbdev_dma.h +0 -7
@@ -3,7 +3,6 @@#ifndef DRM_FBDEV_DMA_H #define DRM_FBDEV_DMA_H -struct drm_device ;struct drm_fb_helper ;struct drm_fb_helper_surface_size ;
@@ -13,15 +12,9 @@ int drm_fbdev_dma_driver_fbdev_probe(struct drm_fb_helper *fb_helper,#define DRM_FBDEV_DMA_DRIVER_OPS \ .fbdev_probe = drm_fbdev_dma_driver_fbdev_probe - -void drm_fbdev_dma_setup (struct drm_device *dev,unsigned int preferred_bpp);#else -static inline void drm_fbdev_dma_setup (struct drm_device *dev,unsigned int preferred_bpp) -{ } -#define DRM_FBDEV_DMA_DRIVER_OPS \ .fbdev_probe = NULL -#endif #endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 56/86 drm/mgag200: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/mgag200/mgag200_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +4 -1
@@ -11,9 +11,11 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_shmem.h> #include <drm/drm_file.h> +#include <drm/drm_fourcc.h> #include <drm/drm_ioctl.h> #include <drm/drm_managed.h> #include <drm/drm_module.h>
@@ -129,6 +131,7 @@ static const struct drm_driver mgag200_driver = { .minor = DRIVER_MINOR, .patchlevel = DRIVER_PATCHLEVEL, DRM_GEM_SHMEM_DRIVER_OPS, + DRM_FBDEV_SHMEM_DRIVER_OPS, };/*
@@ -314,7 +317,7 @@ mgag200_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)* FIXME: A 24-bit color depth does not work with 24 bpp on * G200ER. Force 32 bpp. */ -drm_fbdev_shmem_setup (dev,32 ); +drm_client_setup (dev,drm_format_info (DRM_FORMAT_XRGB8888 ));return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 51/86 drm/ast: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The ast driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/ast/ast_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/ast/ast_drv.c +4 -2
@@ -32,6 +32,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_shmem.h> #include <drm/drm_gem_shmem_helper.h>
@@ -64,7 +65,8 @@ static const struct drm_driver ast_driver = { .minor = DRIVER_MINOR, .patchlevel = DRIVER_PATCHLEVEL, -DRM_GEM_SHMEM_DRIVER_OPS + DRM_GEM_SHMEM_DRIVER_OPS, + DRM_FBDEV_SHMEM_DRIVER_OPS, };/*
@@ -360,7 +362,7 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret)return ret; -drm_fbdev_shmem_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 54/86 drm/gud: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/gud/gud_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/gud/gud_drv.c +3 -1
@@ -15,6 +15,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_blend.h> +#include <drm/drm_client_setup.h> #include <drm/drm_damage_helper.h> #include <drm/drm_debugfs.h> #include <drm/drm_drv.h>
@@ -376,6 +377,7 @@ static const struct drm_driver gud_drm_driver = { .fops = &gud_fops,DRM_GEM_SHMEM_DRIVER_OPS , .gem_prime_import = gud_gem_prime_import, +DRM_FBDEV_SHMEM_DRIVER_OPS , .name = "gud", .desc = "Generic USB Display",
@@ -622,7 +624,7 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)drm_kms_helper_poll_init (drm); -drm_fbdev_shmem_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 45/86 drm/st7735r: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/st7735r.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/st7735r.c +3 -1
@@ -17,6 +17,7 @@#include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>
@@ -155,6 +156,7 @@ static const struct drm_driver st7735r_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &st7735r_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "st7735r", .desc = "Sitronix ST7735R",
@@ -241,7 +243,7 @@ static int st7735r_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 59/86 drm/solomon: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The solomon driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/solomon/ssd130x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/solomon/ssd130x.c +3 -1
@@ -20,6 +20,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_edid.h>
@@ -1780,6 +1781,7 @@ DEFINE_DRM_GEM_FOPS(ssd130x_fops);static const struct drm_driver ssd130x_drm_driver = {DRM_GEM_SHMEM_DRIVER_OPS , +DRM_FBDEV_SHMEM_DRIVER_OPS , .name =DRIVER_NAME , .desc =DRIVER_DESC , .date =DRIVER_DATE ,
@@ -2029,7 +2031,7 @@ struct ssd130x_device *ssd130x_probe(struct device *dev, struct regmap *regmap)if (ret)return ERR_PTR (dev_err_probe (dev, ret,"DRM device register failed\n" )); -drm_fbdev_shmem_setup (drm,32 ); +drm_client_setup (drm,NULL );return ssd130x; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 61/86 drm/virtgpu: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The virtgpu driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/virtio/virtgpu_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_drv.c +5 -1
@@ -34,6 +34,7 @@#include <drm/drm.h> #include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_shmem.h> #include <drm/drm_file.h>
@@ -103,7 +104,8 @@ static int virtio_gpu_probe(struct virtio_device *vdev)if (ret) goto err_deinit; -drm_fbdev_shmem_setup (vdev->priv,32 ); +drm_client_setup (vdev->priv,NULL ); +return 0 ; err_deinit:
@@ -184,6 +186,8 @@ static const struct drm_driver driver = { .dumb_create = virtio_gpu_mode_dumb_create, .dumb_map_offset = virtio_gpu_mode_dumb_mmap, + DRM_FBDEV_SHMEM_DRIVER_OPS, +#if defined(CONFIG_DEBUG_FS ) .debugfs_init = virtio_gpu_debugfs_init,#endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 83/86 drm/{i915,xe}: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup_with_color_mode() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/i915/display/intel_fbdev.c | 216 ++++++--------------- drivers/gpu/drm/i915/display/intel_fbdev.h | 8 + drivers/gpu/drm/i915/i915_driver.c | 2 + drivers/gpu/drm/xe/xe_device.c | 3 + 4 files changed, 68 insertions(+), 161 deletions(-)
drivers/gpu/drm/i915/display/intel_fbdev.c +55 -161
@@ -37,6 +37,7 @@#include <linux/tty.h> #include <linux/vga_switcheroo.h> +#include <drm/drm_client_setup.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h>
@@ -175,8 +176,55 @@ static const struct fb_ops intelfb_ops = {__diag_pop (); -static int intelfb_create (struct drm_fb_helper *helper, -struct drm_fb_helper_surface_size *sizes) +static int intelfb_dirty (struct drm_fb_helper *helper,struct drm_clip_rect *clip) +{ +if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) +return 0 ; + +if (helper->fb->funcs->dirty) +return helper->fb->funcs->dirty (helper->fb,NULL ,0 ,0 , clip,1 ); + +return 0 ; +} + +static void intelfb_restore (struct drm_fb_helper *fb_helper) +{ +struct drm_device *dev = fb_helper->client.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; + +intel_fbdev_invalidate (ifbdev); +} + +static int intelfb_hotplug (struct drm_fb_helper *fb_helper) +{ +struct drm_device *dev = fb_helper->client.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; +bool send_hpd; + +if (!ifbdev) +return -EINVAL ; + +mutex_lock (&ifbdev->hpd_lock); + send_hpd = !ifbdev->hpd_suspended; + ifbdev->hpd_waiting = true; +mutex_unlock (&ifbdev->hpd_lock); + +if (!send_hpd || !(ifbdev->vma || dev->fb_helper->deferred_setup)) +return -EAGAIN ; + +return 0 ; +} + +static const struct drm_fb_helper_funcs intel_fb_helper_funcs = { + .fb_dirty = intelfb_dirty, + .fb_restore = intelfb_restore, + .fb_hotplug = intelfb_hotplug, +}; + +int intel_fbdev_driver_fbdev_probe (struct drm_fb_helper *helper, +struct drm_fb_helper_surface_size *sizes) {struct drm_device *dev = helper->client.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -246,6 +294,7 @@ static int intelfb_create(struct drm_fb_helper *helper, goto out_unpin; } + helper->funcs = &intel_fb_helper_funcs; helper->fb = &fb->base; info->fbops = &intelfb_ops;
@@ -285,54 +334,6 @@ static int intelfb_create(struct drm_fb_helper *helper,return ret; } -static int intelfb_dirty (struct drm_fb_helper *helper,struct drm_clip_rect *clip) -{ -if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) -return 0 ; - -if (helper->fb->funcs->dirty) -return helper->fb->funcs->dirty (helper->fb,NULL ,0 ,0 , clip,1 ); - -return 0 ; -} - -static void intelfb_restore (struct drm_fb_helper *fb_helper) -{ -struct drm_device *dev = fb_helper->client.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; - -intel_fbdev_invalidate (ifbdev); -} - -static int intelfb_hotplug (struct drm_fb_helper *fb_helper) -{ -struct drm_device *dev = fb_helper->client.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; -bool send_hpd; - -if (!ifbdev) -return -EINVAL ; - -mutex_lock (&ifbdev->hpd_lock); - send_hpd = !ifbdev->hpd_suspended; - ifbdev->hpd_waiting = true; -mutex_unlock (&ifbdev->hpd_lock); - -if (!send_hpd || !(ifbdev->vma || dev->fb_helper->deferred_setup)) -return -EAGAIN ; - -return 0 ; -} - -static const struct drm_fb_helper_funcs intel_fb_helper_funcs = { - .fb_probe = intelfb_create, - .fb_dirty = intelfb_dirty, - .fb_restore = intelfb_restore, - .fb_hotplug = intelfb_hotplug, -}; -/* * Build an intel_fbdev struct using a BIOS allocated framebuffer, if possible. * The core display code will have read out the current plane configuration,
@@ -579,100 +580,10 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronousintel_fbdev_hpd_set_suspend (dev_priv, state); } -static int intel_fbdev_restore_mode (struct drm_i915_private *dev_priv) -{ -struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; -struct drm_device *dev = &dev_priv->drm; -int ret; - -if (!ifbdev) -return -EINVAL ; - -if (!ifbdev->vma) -return -ENOMEM ; - - ret =drm_fb_helper_restore_fbdev_mode_unlocked (dev->fb_helper); -if (ret) -return ret; - -return 0 ; -} - -/* -* Fbdev client and struct drm_client_funcs -*/ - -static void intel_fbdev_client_unregister (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); -struct drm_device *dev = fb_helper->dev; -struct pci_dev *pdev =to_pci_dev (dev->dev); - -if (fb_helper->info) { -vga_switcheroo_client_fb_set (pdev,NULL ); -drm_fb_helper_unregister_info (fb_helper); - }else { -drm_fb_helper_unprepare (fb_helper); -drm_client_release (&fb_helper->client); -kfree (fb_helper); - } -} - -static int intel_fbdev_client_restore (struct drm_client_dev *client) -{ -struct drm_i915_private *dev_priv =to_i915 (client->dev); -int ret; - - ret =intel_fbdev_restore_mode (dev_priv); -if (ret) -return ret; - -vga_switcheroo_process_delayed_switch (); - -return 0 ; -} - -static int intel_fbdev_client_hotplug (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); -struct drm_device *dev = client->dev; -struct pci_dev *pdev =to_pci_dev (dev->dev); -int ret; - -if (dev->fb_helper) -return drm_fb_helper_hotplug_event (fb_helper); - - ret =drm_fb_helper_init (dev, fb_helper); -if (ret) - goto err_drm_err; - - ret =drm_fb_helper_initial_config (fb_helper); -if (ret) - goto err_drm_fb_helper_fini; - -vga_switcheroo_client_fb_set (pdev, fb_helper->info); - -return 0 ; - -err_drm_fb_helper_fini: -drm_fb_helper_fini (fb_helper); -err_drm_err: -drm_err (dev,"Failed to setup i915 fbdev emulation (ret=%d)\n" , ret); -return ret; -} - -static const struct drm_client_funcs intel_fbdev_client_funcs = { - .owner =THIS_MODULE , - .unregister = intel_fbdev_client_unregister, - .restore = intel_fbdev_client_restore, - .hotplug = intel_fbdev_client_hotplug, -}; -void intel_fbdev_setup (struct drm_i915_private *i915) {struct drm_device *dev = &i915->drm;struct intel_fbdev *ifbdev; -struct drm_fb_helper *fb_helper;int ret;if (!HAS_DISPLAY (i915))
@@ -684,30 +595,13 @@ void intel_fbdev_setup(struct drm_i915_private *i915) i915->display.fbdev.fbdev = ifbdev;INIT_WORK (&i915->display.fbdev.suspend_work, intel_fbdev_suspend_worker); -mutex_init (&ifbdev->hpd_lock); + ret =drmm_mutex_init (dev, &ifbdev->hpd_lock); +if (ret) +return ;if (!intel_fbdev_init_bios (dev, ifbdev)) ifbdev->preferred_bpp =32 ; - fb_helper =kzalloc (sizeof (*fb_helper),GFP_KERNEL ); -if (!fb_helper) -return ; -drm_fb_helper_prepare (dev, fb_helper, ifbdev->preferred_bpp, &intel_fb_helper_funcs); - - ret =drm_client_init (dev, &fb_helper->client,"intel-fbdev" , - &intel_fbdev_client_funcs); -if (ret) { -drm_err (dev,"Failed to register client: %d\n" , ret); - goto err_drm_fb_helper_unprepare; - } - -drm_client_register (&fb_helper->client); - -return ; - -err_drm_fb_helper_unprepare: -drm_fb_helper_unprepare (dev->fb_helper); -mutex_destroy (&ifbdev->hpd_lock); -kfree (fb_helper); +drm_client_setup_with_color_mode (dev, ifbdev->preferred_bpp); }struct intel_framebuffer *intel_fbdev_framebuffer (struct intel_fbdev *fbdev)
drivers/gpu/drm/i915/display/intel_fbdev.h +8 -0
@@ -9,15 +9,23 @@#include <linux/types.h> struct drm_device ; +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ;struct drm_i915_private ;struct intel_fbdev ;struct intel_framebuffer ;#ifdef CONFIG_DRM_FBDEV_EMULATION +int intel_fbdev_driver_fbdev_probe (struct drm_fb_helper *helper, +struct drm_fb_helper_surface_size *sizes); +#define INTEL_FBDEV_DRIVER_OPS \ + .fbdev_probe = intel_fbdev_driver_fbdev_probevoid intel_fbdev_setup (struct drm_i915_private *dev_priv);void intel_fbdev_set_suspend (struct drm_device *dev,int state,bool synchronous);struct intel_framebuffer *intel_fbdev_framebuffer (struct intel_fbdev *fbdev);#else +#define INTEL_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULLstatic inline void intel_fbdev_setup (struct drm_i915_private *dev_priv) { }
drivers/gpu/drm/i915/i915_driver.c +2 -0
@@ -1781,6 +1781,8 @@ static const struct drm_driver i915_drm_driver = { .dumb_create = i915_gem_dumb_create, .dumb_map_offset = i915_gem_dumb_mmap_offset, +INTEL_FBDEV_DRIVER_OPS , + .ioctls = i915_ioctls, .num_ioctls = ARRAY_SIZE(i915_ioctls), .fops = &i915_driver_fops,
drivers/gpu/drm/xe/xe_device.c +3 -0
@@ -17,6 +17,8 @@#include <drm/drm_print.h> #include <drm/xe_drm.h> +#include "intel_fbdev.h" +#include "display/xe_display.h" #include "instructions/xe_gpu_commands.h" #include "regs/xe_gt_regs.h"
@@ -267,6 +269,7 @@ static struct drm_driver driver = { .dumb_create = xe_bo_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset, +INTEL_FBDEV_DRIVER_OPS , #ifdef CONFIG_PROC_FS .show_fdinfo = xe_drm_client_fdinfo, #endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 57/86 drm/ofdrm: Use DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/ofdrm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/tiny/ofdrm.c +3 -6
@@ -7,6 +7,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_state_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_damage_helper.h> #include <drm/drm_device.h>
@@ -1344,6 +1345,7 @@ DEFINE_DRM_GEM_FOPS(ofdrm_fops);static struct drm_driver ofdrm_driver = {DRM_GEM_SHMEM_DRIVER_OPS , +DRM_FBDEV_SHMEM_DRIVER_OPS , .name =DRIVER_NAME , .desc =DRIVER_DESC , .date =DRIVER_DATE ,
@@ -1361,7 +1363,6 @@ static int ofdrm_probe(struct platform_device *pdev) {struct ofdrm_device *odev;struct drm_device *dev; -unsigned int color_mode;int ret; odev =ofdrm_device_create (&ofdrm_driver, pdev);
@@ -1373,11 +1374,7 @@ static int ofdrm_probe(struct platform_device *pdev)if (ret)return ret; - color_mode =drm_format_info_bpp (odev->format,0 ); -if (color_mode ==16 ) - color_mode = odev->format->depth;// can be 15 or 16 - -drm_fbdev_shmem_setup (dev, color_mode); +drm_client_setup (dev, odev->format);return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 64/86 drm/fbdev-ttm: Support struct drm_driver.fbdev_probe
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and reimplement the old fb_probe callback on top of it. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
This change allows the common fbdev client to run on top of TTM- based DRM drivers.
--- drivers/gpu/drm/drm_fbdev_ttm.c | 142 +++++++++++++++++--------------- include/drm/drm_fbdev_ttm.h | 13 +++ 2 files changed, 90 insertions(+), 65 deletions(-)
drivers/gpu/drm/drm_fbdev_ttm.c +77 -65
@@ -71,71 +71,7 @@ static const struct fb_ops drm_fbdev_ttm_fb_ops = {static int drm_fbdev_ttm_helper_fb_probe (struct drm_fb_helper *fb_helper,struct drm_fb_helper_surface_size *sizes) { -struct drm_client_dev *client = &fb_helper->client; -struct drm_device *dev = fb_helper->dev; -struct drm_client_buffer *buffer; -struct fb_info *info; -size_t screen_size; -void *screen_buffer; -u32 format; -int ret; - -drm_dbg_kms (dev,"surface width(%d), height(%d) and bpp(%d)\n" , - sizes->surface_width, sizes->surface_height, - sizes->surface_bpp); - - format =drm_driver_legacy_fb_format (dev, sizes->surface_bpp, - sizes->surface_depth); - buffer =drm_client_framebuffer_create (client, sizes->surface_width, - sizes->surface_height, format); -if (IS_ERR (buffer)) -return PTR_ERR (buffer); - - fb_helper->buffer = buffer; - fb_helper->fb = buffer->fb; - - screen_size = buffer->gem->size; - screen_buffer =vzalloc (screen_size); -if (!screen_buffer) { - ret = -ENOMEM ; - goto err_drm_client_framebuffer_delete; - } - - info =drm_fb_helper_alloc_info (fb_helper); -if (IS_ERR (info)) { - ret =PTR_ERR (info); - goto err_vfree; - } - -drm_fb_helper_fill_info (info, fb_helper, sizes); - - info->fbops = &drm_fbdev_ttm_fb_ops; - -/* screen */ - info->flags |=FBINFO_VIRTFB |FBINFO_READS_FAST ; - info->screen_buffer = screen_buffer; - info->fix.smem_len = screen_size; - -/* deferred I/O */ - fb_helper->fbdefio.delay =HZ /20 ; - fb_helper->fbdefio.deferred_io = drm_fb_helper_deferred_io; - - info->fbdefio = &fb_helper->fbdefio; - ret =fb_deferred_io_init (info); -if (ret) - goto err_drm_fb_helper_release_info; - -return 0 ; - -err_drm_fb_helper_release_info: -drm_fb_helper_release_info (fb_helper); -err_vfree: -vfree (screen_buffer); -err_drm_client_framebuffer_delete: - fb_helper->fb =NULL ; - fb_helper->buffer =NULL ; -drm_client_framebuffer_delete (buffer); -return ret; +return drm_fbdev_ttm_driver_fbdev_probe (fb_helper, sizes); } static void drm_fbdev_ttm_damage_blit_real(struct drm_fb_helper *fb_helper,
@@ -240,6 +176,82 @@ static const struct drm_fb_helper_funcs drm_fbdev_ttm_helper_funcs = { .fb_dirty = drm_fbdev_ttm_helper_fb_dirty, }; +/* +* struct drm_driver +*/ + +int drm_fbdev_ttm_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes) +{ +struct drm_client_dev *client = &fb_helper->client; +struct drm_device *dev = fb_helper->dev; +struct drm_client_buffer *buffer; +struct fb_info *info; +size_t screen_size; +void *screen_buffer; +u32 format; +int ret; + +drm_dbg_kms (dev,"surface width(%d), height(%d) and bpp(%d)\n" , + sizes->surface_width, sizes->surface_height, + sizes->surface_bpp); + + format =drm_driver_legacy_fb_format (dev, sizes->surface_bpp, + sizes->surface_depth); + buffer =drm_client_framebuffer_create (client, sizes->surface_width, + sizes->surface_height, format); +if (IS_ERR (buffer)) +return PTR_ERR (buffer); + + fb_helper->funcs = &drm_fbdev_ttm_helper_funcs; + fb_helper->buffer = buffer; + fb_helper->fb = buffer->fb; + + screen_size = buffer->gem->size; + screen_buffer =vzalloc (screen_size); +if (!screen_buffer) { + ret = -ENOMEM ; + goto err_drm_client_framebuffer_delete; + } + + info =drm_fb_helper_alloc_info (fb_helper); +if (IS_ERR (info)) { + ret =PTR_ERR (info); + goto err_vfree; + } + +drm_fb_helper_fill_info (info, fb_helper, sizes); + + info->fbops = &drm_fbdev_ttm_fb_ops; + +/* screen */ + info->flags |=FBINFO_VIRTFB |FBINFO_READS_FAST ; + info->screen_buffer = screen_buffer; + info->fix.smem_len = screen_size; + +/* deferred I/O */ + fb_helper->fbdefio.delay =HZ /20 ; + fb_helper->fbdefio.deferred_io = drm_fb_helper_deferred_io; + + info->fbdefio = &fb_helper->fbdefio; + ret =fb_deferred_io_init (info); +if (ret) + goto err_drm_fb_helper_release_info; + +return 0 ; + +err_drm_fb_helper_release_info: +drm_fb_helper_release_info (fb_helper); +err_vfree: +vfree (screen_buffer); +err_drm_client_framebuffer_delete: + fb_helper->fb =NULL ; + fb_helper->buffer =NULL ; +drm_client_framebuffer_delete (buffer); +return ret; +} +EXPORT_SYMBOL (drm_fbdev_ttm_driver_fbdev_probe); +static void drm_fbdev_ttm_client_unregister (struct drm_client_dev *client) {struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client);
include/drm/drm_fbdev_ttm.h +13 -0
@@ -3,11 +3,24 @@#ifndef DRM_FBDEV_TTM_H #define DRM_FBDEV_TTM_H +#include <linux/stddef.h> +struct drm_device ; +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ;#ifdef CONFIG_DRM_FBDEV_EMULATION +int drm_fbdev_ttm_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes); + +#define DRM_FBDEV_TTM_DRIVER_OPS \ + .fbdev_probe = drm_fbdev_ttm_driver_fbdev_probe +void drm_fbdev_ttm_setup (struct drm_device *dev,unsigned int preferred_bpp);#else +#define DRM_FBDEV_TTM_DRIVER_OPS \ + .fbdev_probe = NULL +static inline void drm_fbdev_ttm_setup (struct drm_device *dev,unsigned int preferred_bpp) { }#endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 65/86 drm/amdgpu: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The amdgpu driver specifies a preferred color mode depending on the available video memory, with a default of 32. Adapt this for the new client interface.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -2
@@ -23,6 +23,7 @@*/ #include <drm/amdgpu_drm.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_gem.h>
@@ -2343,9 +2344,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, !list_empty(&adev_to_drm(adev)->mode_config.connector_list)) {/* select 8 bpp console on low vram cards */ if (adev->gmc.real_vram_size <= (32 *1024 *1024 )) -drm_fbdev_ttm_setup (adev_to_drm (adev),8 ); +drm_client_setup (adev_to_drm (adev),drm_format_info (DRM_FORMAT_C8 ));else -drm_fbdev_ttm_setup (adev_to_drm (adev),32 ); +drm_client_setup (adev_to_drm (adev),NULL ); } ret =amdgpu_debugfs_init (adev);
@@ -2957,6 +2958,7 @@ static const struct drm_driver amdgpu_kms_driver = { .num_ioctls = ARRAY_SIZE(amdgpu_ioctls_kms), .dumb_create = amdgpu_mode_dumb_create, .dumb_map_offset = amdgpu_mode_dumb_mmap, +DRM_FBDEV_TTM_DRIVER_OPS , .fops = &amdgpu_driver_kms_fops, .release = &amdgpu_driver_release_kms, #ifdef CONFIG_PROC_FS
@@ -2983,6 +2985,7 @@ const struct drm_driver amdgpu_partition_driver = { .num_ioctls = ARRAY_SIZE(amdgpu_ioctls_kms), .dumb_create = amdgpu_mode_dumb_create, .dumb_map_offset = amdgpu_mode_dumb_mmap, +DRM_FBDEV_TTM_DRIVER_OPS , .fops = &amdgpu_driver_kms_fops, .release = &amdgpu_driver_release_kms,
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 62/86 drm/vkms: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/vkms/vkms_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_drv.c +3 -1
@@ -16,6 +16,7 @@#include <drm/drm_gem.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_shmem.h> #include <drm/drm_file.h>
@@ -112,6 +113,7 @@ static const struct drm_driver vkms_driver = { .release = vkms_release, .fops = &vkms_driver_fops,DRM_GEM_SHMEM_DRIVER_OPS , +DRM_FBDEV_SHMEM_DRIVER_OPS , .name = DRIVER_NAME, .desc = DRIVER_DESC,
@@ -225,7 +227,7 @@ static int vkms_create(struct vkms_config *config)if (ret) goto out_devres; -drm_fbdev_shmem_setup (&vkms_device->drm,0 ); +drm_client_setup (&vkms_device->drm,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 66/86 drm/bochs: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The bochs driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/tiny/bochs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tiny/bochs.c +3 -1
@@ -5,6 +5,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_edid.h> #include <drm/drm_fbdev_ttm.h>
@@ -604,6 +605,7 @@ static const struct drm_driver bochs_driver = { .major = 1, .minor = 0, DRM_GEM_VRAM_DRIVER, + DRM_FBDEV_TTM_DRIVER_OPS, };/* ---------------------------------------------------------------------- */
@@ -667,7 +669,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *entif (ret) goto err_hw_fini; -drm_fbdev_ttm_setup (dev,32 ); +drm_client_setup (dev,NULL );return ret; err_hw_fini:
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 60/86 drm/udl: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/udl/udl_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/udl/udl_drv.c +3 -1
@@ -6,6 +6,7 @@#include <linux/module.h> #include <drm/drm_drv.h> +#include <drm/drm_client_setup.h> #include <drm/drm_fbdev_shmem.h> #include <drm/drm_file.h> #include <drm/drm_gem_shmem_helper.h>
@@ -73,6 +74,7 @@ static const struct drm_driver driver = { .fops = &udl_driver_fops,DRM_GEM_SHMEM_DRIVER_OPS , .gem_prime_import = udl_driver_gem_prime_import, +DRM_FBDEV_SHMEM_DRIVER_OPS , .name = DRIVER_NAME, .desc = DRIVER_DESC,
@@ -117,7 +119,7 @@ static int udl_usb_probe(struct usb_interface *interface,DRM_INFO ("Initialized udl on minor %d\n" , udl->drm.primary->index); -drm_fbdev_shmem_setup (&udl->drm,0 ); +drm_client_setup (&udl->drm,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 79/86 drm/tegra: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The tegra driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/tegra/drm.c | 5 +- drivers/gpu/drm/tegra/drm.h | 12 +++-- drivers/gpu/drm/tegra/fbdev.c | 98 +++-------------------------------- 3 files changed, 19 insertions(+), 96 deletions(-)
drivers/gpu/drm/tegra/drm.c +4 -1
@@ -15,6 +15,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_debugfs.h> #include <drm/drm_drv.h> #include <drm/drm_fourcc.h>
@@ -891,6 +892,8 @@ static const struct drm_driver tegra_drm_driver = { .dumb_create = tegra_bo_dumb_create, +TEGRA_FBDEV_DRIVER_OPS , + .ioctls = tegra_drm_ioctls, .num_ioctls = ARRAY_SIZE(tegra_drm_ioctls), .fops = &tegra_drm_fops,
@@ -1268,7 +1271,7 @@ static int host1x_drm_probe(struct host1x_device *dev)if (err <0 ) goto hub; -tegra_fbdev_setup (drm); +drm_client_setup (drm,NULL );return 0 ;
drivers/gpu/drm/tegra/drm.h +9 -3
@@ -25,6 +25,9 @@/* XXX move to include/uapi/drm/drm_fourcc.h? */ #define DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT BIT_ULL(22) +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ; +struct edid ;struct reset_control ;
@@ -190,10 +193,13 @@ struct drm_framebuffer *tegra_fb_create(struct drm_device *drm, const struct drm_mode_fb_cmd2 *cmd);#ifdef CONFIG_DRM_FBDEV_EMULATION -void tegra_fbdev_setup (struct drm_device *drm); +int tegra_fbdev_driver_fbdev_probe (struct drm_fb_helper *helper, +struct drm_fb_helper_surface_size *sizes); +#define TEGRA_FBDEV_DRIVER_OPS \ + .fbdev_probe = tegra_fbdev_driver_fbdev_probe#else -static inline void tegra_fbdev_setup (struct drm_device *drm) -{ } +#define TEGRA_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULL#endif extern struct platform_driver tegra_display_hub_driver;
drivers/gpu/drm/tegra/fbdev.c +6 -92
113 lines not on this page · raw message
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 38/86 drm/rockchip: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +3 -1
@@ -17,6 +17,7 @@#include <linux/iommu.h> #include <drm/drm_aperture.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h>
@@ -191,7 +192,7 @@ static int rockchip_drm_bind(struct device *dev)if (ret) goto err_kms_helper_poll_fini; -drm_fbdev_dma_setup (drm_dev,0 ); +drm_client_setup (drm_dev,NULL );return 0 ; err_kms_helper_poll_fini:
@@ -226,6 +227,7 @@ static const struct drm_driver rockchip_drm_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .dumb_create = rockchip_gem_dumb_create, .gem_prime_import_sg_table = rockchip_gem_prime_import_sg_table, +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &rockchip_drm_driver_fops, .name = DRIVER_NAME, .desc = DRIVER_DESC,
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 58/86 drm/simpledrm: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tiny/simpledrm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/tiny/simpledrm.c +3 -6
@@ -12,6 +12,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_state_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_damage_helper.h>
@@ -1009,6 +1010,7 @@ DEFINE_DRM_GEM_FOPS(simpledrm_fops);static struct drm_driver simpledrm_driver = {DRM_GEM_SHMEM_DRIVER_OPS , +DRM_FBDEV_SHMEM_DRIVER_OPS , .name =DRIVER_NAME , .desc =DRIVER_DESC , .date =DRIVER_DATE ,
@@ -1026,7 +1028,6 @@ static int simpledrm_probe(struct platform_device *pdev) {struct simpledrm_device *sdev;struct drm_device *dev; -unsigned int color_mode;int ret; sdev =simpledrm_device_create (&simpledrm_driver, pdev);
@@ -1038,11 +1039,7 @@ static int simpledrm_probe(struct platform_device *pdev)if (ret)return ret; - color_mode =drm_format_info_bpp (sdev->format,0 ); -if (color_mode ==16 ) - color_mode = sdev->format->depth;// can be 15 or 16 - -drm_fbdev_shmem_setup (dev, color_mode); +drm_client_setup (dev, sdev->format);return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 63/86 drm/fbdev-shmem: Remove obsolete setup function
In reply to Thomas ZimmermannThe old setup function drm_fbdev_shmem_setup() is unused. Remove it and its internal callbacks. New drivers should call drm_client_setup() instead.
--- drivers/gpu/drm/drm_fbdev_shmem.c | 120 +----------------------------- include/drm/drm_fbdev_shmem.h | 6 -- 2 files changed, 1 insertion(+), 125 deletions(-)
drivers/gpu/drm/drm_fbdev_shmem.c +1 -119
@@ -2,15 +2,13 @@#include <linux/fb.h> -#include <drm/drm_crtc_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fbdev_shmem.h> #include <drm/drm_fb_helper.h> #include <drm/drm_framebuffer.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_shmem_helper.h> -#include <drm/drm_fbdev_shmem.h> -/* * struct fb_ops */
@@ -105,12 +103,6 @@ static struct page *drm_fbdev_shmem_get_page(struct fb_info *info, unsigned long* struct drm_fb_helper */ -static int drm_fbdev_shmem_helper_fb_probe (struct drm_fb_helper *fb_helper, -struct drm_fb_helper_surface_size *sizes) -{ -return drm_fbdev_shmem_driver_fbdev_probe (fb_helper, sizes); -} -static int drm_fbdev_shmem_helper_fb_dirty (struct drm_fb_helper *helper,struct drm_clip_rect *clip) {
@@ -131,7 +123,6 @@ static int drm_fbdev_shmem_helper_fb_dirty(struct drm_fb_helper *helper, }static const struct drm_fb_helper_funcs drm_fbdev_shmem_helper_funcs = { - .fb_probe = drm_fbdev_shmem_helper_fb_probe, .fb_dirty = drm_fbdev_shmem_helper_fb_dirty, };
@@ -218,112 +209,3 @@ int drm_fbdev_shmem_driver_fbdev_probe(struct drm_fb_helper *fb_helper,return ret; }EXPORT_SYMBOL (drm_fbdev_shmem_driver_fbdev_probe); - -/* -* struct drm_client_funcs -*/ - -static void drm_fbdev_shmem_client_unregister (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); - -if (fb_helper->info) { -drm_fb_helper_unregister_info (fb_helper); - }else { -drm_client_release (&fb_helper->client); -drm_fb_helper_unprepare (fb_helper); -kfree (fb_helper); - } -} - -static int drm_fbdev_shmem_client_restore (struct drm_client_dev *client) -{ -drm_fb_helper_lastclose (client->dev); - -return 0 ; -} - -static int drm_fbdev_shmem_client_hotplug (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); -struct drm_device *dev = client->dev; -int ret; - -if (dev->fb_helper) -return drm_fb_helper_hotplug_event (dev->fb_helper); - - ret =drm_fb_helper_init (dev, fb_helper); -if (ret) - goto err_drm_err; - -if (!drm_drv_uses_atomic_modeset (dev)) -drm_helper_disable_unused_functions (dev); - - ret =drm_fb_helper_initial_config (fb_helper); -if (ret) - goto err_drm_fb_helper_fini; - -return 0 ; - -err_drm_fb_helper_fini: -drm_fb_helper_fini (fb_helper); -err_drm_err: -drm_err (dev,"fbdev-shmem: Failed to setup emulation (ret=%d)\n" , ret); -return ret; -} - -static const struct drm_client_funcs drm_fbdev_shmem_client_funcs = { - .owner =THIS_MODULE , - .unregister = drm_fbdev_shmem_client_unregister, - .restore = drm_fbdev_shmem_client_restore, - .hotplug = drm_fbdev_shmem_client_hotplug, -}; - -/** -* drm_fbdev_shmem_setup() - Setup fbdev emulation for GEM SHMEM helpers -* @dev: DRM device -* @preferred_bpp: Preferred bits per pixel for the device. -* 32 is used if this is zero. -* -* This function sets up fbdev emulation for GEM DMA drivers that support -* dumb buffers with a virtual address and that can be mmap'ed. -* drm_fbdev_shmem_setup() shall be called after the DRM driver registered -* the new DRM device with drm_dev_register(). -* -* Restore, hotplug events and teardown are all taken care of. Drivers that do -* suspend/resume need to call drm_fb_helper_set_suspend_unlocked() themselves. -* Simple drivers might use drm_mode_config_helper_suspend(). -* -* This function is safe to call even when there are no connectors present. -* Setup will be retried on the next hotplug event. -* -* The fbdev is destroyed by drm_dev_unregister(). -*/ -void drm_fbdev_shmem_setup (struct drm_device *dev,unsigned int preferred_bpp) -{ -struct drm_fb_helper *fb_helper; -int ret; - -drm_WARN (dev, !dev->registered,"Device has not been registered.\n" ); -drm_WARN (dev, dev->fb_helper,"fb_helper is already set!\n" ); - - fb_helper =kzalloc (sizeof (*fb_helper),GFP_KERNEL ); -if (!fb_helper) -return ; -drm_fb_helper_prepare (dev, fb_helper, preferred_bpp, &drm_fbdev_shmem_helper_funcs); - - ret =drm_client_init (dev, &fb_helper->client,"fbdev" , &drm_fbdev_shmem_client_funcs); -if (ret) { -drm_err (dev,"Failed to register client: %d\n" , ret); - goto err_drm_client_init; - } - -drm_client_register (&fb_helper->client); - -return ; - -err_drm_client_init: -drm_fb_helper_unprepare (fb_helper); -kfree (fb_helper); -} -EXPORT_SYMBOL (drm_fbdev_shmem_setup);
include/drm/drm_fbdev_shmem.h +0 -6
@@ -3,7 +3,6 @@#ifndef DRM_FBDEV_SHMEM_H #define DRM_FBDEV_SHMEM_H -struct drm_device ;struct drm_fb_helper ;struct drm_fb_helper_surface_size ;
@@ -13,12 +12,7 @@ int drm_fbdev_shmem_driver_fbdev_probe(struct drm_fb_helper *fb_helper,#define DRM_FBDEV_SHMEM_DRIVER_OPS \ .fbdev_probe = drm_fbdev_shmem_driver_fbdev_probe - -void drm_fbdev_shmem_setup (struct drm_device *dev,unsigned int preferred_bpp);#else -static inline void drm_fbdev_shmem_setup (struct drm_device *dev,unsigned int preferred_bpp) -{ } -#define DRM_FBDEV_SHMEM_DRIVER_OPS \ .fbdev_probe = NULL#endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 67/86 drm/hisilicon/hibmc: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The hibmc driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +3 -1
@@ -16,6 +16,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_gem_framebuffer_helper.h>
@@ -63,6 +64,7 @@ static const struct drm_driver hibmc_driver = { .debugfs_init = drm_vram_mm_debugfs_init, .dumb_create = hibmc_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset, + DRM_FBDEV_TTM_DRIVER_OPS, };static int __maybe_unused hibmc_pm_suspend (struct device *dev)
@@ -339,7 +341,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev, goto err_unload; } -drm_fbdev_ttm_setup (dev,32 ); +drm_client_setup (dev,NULL );return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 70/86 drm/qxl: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The qxl driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/qxl/qxl_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_drv.c +3 -1
@@ -36,6 +36,7 @@#include <drm/drm.h> #include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_file.h>
@@ -118,7 +119,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto modeset_cleanup; -drm_fbdev_ttm_setup (&qdev->ddev,32 ); +drm_client_setup (&qdev->ddev,NULL );return 0 ; modeset_cleanup:
@@ -293,6 +294,7 @@ static struct drm_driver qxl_driver = { .debugfs_init = qxl_debugfs_init, #endif .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, +DRM_FBDEV_TTM_DRIVER_OPS , .fops = &qxl_fops, .ioctls = qxl_ioctls, .num_ioctls = ARRAY_SIZE(qxl_ioctls),
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 68/86 drm/loongson: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The loongson driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/loongson/lsdc_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/loongson/lsdc_drv.c +3 -1
@@ -9,6 +9,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_gem_framebuffer_helper.h>
@@ -47,6 +48,7 @@ static const struct drm_driver lsdc_drm_driver = { .dumb_create = lsdc_dumb_create, .dumb_map_offset = lsdc_dumb_map_offset, .gem_prime_import_sg_table = lsdc_prime_import_sg_table, + DRM_FBDEV_TTM_DRIVER_OPS, };static const struct drm_mode_config_funcs lsdc_mode_config_funcs = {
@@ -314,7 +316,7 @@ static int lsdc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret)return ret; -drm_fbdev_ttm_setup (ddev,32 ); +drm_client_setup (ddev,NULL );return 0 ; }
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 69/86 drm/nouveau: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The nouveau driver specifies a preferred color mode depending on the available video memory, with a default of 32. Adapt this for the new client interface.
--- drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_drm.c +5 -2
@@ -31,6 +31,7 @@#include <linux/dynamic_debug.h> #include <drm/drm_aperture.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_gem_ttm_helper.h>
@@ -873,9 +874,9 @@ static int nouveau_drm_probe(struct pci_dev *pdev, goto fail_pci;if (drm->client.device.info.ram_size <=32 *1024 *1024 ) -drm_fbdev_ttm_setup (drm->dev,8 ); +drm_client_setup (drm->dev,drm_format_info (DRM_FORMAT_C8 ));else -drm_fbdev_ttm_setup (drm->dev,32 ); +drm_client_setup (drm->dev,NULL );quirk_broken_nv_runpm (pdev);return 0 ;
@@ -1317,6 +1318,8 @@ driver_stub = { .dumb_create = nouveau_display_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset, +DRM_FBDEV_TTM_DRIVER_OPS , + .name = DRIVER_NAME, .desc = DRIVER_DESC, #ifdef GIT_REVISION
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 76/86 drm/gma500: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/gma500/fbdev.c | 100 +++---------------------------- drivers/gpu/drm/gma500/psb_drv.c | 4 +- drivers/gpu/drm/gma500/psb_drv.h | 12 +++- 3 files changed, 19 insertions(+), 97 deletions(-)
drivers/gpu/drm/gma500/fbdev.c +7 -93
@@ -143,12 +143,15 @@ static const struct fb_ops psb_fbdev_fb_ops = { .fb_destroy = psb_fbdev_fb_destroy, }; +static const struct drm_fb_helper_funcs psb_fbdev_fb_helper_funcs = { +}; +/* -* struct drm_fb_helper_funcs +* struct drm_driver */ -static int psb_fbdev_fb_probe (struct drm_fb_helper *fb_helper, -struct drm_fb_helper_surface_size *sizes) +int psb_fbdev_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes) {struct drm_device *dev = fb_helper->dev;struct drm_psb_private *dev_priv =to_drm_psb_private (dev);
@@ -206,6 +209,7 @@ static int psb_fbdev_fb_probe(struct drm_fb_helper *fb_helper, goto err_drm_gem_object_put; } + fb_helper->funcs = &psb_fbdev_fb_helper_funcs; fb_helper->fb = fb; info =drm_fb_helper_alloc_info (fb_helper);
@@ -246,93 +250,3 @@ static int psb_fbdev_fb_probe(struct drm_fb_helper *fb_helper,drm_gem_object_put (obj);return ret; } - -static const struct drm_fb_helper_funcs psb_fbdev_fb_helper_funcs = { - .fb_probe = psb_fbdev_fb_probe, -}; - -/* -* struct drm_client_funcs and setup code -*/ - -static void psb_fbdev_client_unregister (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); - -if (fb_helper->info) { -drm_fb_helper_unregister_info (fb_helper); - }else { -drm_fb_helper_unprepare (fb_helper); -drm_client_release (&fb_helper->client); -kfree (fb_helper); - } -} - -static int psb_fbdev_client_restore (struct drm_client_dev *client) -{ -drm_fb_helper_lastclose (client->dev); - -return 0 ; -} - -static int psb_fbdev_client_hotplug (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); -struct drm_device *dev = client->dev; -int ret; - -if (dev->fb_helper) -return drm_fb_helper_hotplug_event (dev->fb_helper); - - ret =drm_fb_helper_init (dev, fb_helper); -if (ret) - goto err_drm_err; - -if (!drm_drv_uses_atomic_modeset (dev)) -drm_helper_disable_unused_functions (dev); - - ret =drm_fb_helper_initial_config (fb_helper); -if (ret) - goto err_drm_fb_helper_fini; - -return 0 ; - -err_drm_fb_helper_fini: -drm_fb_helper_fini (fb_helper); -err_drm_err: -drm_err (dev,"Failed to setup gma500 fbdev emulation (ret=%d)\n" , ret); -return ret; -} - -static const struct drm_client_funcs psb_fbdev_client_funcs = { - .owner =THIS_MODULE , - .unregister = psb_fbdev_client_unregister, - .restore = psb_fbdev_client_restore, - .hotplug = psb_fbdev_client_hotplug, -}; - -void psb_fbdev_setup (struct drm_psb_private *dev_priv) -{ -struct drm_device *dev = &dev_priv->dev; -struct drm_fb_helper *fb_helper; -int ret; - - fb_helper =kzalloc (sizeof (*fb_helper),GFP_KERNEL ); -if (!fb_helper) -return ; -drm_fb_helper_prepare (dev, fb_helper,32 , &psb_fbdev_fb_helper_funcs); - - ret =drm_client_init (dev, &fb_helper->client,"fbdev-gma500" , &psb_fbdev_client_funcs); -if (ret) { -drm_err (dev,"Failed to register client: %d\n" , ret); - goto err_drm_fb_helper_unprepare; - } - -drm_client_register (&fb_helper->client); - -return ; - -err_drm_fb_helper_unprepare: -drm_fb_helper_unprepare (fb_helper); -kfree (fb_helper); -}
drivers/gpu/drm/gma500/psb_drv.c +3 -1
@@ -20,6 +20,7 @@#include <acpi/video.h> #include <drm/drm.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_file.h> #include <drm/drm_ioctl.h>
@@ -475,7 +476,7 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret)return ret; -psb_fbdev_setup (dev_priv); +drm_client_setup (dev,NULL );return 0 ; }
@@ -506,6 +507,7 @@ static const struct drm_driver driver = { .num_ioctls = ARRAY_SIZE(psb_ioctls), .dumb_create = psb_gem_dumb_create, +PSB_FBDEV_DRIVER_OPS , .ioctls = psb_ioctls, .fops = &psb_gem_fops, .name = DRIVER_NAME,
drivers/gpu/drm/gma500/psb_drv.h +9 -3
@@ -184,6 +184,9 @@#define KSEL_BYPASS_25 6#define KSEL_BYPASS_83_100 7 +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ; +struct opregion_header ;struct opregion_acpi ;struct opregion_swsci ;
@@ -597,10 +600,13 @@ struct drm_framebuffer *psb_framebuffer_create(struct drm_device *dev,/* fbdev */ #if defined(CONFIG_DRM_FBDEV_EMULATION ) -void psb_fbdev_setup (struct drm_psb_private *dev_priv); +int psb_fbdev_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes); +#define PSB_FBDEV_DRIVER_OPS \ + .fbdev_probe = psb_fbdev_driver_fbdev_probe#else -static inline void psb_fbdev_setup (struct drm_psb_private *dev_priv) -{ } +#define PSB_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULL#endif /* backlight.c */
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 84/86 drm/omapdrm: Remove struct drm_fb_helper from struct omap_fbdev.
In reply to Thomas ZimmermannStore instances of drm_fb_helper and struct omap_fbdev separately. This will allow omapdrm to use the common fbdev client, which allocates its own instance of struct drm_fb_helper.
There is at most one instance of each per DRM device, so both can be referenced directly from the omap and DRM device structures. A later patchset might rework the common fbdev client to allow for storing both, drm_fb_helper and omap_fbdev, together in the same place.
--- drivers/gpu/drm/omapdrm/omap_drv.h | 3 ++ drivers/gpu/drm/omapdrm/omap_fbdev.c | 42 +++++++++++++++------------- 2 files changed, 26 insertions(+), 19 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.h +3 -0
@@ -32,6 +32,7 @@#define MODULE_NAME "omapdrm"struct omap_drm_usergart ; +struct omap_fbdev ;struct omap_drm_pipeline {struct drm_crtc *crtc;
@@ -97,6 +98,8 @@ struct omap_drm_private {/* memory bandwidth limit if it is needed on the platform */ unsigned int max_bandwidth; + +struct omap_fbdev *fbdev; };
drivers/gpu/drm/omapdrm/omap_fbdev.c +23 -19
123 lines not on this page · raw message
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 48/86 drm/xlnx: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/xlnx/zynqmp_kms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/xlnx/zynqmp_kms.c +3 -1
@@ -14,6 +14,7 @@#include <drm/drm_blend.h> #include <drm/drm_bridge.h> #include <drm/drm_bridge_connector.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_crtc.h> #include <drm/drm_device.h>
@@ -402,6 +403,7 @@ static const struct drm_driver zynqmp_dpsub_drm_driver = {DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (zynqmp_dpsub_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &zynqmp_dpsub_drm_fops,
@@ -523,7 +525,7 @@ int zynqmp_dpsub_drm_init(struct zynqmp_dpsub *dpsub) goto err_poll_fini;/* Initialize fbdev generic emulation. */ -drm_fbdev_dma_setup (drm,24 ); +drm_client_setup (drm,drm_format_info (DRM_FORMAT_RGB888 ));return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 78/86 drm/radeon: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The radeon driver specifies a preferred color mode depending on the available video memory, with a default of 32. Adapt this for the new client interface.
--- drivers/gpu/drm/radeon/radeon_drv.c | 13 ++- drivers/gpu/drm/radeon/radeon_fbdev.c | 114 ++------------------------ drivers/gpu/drm/radeon/radeon_mode.h | 12 ++- 3 files changed, 26 insertions(+), 113 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +12 -1
@@ -38,8 +38,10 @@#include <linux/pci.h> #include <drm/drm_aperture.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_file.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem.h> #include <drm/drm_ioctl.h> #include <drm/drm_pciids.h>
@@ -260,6 +262,7 @@ static int radeon_pci_probe(struct pci_dev *pdev, {unsigned long flags =0 ;struct drm_device *dev; +struct radeon_device *rdev;int ret;if (!ent)
@@ -314,7 +317,13 @@ static int radeon_pci_probe(struct pci_dev *pdev,if (ret) goto err_agp; -radeon_fbdev_setup (dev->dev_private); + rdev = dev->dev_private; +if (rdev->mc.real_vram_size <= (8 *1024 *1024 )) +drm_client_setup (dev,drm_format_info (DRM_FORMAT_C8 )); +else if (ASIC_IS_RN50 (rdev) || rdev->mc.real_vram_size <= (32 *1024 *1024 )) +drm_client_setup (dev,drm_format_info (DRM_FORMAT_RGB565 )); +else +drm_client_setup (dev,NULL );return 0 ;
@@ -581,6 +590,8 @@ static const struct drm_driver kms_driver = { .gem_prime_import_sg_table = radeon_gem_prime_import_sg_table, +RADEON_FBDEV_DRIVER_OPS , + .name = DRIVER_NAME, .desc = DRIVER_DESC, .date = DRIVER_DATE,
drivers/gpu/drm/radeon/radeon_fbdev.c +5 -109
133 lines not on this page · raw message
drivers/gpu/drm/radeon/radeon_mode.h +9 -3
@@ -38,6 +38,9 @@#include <linux/i2c.h> #include <linux/i2c-algo-bit.h> +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ; +struct edid ;struct radeon_bo ;struct radeon_device ;
@@ -935,12 +938,15 @@ void dce8_program_fmt(struct drm_encoder *encoder);/* fbdev layer */ #if defined(CONFIG_DRM_FBDEV_EMULATION ) -void radeon_fbdev_setup (struct radeon_device *rdev); +int radeon_fbdev_driver_fbdev_probe (struct drm_fb_helper *fb_helper, +struct drm_fb_helper_surface_size *sizes); +#define RADEON_FBDEV_DRIVER_OPS \ + .fbdev_probe = radeon_fbdev_driver_fbdev_probevoid radeon_fbdev_set_suspend (struct radeon_device *rdev,int state);bool radeon_fbdev_robj_is_fb (struct radeon_device *rdev,struct radeon_bo *robj);#else -static inline void radeon_fbdev_setup (struct radeon_device *rdev) -{ } +#define RADEON_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULLstatic inline void radeon_fbdev_set_suspend (struct radeon_device *rdev,int state) { }static inline bool radeon_fbdev_robj_is_fb (struct radeon_device *rdev,struct radeon_bo *robj)
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 46/86 drm/tve200: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/tve200/tve200_drv.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/tve200/tve200_drv.c +4 -5
@@ -39,8 +39,10 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_module.h>
@@ -149,6 +151,7 @@ static const struct drm_driver tve200_drm_driver = { .minor = 0, .patchlevel = 0, DRM_GEM_DMA_DRIVER_OPS, + DRM_FBDEV_DMA_DRIVER_OPS, };static int tve200_probe (struct platform_device *pdev)
@@ -221,11 +224,7 @@ static int tve200_probe(struct platform_device *pdev)if (ret <0 ) goto clk_disable; -/* -* Passing in 16 here will make the RGB565 mode the default -* Passing in 32 will use XRGB8888 mode -*/ -drm_fbdev_dma_setup (drm,16 ); +drm_client_setup (drm,drm_format_info (DRM_FORMAT_RGB565 ));return 0 ;
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 86/86 drm/fb-helper: Remove struct drm_fb_helper.fb_probe
In reply to Thomas ZimmermannThe callback fb_probe in struct drm_fb_helper is unused. Remove it. New drivers should set struct drm_driver.fbdev_probe instead and call drm_client_setup() to instantiate in-kernel DRM clients.
--- drivers/gpu/drm/drm_fb_helper.c | 8 ++++---- include/drm/drm_fb_helper.h | 17 ----------------- 2 files changed, 4 insertions(+), 21 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +4 -4
@@ -1625,6 +1625,9 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)struct fb_info *info;int ret; +if (drm_WARN_ON (dev, !dev->driver->fbdev_probe)) +return -EINVAL ; + ret =drm_fb_helper_find_sizes (fb_helper, &sizes);if (ret) {/* First time: disable all crtc's.. */
@@ -1634,10 +1637,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper) }/* push down into drivers */ -if (dev->driver->fbdev_probe) - ret = dev->driver->fbdev_probe (fb_helper, &sizes); -else - ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); + ret = dev->driver->fbdev_probe (fb_helper, &sizes);if (ret <0 )return ret;
include/drm/drm_fb_helper.h +0 -17
@@ -69,23 +69,6 @@ struct drm_fb_helper_surface_size {* Driver callbacks used by the fbdev emulation helper library. */ struct drm_fb_helper_funcs { -/** -* @fb_probe: -* -* Driver callback to allocate and initialize the fbdev info structure. -* Furthermore it also needs to allocate the DRM framebuffer used to -* back the fbdev. -* -* This callback is mandatory. -* -* RETURNS: -* -* The driver should return 0 on success and a negative error code on -* failure. -*/ -int (*fb_probe)(struct drm_fb_helper *helper, -struct drm_fb_helper_surface_size *sizes); -/** * @fb_dirty: *
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 74/86 drm/armada: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The armada driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/armada/armada_drm.h | 11 ++- drivers/gpu/drm/armada/armada_drv.c | 4 +- drivers/gpu/drm/armada/armada_fbdev.c | 115 ++------------------------ 3 files changed, 17 insertions(+), 113 deletions(-)
drivers/gpu/drm/armada/armada_drm.h +8 -3
@@ -16,6 +16,8 @@ struct armada_crtc;struct armada_gem_object ;struct clk ;struct drm_display_mode ; +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ;static inline void armada_updatel (uint32_t val,uint32_t mask,void __iomem *ptr)
@@ -74,10 +76,13 @@ struct armada_private {#define drm_to_armada_dev (dev) container_of(dev, struct armada_private, drm)#if defined(CONFIG_DRM_FBDEV_EMULATION ) -void armada_fbdev_setup (struct drm_device *dev); +int armada_fbdev_driver_fbdev_probe (struct drm_fb_helper *fbh, +struct drm_fb_helper_surface_size *sizes); +#define ARMADA_FBDEV_DRIVER_OPS \ + .fbdev_probe = armada_fbdev_driver_fbdev_probe#else -static inline void armada_fbdev_setup (struct drm_device *dev) -{ } +#define ARMADA_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULL#endif int armada_overlay_plane_create (struct drm_device *,unsigned long );
drivers/gpu/drm/armada/armada_drv.c +3 -1
@@ -12,6 +12,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_ioctl.h> #include <drm/drm_managed.h>
@@ -39,6 +40,7 @@ DEFINE_DRM_GEM_FOPS(armada_drm_fops);static const struct drm_driver armada_drm_driver = { .gem_prime_import = armada_gem_prime_import, .dumb_create = armada_gem_dumb_create, +ARMADA_FBDEV_DRIVER_OPS , .major =1 , .minor =0 , .name ="armada-drm" ,
@@ -137,7 +139,7 @@ static int armada_drm_bind(struct device *dev)armada_drm_debugfs_init (priv->drm.primary);#endif -armada_fbdev_setup (&priv->drm); +drm_client_setup (&priv->drm,NULL );return 0 ;
drivers/gpu/drm/armada/armada_fbdev.c +6 -109
133 lines not on this page · raw message
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 75/86 drm/exynos-drm: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The exynos-drm driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 101 ++-------------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 15 ++-- 3 files changed, 19 insertions(+), 101 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +3 -1
@@ -15,6 +15,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_file.h> #include <drm/drm_fourcc.h>
@@ -111,6 +112,7 @@ static const struct drm_driver exynos_drm_driver = { .dumb_create = exynos_drm_gem_dumb_create, .gem_prime_import = exynos_drm_gem_prime_import, .gem_prime_import_sg_table = exynos_drm_gem_prime_import_sg_table, +EXYNOS_DRM_FBDEV_DRIVER_OPS , .ioctls = exynos_ioctls, .num_ioctls = ARRAY_SIZE(exynos_ioctls), .fops = &exynos_drm_driver_fops,
@@ -288,7 +290,7 @@ static int exynos_drm_bind(struct device *dev)if (ret <0 ) goto err_cleanup_poll; -exynos_drm_fbdev_setup (drm); +drm_client_setup (drm,NULL );return 0 ;
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +6 -95
122 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_fbdev.h +10 -5
@@ -11,12 +11,17 @@#ifndef _EXYNOS_DRM_FBDEV_H_#define _EXYNOS_DRM_FBDEV_H_ -#ifdef CONFIG_DRM_FBDEV_EMULATION -void exynos_drm_fbdev_setup (struct drm_device *dev); +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ; + +#if defined(CONFIG_DRM_FBDEV_EMULATION ) +int exynos_drm_fbdev_driver_fbdev_probe (struct drm_fb_helper *fbh, +struct drm_fb_helper_surface_size *sizes); +#define EXYNOS_DRM_FBDEV_DRIVER_OPS \ + .fbdev_probe = exynos_drm_fbdev_driver_fbdev_probe#else -static inline void exynos_drm_fbdev_setup (struct drm_device *dev) -{ -} +#define EXYNOS_DRM_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULL#endif #endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 71/86 drm/vboxvideo: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The vboxvideo driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/vboxvideo/vbox_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/vboxvideo/vbox_drv.c +3 -1
@@ -13,6 +13,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_file.h>
@@ -80,7 +81,7 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto err_irq_fini; -drm_fbdev_ttm_setup (&vbox->ddev,32 ); +drm_client_setup (&vbox->ddev,NULL );return 0 ;
@@ -193,6 +194,7 @@ static const struct drm_driver driver = { .patchlevel = DRIVER_PATCHLEVEL,DRM_GEM_VRAM_DRIVER , +DRM_FBDEV_TTM_DRIVER_OPS , };drm_module_pci_driver_if_modeset (vbox_pci_driver, vbox_modeset);
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 72/86 drm/vmwgfx: Run DRM default client setup
In reply to Thomas ZimmermannCall drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +4 -1
@@ -36,6 +36,7 @@#include "ttm_object.h" #include <drm/drm_aperture.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_gem_ttm_helper.h>
@@ -1628,6 +1629,8 @@ static const struct drm_driver driver = { .prime_handle_to_fd = vmw_prime_handle_to_fd, .gem_prime_import_sg_table = vmw_prime_import_sg_table, +DRM_FBDEV_TTM_DRIVER_OPS , + .fops = &vmwgfx_driver_fops, .name = VMWGFX_DRIVER_NAME, .desc = VMWGFX_DRIVER_DESC,
@@ -1679,7 +1682,7 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)vmw_fifo_resource_inc (vmw);vmw_svga_enable (vmw); -drm_fbdev_ttm_setup (&vmw->drm,0 ); +drm_client_setup (&vmw->drm,NULL );vmw_debugfs_gem_init (vmw);vmw_debugfs_resource_managers_init (vmw);
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 73/86 drm/fbdev-ttm: Remove obsolete setup function
In reply to Thomas ZimmermannThe old setup function drm_fbdev_ttm_setup() is unused. Remove it and its internal callbacks. New drivers should call drm_client_setup() instead.
--- drivers/gpu/drm/drm_fbdev_ttm.c | 119 -------------------------------- include/drm/drm_fbdev_ttm.h | 6 -- 2 files changed, 125 deletions(-)
drivers/gpu/drm/drm_fbdev_ttm.c +0 -119
@@ -65,15 +65,6 @@ static const struct fb_ops drm_fbdev_ttm_fb_ops = { .fb_destroy = drm_fbdev_ttm_fb_destroy, }; -/* -* This function uses the client API to create a framebuffer backed by a dumb buffer. -*/ -static int drm_fbdev_ttm_helper_fb_probe (struct drm_fb_helper *fb_helper, -struct drm_fb_helper_surface_size *sizes) -{ -return drm_fbdev_ttm_driver_fbdev_probe (fb_helper, sizes); -} -static void drm_fbdev_ttm_damage_blit_real (struct drm_fb_helper *fb_helper,struct drm_clip_rect *clip,struct iosys_map *dst)
@@ -172,7 +163,6 @@ static int drm_fbdev_ttm_helper_fb_dirty(struct drm_fb_helper *helper, }static const struct drm_fb_helper_funcs drm_fbdev_ttm_helper_funcs = { - .fb_probe = drm_fbdev_ttm_helper_fb_probe, .fb_dirty = drm_fbdev_ttm_helper_fb_dirty, };
@@ -251,112 +241,3 @@ int drm_fbdev_ttm_driver_fbdev_probe(struct drm_fb_helper *fb_helper,return ret; }EXPORT_SYMBOL (drm_fbdev_ttm_driver_fbdev_probe); - -static void drm_fbdev_ttm_client_unregister (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); - -if (fb_helper->info) { -drm_fb_helper_unregister_info (fb_helper); - }else { -drm_client_release (&fb_helper->client); -drm_fb_helper_unprepare (fb_helper); -kfree (fb_helper); - } -} - -static int drm_fbdev_ttm_client_restore (struct drm_client_dev *client) -{ -drm_fb_helper_lastclose (client->dev); - -return 0 ; -} - -static int drm_fbdev_ttm_client_hotplug (struct drm_client_dev *client) -{ -struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); -struct drm_device *dev = client->dev; -int ret; - -if (dev->fb_helper) -return drm_fb_helper_hotplug_event (dev->fb_helper); - - ret =drm_fb_helper_init (dev, fb_helper); -if (ret) - goto err_drm_err; - -if (!drm_drv_uses_atomic_modeset (dev)) -drm_helper_disable_unused_functions (dev); - - ret =drm_fb_helper_initial_config (fb_helper); -if (ret) - goto err_drm_fb_helper_fini; - -return 0 ; - -err_drm_fb_helper_fini: -drm_fb_helper_fini (fb_helper); -err_drm_err: -drm_err (dev,"fbdev: Failed to setup emulation (ret=%d)\n" , ret); -return ret; -} - -static const struct drm_client_funcs drm_fbdev_ttm_client_funcs = { - .owner =THIS_MODULE , - .unregister = drm_fbdev_ttm_client_unregister, - .restore = drm_fbdev_ttm_client_restore, - .hotplug = drm_fbdev_ttm_client_hotplug, -}; - -/** -* drm_fbdev_ttm_setup() - Setup fbdev emulation for TTM-based drivers -* @dev: DRM device -* @preferred_bpp: Preferred bits per pixel for the device. -* -* This function sets up fbdev emulation for TTM-based drivers that support -* dumb buffers with a virtual address and that can be mmap'ed. -* drm_fbdev_ttm_setup() shall be called after the DRM driver registered -* the new DRM device with drm_dev_register(). -* -* Restore, hotplug events and teardown are all taken care of. Drivers that do -* suspend/resume need to call drm_fb_helper_set_suspend_unlocked() themselves. -* Simple drivers might use drm_mode_config_helper_suspend(). -* -* In order to provide fixed mmap-able memory ranges, fbdev emulation -* uses a shadow buffer in system memory. The implementation blits the shadow -* fbdev buffer onto the real buffer in regular intervals. -* -* This function is safe to call even when there are no connectors present. -* Setup will be retried on the next hotplug event. -* -* The fbdev is destroyed by drm_dev_unregister(). -*/ -void drm_fbdev_ttm_setup (struct drm_device *dev,unsigned int preferred_bpp) -{ -struct drm_fb_helper *fb_helper; -int ret; - -drm_WARN (dev, !dev->registered,"Device has not been registered.\n" ); -drm_WARN (dev, dev->fb_helper,"fb_helper is already set!\n" ); - - fb_helper =kzalloc (sizeof (*fb_helper),GFP_KERNEL ); -if (!fb_helper) -return ; -drm_fb_helper_prepare (dev, fb_helper, preferred_bpp, &drm_fbdev_ttm_helper_funcs); - - ret =drm_client_init (dev, &fb_helper->client,"fbdev" , &drm_fbdev_ttm_client_funcs); -if (ret) { -drm_err (dev,"Failed to register client: %d\n" , ret); - goto err_drm_client_init; - } - -drm_client_register (&fb_helper->client); - -return ; - -err_drm_client_init: -drm_fb_helper_unprepare (fb_helper); -kfree (fb_helper); -return ; -} -EXPORT_SYMBOL (drm_fbdev_ttm_setup);
include/drm/drm_fbdev_ttm.h +0 -6
@@ -5,7 +5,6 @@#include <linux/stddef.h> -struct drm_device ;struct drm_fb_helper ;struct drm_fb_helper_surface_size ;
@@ -15,14 +14,9 @@ int drm_fbdev_ttm_driver_fbdev_probe(struct drm_fb_helper *fb_helper,#define DRM_FBDEV_TTM_DRIVER_OPS \ .fbdev_probe = drm_fbdev_ttm_driver_fbdev_probe - -void drm_fbdev_ttm_setup (struct drm_device *dev,unsigned int preferred_bpp);#else #define DRM_FBDEV_TTM_DRIVER_OPS \ .fbdev_probe = NULL - -static inline void drm_fbdev_ttm_setup (struct drm_device *dev,unsigned int preferred_bpp) -{ }#endif #endif
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 77/86 drm/msm: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The msm driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/msm/msm_drv.c | 4 +- drivers/gpu/drm/msm/msm_drv.h | 13 ++- drivers/gpu/drm/msm/msm_fbdev.c | 144 ++++++-------------------------- 3 files changed, 38 insertions(+), 123 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +3 -1
@@ -10,6 +10,7 @@#include <linux/of_address.h> #include <linux/uaccess.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_file.h> #include <drm/drm_ioctl.h>
@@ -292,7 +293,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)if (priv->kms_init) {drm_kms_helper_poll_init (ddev); -msm_fbdev_setup (ddev); +drm_client_setup (ddev,NULL ); }return 0 ;
@@ -903,6 +904,7 @@ static const struct drm_driver msm_driver = {#ifdef CONFIG_DEBUG_FS .debugfs_init = msm_debugfs_init,#endif + MSM_FBDEV_DRIVER_OPS, .show_fdinfo = msm_show_fdinfo, .ioctls = msm_ioctls, .num_ioctls = ARRAY_SIZE(msm_ioctls),
drivers/gpu/drm/msm/msm_drv.h +9 -4
@@ -40,6 +40,9 @@ extern struct fault_attr fail_gem_iova;# define should_fail (attr, size) 0#endif +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ; +struct msm_kms ;struct msm_gpu ;struct msm_mmu ;
@@ -298,11 +301,13 @@ struct drm_framebuffer * msm_alloc_stolen_fb(struct drm_device *dev, int w, int h, int p, uint32_t format);#ifdef CONFIG_DRM_FBDEV_EMULATION -void msm_fbdev_setup (struct drm_device *dev); +int msm_fbdev_driver_fbdev_probe (struct drm_fb_helper *helper, +struct drm_fb_helper_surface_size *sizes); +#define MSM_FBDEV_DRIVER_OPS \ + .fbdev_probe = msm_fbdev_driver_fbdev_probe#else -static inline void msm_fbdev_setup (struct drm_device *dev) -{ -} +#define MSM_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULL#endif struct hdmi ;
drivers/gpu/drm/msm/msm_fbdev.c +26 -118
159 lines not on this page · raw message
Signature · 1 line
2.46.0
Thomas Zimmermann
maintainerPATCH 85/86 drm/omapdrm: Run DRM default client setup
In reply to Thomas ZimmermannRework fbdev probing to support fbdev_probe in struct drm_driver and remove the old fb_probe callback. Provide an initializer macro for struct drm_driver that sets the callback according to the kernel configuration.
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client.
The omapdrm driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 131 ++++++--------------------- drivers/gpu/drm/omapdrm/omap_fbdev.h | 8 ++ 3 files changed, 38 insertions(+), 102 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +1 -0
@@ -647,6 +647,7 @@ static const struct drm_driver omap_drm_driver = { .gem_prime_import = omap_gem_prime_import, .dumb_create = omap_gem_dumb_create, .dumb_map_offset = omap_gem_dumb_map_offset, +OMAP_FBDEV_DRIVER_OPS , .ioctls = ioctls, .num_ioctls = DRM_OMAP_NUM_IOCTLS, .fops = &omapdriver_fops,
drivers/gpu/drm/omapdrm/omap_fbdev.c +29 -102
163 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_fbdev.h +8 -0
@@ -10,10 +10,18 @@#define __OMAPDRM_FBDEV_H__struct drm_device ; +struct drm_fb_helper ; +struct drm_fb_helper_surface_size ;#ifdef CONFIG_DRM_FBDEV_EMULATION +int omap_fbdev_driver_fbdev_probe (struct drm_fb_helper *helper, +struct drm_fb_helper_surface_size *sizes); +#define OMAP_FBDEV_DRIVER_OPS \ + .fbdev_probe = omap_fbdev_driver_fbdev_probevoid omap_fbdev_setup (struct drm_device *dev);#else +#define OMAP_FBDEV_DRIVER_OPS \ + .fbdev_probe = NULLstatic inline void omap_fbdev_setup (struct drm_device *dev) { }
Signature · 1 line
2.46.0
Patchwork
CI✓ CI.Patch_applied: success for drm: Provide client setup helper and convert drivers
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: drm: Provide client setup helper and convert drivers
URL : https://patchwork.freedesktop.org/series/137387/
State : success
== Summary ==
=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: 70d6d55dea57 drm-tip: 2024y-08m-16d-08h-43m-44s UTC integration manifest === git am output follows ===
Applying: drm/fbdev-helper: Move color-mode lookup into 4CC format helper
Applying: drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info
Applying: drm/fbdev: Add memory-agnostic fbdev client
Applying: drm: Add client-agnostic setup helper
Applying: drm/fbdev-dma: Support struct drm_driver.fbdev_probe
Applying: drm/arcgpu: Run DRM default client setup
Applying: drm/arm/komeda: Run DRM default client setup
Applying: drm/arm/hdlcd: Run DRM default client setup
Applying: drm/arm/malidp: Run DRM default client setup
Applying: drm/aspeed: Run DRM default client setup
Applying: drm/atmel-hdlcd: Run DRM default client setup
Applying: drm/fsl-dcu: Run DRM default client setup
Applying: drm/hisilicon/kirin: Run DRM default client setup
Applying: drm/hx8357d: Run DRM default client setup
Applying: drm/ili9163: Run DRM default client setup
Applying: drm/ili9225: Run DRM default client setup
Applying: drm/ili9341: Run DRM default client setup
Applying: drm/ili9486: Run DRM default client setup
Applying: drm/imx/dcss: Run DRM default client setup
Applying: drm/imx/ipuv3: Run DRM default client setup
Applying: drm/imx/lcdc: Run DRM default client setup
Applying: drm/ingenic: Run DRM default client setup
Applying: drm/kmb: Run DRM default client setup
Applying: drm/logicvc: Run DRM default client setup
Applying: drm/mcde: Run DRM default client setup
Applying: drm/mediatek: Run DRM default client setup
Applying: drm/meson: Run DRM default client setup
Applying: drm/mi0283qt: Run DRM default client setup
Applying: drm/mxsfb/lcdif: Run DRM default client setup
Applying: drm/msxfb: Run DRM default client setup
Applying: drm/panel/ili9341: Run DRM default client setup
Applying: drm/panel-mipi-dbi: Run DRM default client setup
Applying: drm/pl111: Run DRM default client setup
Applying: drm/renesas/rcar-du: Run DRM default client setup
Applying: drm/renesas/rz-du: Run DRM default client setup
Applying: drm/renesas/shmobile: Run DRM default client setup
Applying: drm/repaper: Run DRM default client setup
Applying: drm/rockchip: Run DRM default client setup
Applying: drm/sti: Run DRM default client setup
Applying: drm/stm: Run DRM default client setup
Applying: drm/sun4i: Run DRM default client setup
Applying: drm/tidss: Run DRM default client setup
Applying: drm/tilcdc: Run DRM default client setup
Applying: drm/st7586: Run DRM default client setup
Applying: drm/st7735r: Run DRM default client setup
Applying: drm/tve200: Run DRM default client setup
Applying: drm/vc4: Run DRM default client setup
Applying: drm/xlnx: Run DRM default client setup
Applying: drm/fbdev-dma: Remove obsolete setup function
Applying: drm/fbdev-shmem: Support struct drm_driver.fbdev_probe
Applying: drm/ast: Run DRM default client setup
Applying: drm/cirrus: Run DRM default client setup
Applying: drm/gm12u320: Run DRM default client setup
Applying: drm/gud: Run DRM default client setup
Applying: drm/hyperv_drm: Run DRM default client setup
Applying: drm/mgag200: Run DRM default client setup
Applying: drm/ofdrm: Use DRM default client setup
Applying: drm/simpledrm: Run DRM default client setup
Applying: drm/solomon: Run DRM default client setup
Applying: drm/udl: Run DRM default client setup
Applying: drm/virtgpu: Run DRM default client setup
Applying: drm/vkms: Run DRM default client setup
Applying: drm/fbdev-shmem: Remove obsolete setup function
Applying: drm/fbdev-ttm: Support struct drm_driver.fbdev_probe
Applying: drm/amdgpu: Run DRM default client setup
Applying: drm/bochs: Run DRM default client setup
Applying: drm/hisilicon/hibmc: Run DRM default client setup
Applying: drm/loongson: Run DRM default client setup
Applying: drm/nouveau: Run DRM default client setup
Applying: drm/qxl: Run DRM default client setup
Applying: drm/vboxvideo: Run DRM default client setup
Applying: drm/vmwgfx: Run DRM default client setup
Applying: drm/fbdev-ttm: Remove obsolete setup function
Applying: drm/armada: Run DRM default client setup
Applying: drm/exynos-drm: Run DRM default client setup
Applying: drm/gma500: Run DRM default client setup
Applying: drm/msm: Run DRM default client setup
Applying: drm/radeon: Run DRM default client setup
Applying: drm/tegra: Run DRM default client setup
Applying: drm/i915: Remove struct drm_fb_helper from struct intel_fbdev
Applying: drm/i915: Move custom restore code into separate callback
Applying: drm/i915: Move custom hotplug code into separate callback
Applying: drm/{i915,xe}: Run DRM default client setup
Applying: drm/omapdrm: Remove struct drm_fb_helper from struct omap_fbdev.
Applying: drm/omapdrm: Run DRM default client setup
Applying: drm/fb-helper: Remove struct drm_fb_helper.fb_probe
Patchwork
CI✗ CI.checkpatch: warning for drm: Provide client setup helper and convert drivers
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: drm: Provide client setup helper and convert drivers
URL : https://patchwork.freedesktop.org/series/137387/
State : warning
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master 9fe5037901cabbcdf27a6fe0dfb047ca1474d363
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit bc2e6acf0b21b2c317d386cd0d7dea4bdc43e304
Author: Thomas Zimmermann <[email protected]> Date: Fri Aug 16 14:23:52 2024 +0200
drm/fb-helper: Remove struct drm_fb_helper.fb_probe
The callback fb_probe in struct drm_fb_helper is unused. Remove it. New drivers should set struct drm_driver.fbdev_probe instead and call drm_client_setup() to instantiate in-kernel DRM clients.
+ /mt/dim checkpatch 70d6d55dea574b7b78ccf714699cc5d8d62fcc2c drm-intel dbbe77e43aae drm/fbdev-helper: Move color-mode lookup into 4CC format helper ffb255019bb2 drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info 7087b5d41bf6 drm/fbdev: Add memory-agnostic fbdev client
-:91: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #91:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 236 lines checked771e6926ae8c drm: Add client-agnostic setup helper
-:33: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #33:
new file mode 100644
-:88: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u32' over 'uint32_t' #88: FILE: drivers/gpu/drm/drm_client_setup.c:51:
+ uint32_t fmt = drm_driver_color_mode_format(dev, color_mode);
total: 0 errors, 1 warnings, 1 checks, 74 lines checked583e54980030 drm/fbdev-dma: Support struct drm_driver.fbdev_probe7fd3f3c41621 drm/arcgpu: Run DRM default client setupc02dde30b20e drm/arm/komeda: Run DRM default client setupa43996abc768 drm/arm/hdlcd: Run DRM default client setupaefeb24af9b6 drm/arm/malidp: Run DRM default client setup8f2ba9ac84fe drm/aspeed: Run DRM default client setupc0bd38753793 drm/atmel-hdlcd: Run DRM default client setup6e389ec3af77 drm/fsl-dcu: Run DRM default client setup17903ccf1bc5 drm/hisilicon/kirin: Run DRM default client setup5ea18cea7053 drm/hx8357d: Run DRM default client setup63f681ffa23b drm/ili9163: Run DRM default client setup7899f4a28eb1 drm/ili9225: Run DRM default client setup6eb5df084d1a drm/ili9341: Run DRM default client setup4b9aa1c5f028 drm/ili9486: Run DRM default client setup11d52d5c8394 drm/imx/dcss: Run DRM default client setup2fcfa2c18df4 drm/imx/ipuv3: Run DRM default client setup7a45a413b7ad drm/imx/lcdc: Run DRM default client setupec058833e2e3 drm/ingenic: Run DRM default client setupe5caa29ce062 drm/kmb: Run DRM default client setupb12f7ed8b393 drm/logicvc: Run DRM default client setup24f9d3affacc drm/mcde: Run DRM default client setup5244eab58bc9 drm/mediatek: Run DRM default client setupd78200a66bd2 drm/meson: Run DRM default client setupab56a5ea72ab drm/mi0283qt: Run DRM default client setup9e7871057e48 drm/mxsfb/lcdif: Run DRM default client setup934fa3c8188e drm/msxfb: Run DRM default client setupdaced4593542 drm/panel/ili9341: Run DRM default client setupbd50c122d8a0 drm/panel-mipi-dbi: Run DRM default client setup5933f72d063c drm/pl111: Run DRM default client setupa337b73ec24f drm/renesas/rcar-du: Run DRM default client setup22dbe6e2ebf6 drm/renesas/rz-du: Run DRM default client setupacd2b0a52626 drm/renesas/shmobile: Run DRM default client setup6f43b9a3913c drm/repaper: Run DRM default client setup1076fdfef342 drm/rockchip: Run DRM default client setup3683afa0790a drm/sti: Run DRM default client setup54fab82ed61f drm/stm: Run DRM default client setup43cdf7378776 drm/sun4i: Run DRM default client setup66374919ebe0 drm/tidss: Run DRM default client setup021fa1b61d72 drm/tilcdc: Run DRM default client setupf713bd8a3b2a drm/st7586: Run DRM default client setupee24930b3cb8 drm/st7735r: Run DRM default client setupce58cfe659ee drm/tve200: Run DRM default client setup468714d0ea71 drm/vc4: Run DRM default client setupc8effee76eff drm/xlnx: Run DRM default client setup391c0e8a99db drm/fbdev-dma: Remove obsolete setup function8442e8acabe5 drm/fbdev-shmem: Support struct drm_driver.fbdev_probe96b62c445df9 drm/ast: Run DRM default client setupdf903cdd8223 drm/cirrus: Run DRM default client setup
-:14: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please.
-:17: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please.
total: 0 errors, 2 warnings, 0 checks, 22 lines checked95fb9e3b25df drm/gm12u320: Run DRM default client setup9b3a4f251bbf drm/gud: Run DRM default client setup1a068a584971 drm/hyperv_drm: Run DRM default client setup351e33650c94 drm/mgag200: Run DRM default client setup
-:11: WARNING:BAD_SIGN_OFF: Unexpected content after email: 'Dave Airlie <[email protected]>i', should be: 'Dave Airlie <[email protected]> (i)' #11:
Cc: Dave Airlie <[email protected]>i
total: 0 errors, 1 warnings, 0 checks, 26 lines checked e95cd30e0d7d drm/ofdrm: Use DRM default client setup47e6aa7c3f91 drm/simpledrm: Run DRM default client setup 056cf3290b0f drm/solomon: Run DRM default client setup 6c7a736467ca drm/udl: Run DRM default client setup658ef1942b6f drm/virtgpu: Run DRM default client setup 58e7053be64b drm/vkms: Run DRM default client setup32baba39fab1 drm/fbdev-shmem: Remove obsolete setup function 8b09ac708491 drm/fbdev-ttm: Support struct drm_driver.fbdev_probe 1ed15f91d832 drm/amdgpu: Run DRM default client setup c8ff49a15c36 drm/bochs: Run DRM default client setup9510ebcf0f2b drm/hisilicon/hibmc: Run DRM default client setup 1ffc796b420e drm/loongson: Run DRM default client setup 4e1a08dc41d0 drm/nouveau: Run DRM default client setup fd55ab97914a drm/qxl: Run DRM default client setup1e2fc1ad8dc3 drm/vboxvideo: Run DRM default client setup 1d132a14ac42 drm/vmwgfx: Run DRM default client setup 0dae2236b45e drm/fbdev-ttm: Remove obsolete setup function d7c84f493c4a drm/armada: Run DRM default client setup 5e4b1403c0be drm/exynos-drm: Run DRM default client setup d3b4c45a25c4 drm/gma500: Run DRM default client setup 4cacef18386d drm/msm: Run DRM default client setupfe7063f9bd0b drm/radeon: Run DRM default client setup 3af6ff5c95e1 drm/tegra: Run DRM default client setupa6a36c949951 drm/i915: Remove struct drm_fb_helper from struct intel_fbdev 56a17e40ea0e drm/i915: Move custom restore code into separate callback 6613c0d1379d drm/i915: Move custom hotplug code into separate callback 7f6e9f3ee45a drm/{i915,xe}: Run DRM default client setup 1ed62e940865 drm/omapdrm: Remove struct drm_fb_helper from struct omap_fbdev. eb772971d08c drm/omapdrm: Run DRM default client setup bc2e6acf0b21 drm/fb-helper: Remove struct drm_fb_helper.fb_probe
Patchwork
CI✗ CI.KUnit: failure for drm: Provide client setup helper and convert drivers
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: drm: Provide client setup helper and convert drivers
URL : https://patchwork.freedesktop.org/series/137387/
State : failure
== Summary ==
+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig ERROR:root:../drivers/gpu/drm/xe/xe_device.c:20:10: fatal error: intel_fbdev.h: No such file or directory 20 | #include "intel_fbdev.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
make[7]: *** [../scripts/Makefile.build:244: drivers/gpu/drm/xe/xe_device.o] Error 1 make[7]: *** Waiting for unfinished jobs....
make[6]: *** [../scripts/Makefile.build:485: drivers/gpu/drm/xe] Error 2 make[6]: *** Waiting for unfinished jobs....../lib/iomap.c:156:5: warning: no previous prototype for ‘ioread64_lo_hi’ [-Wmissing-prototypes]
156 | u64 ioread64_lo_hi(const void __iomem *addr)
| ^~~~~~~~~~~~~~
../lib/iomap.c:163:5: warning: no previous prototype for ‘ioread64_hi_lo’ [-Wmissing-prototypes]
163 | u64 ioread64_hi_lo(const void __iomem *addr)
| ^~~~~~~~~~~~~~
../lib/iomap.c:170:5: warning: no previous prototype for ‘ioread64be_lo_hi’ [-Wmissing-prototypes]
170 | u64 ioread64be_lo_hi(const void __iomem *addr)
| ^~~~~~~~~~~~~~~~
../lib/iomap.c:178:5: warning: no previous prototype for ‘ioread64be_hi_lo’ [-Wmissing-prototypes]
178 | u64 ioread64be_hi_lo(const void __iomem *addr)
| ^~~~~~~~~~~~~~~~
../lib/iomap.c:264:6: warning: no previous prototype for ‘iowrite64_lo_hi’ [-Wmissing-prototypes]
264 | void iowrite64_lo_hi(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~
../lib/iomap.c:272:6: warning: no previous prototype for ‘iowrite64_hi_lo’ [-Wmissing-prototypes]
272 | void iowrite64_hi_lo(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~
../lib/iomap.c:280:6: warning: no previous prototype for ‘iowrite64be_lo_hi’ [-Wmissing-prototypes]
280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~~~
../lib/iomap.c:288:6: warning: no previous prototype for ‘iowrite64be_hi_lo’ [-Wmissing-prototypes]
288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~~~make[5]: *** [../scripts/Makefile.build:485: drivers/gpu/drm] Error 2 make[4]: *** [../scripts/Makefile.build:485: drivers/gpu] Error 2 make[3]: *** [../scripts/Makefile.build:485: drivers] Error 2 make[2]: *** [/kernel/Makefile:1925: .] Error 2
make[1]: *** [/kernel/Makefile:224: __sub-make] Error 2
make: *** [Makefile:224: __sub-make] Error 2
[13:04:03] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [13:04:07] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make ARCH=um O=.kunit --jobs=48 + cleanup ++ stat -c %u:%g /kernel + chown -R 1003:1003 /kernel
Jani Nikula
maintainerRe: [PATCH 83/86] drm/{i915,xe}: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 14 lines · Thomas Zimmermann
drivers/gpu/drm/xe/xe_device.c +2
-0@@ -17,6 +17,8 @@#include <drm/drm_print.h> #include <drm/xe_drm.h> +#include "intel_fbdev.h" +#include "display/xe_display.h" #include "instructions/xe_gpu_commands.h" #include "regs/xe_gt_regs.h"
drivers/gpu/drm/xe/xe_device.c static struct drm_driver driver = { · line 275
Quoted 7 lines
drivers/gpu/drm/xe/xe_device.c +1
-0@@ -267,6 +269,7 @@ static struct drm_driver driver = { .dumb_create = xe_bo_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset, +INTEL_FBDEV_DRIVER_OPS , #ifdef CONFIG_PROC_FS .show_fdinfo = xe_drm_client_fdinfo, #endif
Basically xe_device.c should have close to zero idea about display details, and should not include intel_fbdev.h directly.
There's a xe_display_driver_set_hooks() call that is the right place to set the driver->fbdev_probe hook.
It's a bit of a bummer in the sense that this prevents struct drm_driver from being const, but that's how it already is for xe.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel
Thomas Zimmermann
maintainerRe: [PATCH 83/86] drm/{i915,xe}: Run DRM default client setup
Hi
Am 16.08.24 um 15:18 schrieb Jani Nikula:
Quoted 25 lines · Thomas Zimmermann
Quoted 14 lines
drivers/gpu/drm/xe/xe_device.c +2
-0@@ -17,6 +17,8 @@#include <drm/drm_print.h> #include <drm/xe_drm.h> +#include "intel_fbdev.h" +#include "display/xe_display.h" #include "instructions/xe_gpu_commands.h" #include "regs/xe_gt_regs.h" drivers/gpu/drm/xe/xe_device.c static struct drm_driver driver = { · line 275
Quoted 7 lines
drivers/gpu/drm/xe/xe_device.c +1
-0@@ -267,6 +269,7 @@ static struct drm_driver driver = { .dumb_create = xe_bo_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset, +INTEL_FBDEV_DRIVER_OPS , #ifdef CONFIG_PROC_FS .show_fdinfo = xe_drm_client_fdinfo, #endifBasically
xe_device.cshould have close to zero idea about display details, and should not includeintel_fbdev.hdirectly.
Quoted 5 lines
There's a
xe_display_driver_set_hooks()call that is the right place to set thedriver->fbdev_probehook.It's a bit of a bummer in the sense that this prevents struct
drm_driverfrom being const, but that's how it already is for xe.
Thanks, I'll look into this. The was another automatic reply about a compile error in xe wrt this callback. I guess that set_hooks helper would fix that as well.
Best regards
Thomas
Quoted 6 lines
BR,
Jani.
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Re: [PATCH 38/86] drm/rockchip: Run DRM default client setup
In reply to Thomas ZimmermannAm Freitag, 16. August 2024, 14:23:04 CEST schrieb Thomas Zimmermann:
Quoted 8 lines
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>
I've looked up the whole patchseries and while I can't say overly much about the core changes, at least for the Rockchip driver, things look like they'll stay the same even after those changes are applied, so
Quoted 34 lines
--- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_drv.c +3
-1@@ -17,6 +17,7 @@#include <linux/iommu.h> #include <drm/drm_aperture.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h> @@ -191,7 +192,7 @@ static int rockchip_drm_bind(struct device *dev)if (ret) goto err_kms_helper_poll_fini; -drm_fbdev_dma_setup (drm_dev,0 ); +drm_client_setup (drm_dev,NULL );return 0 ; err_kms_helper_poll_fini:@@ -226,6 +227,7 @@ static const struct drm_driver rockchip_drm_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .dumb_create = rockchip_gem_dumb_create, .gem_prime_import_sg_table = rockchip_gem_prime_import_sg_table, +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &rockchip_drm_driver_fops, .name = DRIVER_NAME, .desc = DRIVER_DESC,
Re: [PATCH 69/86] drm/nouveau: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 9 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The nouveau driver specifies a preferred color mode depending on the available video memory, with a default of 32. Adapt this for the new client interface.
Signed-off-by Thomas Zimmermann <[email protected]>
Quoted 40 lines
Cc Karol Herbst <[email protected]>Cc Lyude Paul <[email protected]>Cc Danilo Krummrich <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/nouveau/nouveau_drm.c +5
-2@@ -31,6 +31,7 @@#include <linux/dynamic_debug.h> #include <drm/drm_aperture.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_ttm.h> #include <drm/drm_gem_ttm_helper.h> @@ -873,9 +874,9 @@ static int nouveau_drm_probe(struct pci_dev *pdev, goto fail_pci;if (drm->client.device.info.ram_size <=32 *1024 *1024 ) -drm_fbdev_ttm_setup (drm->dev,8 ); +drm_client_setup (drm->dev,drm_format_info (DRM_FORMAT_C8 ));else -drm_fbdev_ttm_setup (drm->dev,32 ); +drm_client_setup (drm->dev,NULL );quirk_broken_nv_runpm (pdev);return 0 ;@@ -1317,6 +1318,8 @@ driver_stub = { .dumb_create = nouveau_display_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset, +DRM_FBDEV_TTM_DRIVER_OPS , + .name = DRIVER_NAME, .desc = DRIVER_DESC, #ifdef GIT_REVISION
Re: [PATCH 07/86] drm/arm/komeda: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 9 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The komeda driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Liviu Dudau <[email protected]>
Quoted 50 lines
--- drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++-- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/arm/display/komeda/komeda_drv.c +2
-2@@ -9,7 +9,7 @@#include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> -#include <drm/drm_fbdev_dma.h> +#include <drm/drm_client_setup.h> #include <drm/drm_module.h> #include <drm/drm_of.h> #include "komeda_dev.h" @@ -84,7 +84,7 @@ static int komeda_platform_probe(struct platform_device *pdev) }dev_set_drvdata (dev, mdrv); -drm_fbdev_dma_setup (&mdrv->kms->base,32 ); +drm_client_setup (&mdrv->kms->base,NULL );return 0 ;drivers/gpu/drm/arm/display/komeda/komeda_kms.c +2
-0@@ -9,6 +9,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_managed.h> @@ -58,6 +59,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)static const struct drm_driver komeda_kms_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (komeda_gem_dma_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &komeda_cma_fops, .name ="komeda" , .desc ="Arm Komeda Display Processor driver" ,Signature · 1 line
2.46.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Re: [PATCH 08/86] drm/arm/hdlcd: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 9 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The hdlcd driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Liviu Dudau <[email protected]>
Quoted 36 lines
--- drivers/gpu/drm/arm/hdlcd_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/arm/hdlcd_drv.c +3
-1@@ -23,6 +23,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_crtc.h> #include <drm/drm_debugfs.h> #include <drm/drm_drv.h> @@ -228,6 +229,7 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);static const struct drm_driver hdlcd_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &fops, .name ="hdlcd" , .desc ="ARM HDLCD Controller DRM" ,@@ -299,7 +301,7 @@ static int hdlcd_drm_bind(struct device *dev)if (ret) goto err_register; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;Signature · 1 line
2.46.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Re: [PATCH 09/86] drm/arm/malidp: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 9 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The malidp driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Liviu Dudau <[email protected]>
Best regards,
Liviu
Quoted 36 lines
--- drivers/gpu/drm/arm/malidp_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/arm/malidp_drv.c +3
-1@@ -18,6 +18,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_crtc.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> @@ -562,6 +563,7 @@ static void malidp_debugfs_init(struct drm_minor *minor)static const struct drm_driver malidp_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (malidp_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , #ifdef CONFIG_DEBUG_FS .debugfs_init = malidp_debugfs_init, #endif@@ -852,7 +854,7 @@ static int malidp_bind(struct device *dev)if (ret) goto register_fail; -drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );return 0 ;Signature · 1 line
2.46.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm: Provide client setup helper and convert drivers
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: drm: Provide client setup helper and convert drivers
URL : https://patchwork.freedesktop.org/series/137389/
State : warning
== Summary ==
Error: dim checkpatch failed4856d817532d drm/fbdev-helper: Move color-mode lookup into 4CC format helper 7e7d23b5bd07 drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info d7f10ed4fdd8 drm/fbdev: Add memory-agnostic fbdev client
-:91: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #91:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 236 lines checked2356f33d6aec drm: Add client-agnostic setup helper
-:33: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #33:
new file mode 100644
-:88: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u32' over 'uint32_t' #88: FILE: drivers/gpu/drm/drm_client_setup.c:51:
+ uint32_t fmt = drm_driver_color_mode_format(dev, color_mode);
total: 0 errors, 1 warnings, 1 checks, 74 lines checked3a32bb0a05af drm/fbdev-dma: Support struct drm_driver.fbdev_probe8afd6e1eb174 drm/arcgpu: Run DRM default client setup00a8bfd477cb drm/arm/komeda: Run DRM default client setup52ef3a72f78a drm/arm/hdlcd: Run DRM default client setup105b911b70ad drm/arm/malidp: Run DRM default client setupdc097452ae3f drm/aspeed: Run DRM default client setup1770ec7f10d8 drm/atmel-hdlcd: Run DRM default client setupf377a3e1b4b4 drm/fsl-dcu: Run DRM default client setupf9dcd06114bb drm/hisilicon/kirin: Run DRM default client setup5442f74f45d4 drm/hx8357d: Run DRM default client setup547aae7a6fe0 drm/ili9163: Run DRM default client setupc0aa3bb45781 drm/ili9225: Run DRM default client setupf55558eb4015 drm/ili9341: Run DRM default client setupd34f9f1df93c drm/ili9486: Run DRM default client setup8f3711766ff9 drm/imx/dcss: Run DRM default client setup63fc5f517795 drm/imx/ipuv3: Run DRM default client setup47b7c80c0c36 drm/imx/lcdc: Run DRM default client setup9afeef37153e drm/ingenic: Run DRM default client setup93600646dafc drm/kmb: Run DRM default client setup36e9443d85a1 drm/logicvc: Run DRM default client setup8921a5ffd81b drm/mcde: Run DRM default client setup095ac92874bf drm/mediatek: Run DRM default client setup2c7c52591c3a drm/meson: Run DRM default client setup584fc4e588f4 drm/mi0283qt: Run DRM default client setup75b24a9c6c72 drm/mxsfb/lcdif: Run DRM default client setupc1a93dfb7939 drm/msxfb: Run DRM default client setup79166905ec16 drm/panel/ili9341: Run DRM default client setup1ed3fb64146d drm/panel-mipi-dbi: Run DRM default client setupd689a5123a56 drm/pl111: Run DRM default client setupef0788fa6c2f drm/renesas/rcar-du: Run DRM default client setup7eb9ab5c0793 drm/renesas/rz-du: Run DRM default client setupfba14adb503e drm/renesas/shmobile: Run DRM default client setupad57b88fdd73 drm/repaper: Run DRM default client setup2576d2818bd2 drm/rockchip: Run DRM default client setupbb0c24dd1c7f drm/sti: Run DRM default client setup5ed428b15a27 drm/stm: Run DRM default client setupfcbd6170a394 drm/sun4i: Run DRM default client setup99e58bfd7820 drm/tidss: Run DRM default client setup87055fe59c32 drm/tilcdc: Run DRM default client setup6e1da125fbae drm/st7586: Run DRM default client setuped9f48c37278 drm/st7735r: Run DRM default client setupdece69809b98 drm/tve200: Run DRM default client setup1f9242fd12af drm/vc4: Run DRM default client setup052493581b22 drm/xlnx: Run DRM default client setup0309671c67a7 drm/fbdev-dma: Remove obsolete setup functionc10bb6b74d14 drm/fbdev-shmem: Support struct drm_driver.fbdev_probe12e042023fdb drm/ast: Run DRM default client setup46066be89257 drm/cirrus: Run DRM default client setup
-:14: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please.
-:17: WARNING:OBSOLETE: drivers/gpu/drm/tiny/cirrus.c is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please.
total: 0 errors, 2 warnings, 0 checks, 22 lines checked
018170088437 drm/gm12u320: Run DRM default client setup4629300d0be5 drm/gud: Run DRM default client setupe91054168a3c drm/hyperv_drm: Run DRM default client setup24e5ceea78ad drm/mgag200: Run DRM default client setup
-:11: WARNING:BAD_SIGN_OFF: Unexpected content after email: 'Dave Airlie <[email protected]>i', should be: 'Dave Airlie <[email protected]> (i)' #11:
Cc: Dave Airlie <[email protected]>i
total: 0 errors, 1 warnings, 0 checks, 26 lines checked 87415426460a drm/ofdrm: Use DRM default client setup1001bfce5bd2 drm/simpledrm: Run DRM default client setup 469e945ff3cc drm/solomon: Run DRM default client setup 62ba02871d37 drm/udl: Run DRM default client setup87adca83eb61 drm/virtgpu: Run DRM default client setup f376210008b7 drm/vkms: Run DRM default client setup21287a856e7e drm/fbdev-shmem: Remove obsolete setup function 3687f7bfa6ec drm/fbdev-ttm: Support struct drm_driver.fbdev_probe e364533fbeaa drm/amdgpu: Run DRM default client setup a9283347043b drm/bochs: Run DRM default client setupdbe7d4063d17 drm/hisilicon/hibmc: Run DRM default client setup bf36e85a510b drm/loongson: Run DRM default client setup 9bc39514e1c2 drm/nouveau: Run DRM default client setup 9aa78adee4fa drm/qxl: Run DRM default client setupac519f6dc1ef drm/vboxvideo: Run DRM default client setup 61fa033192ac drm/vmwgfx: Run DRM default client setup 12eeba1179b0 drm/fbdev-ttm: Remove obsolete setup function cd196b5e0006 drm/armada: Run DRM default client setup dcd60c0e01a7 drm/exynos-drm: Run DRM default client setup 00200b44aa6d drm/gma500: Run DRM default client setup 41111cd085d6 drm/msm: Run DRM default client setupcadf336cb460 drm/radeon: Run DRM default client setup 28a03dedd296 drm/tegra: Run DRM default client setup9fe83eabfb41 drm/i915: Remove struct drm_fb_helper from struct intel_fbdev 446f33eaf6e8 drm/i915: Move custom restore code into separate callback f744530fc056 drm/i915: Move custom hotplug code into separate callback 067493dc3942 drm/{i915,xe}: Run DRM default client setup 30236ccdb5f5 drm/omapdrm: Remove struct drm_fb_helper from struct omap_fbdev. 2cbd3e8f9d94 drm/omapdrm: Run DRM default client setup c4d9dfa1b6f1 drm/fb-helper: Remove struct drm_fb_helper.fb_probe
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm: Provide client setup helper and convert drivers
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: drm: Provide client setup helper and convert drivers
URL : https://patchwork.freedesktop.org/series/137389/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI✗ Fi.CI.BAT: failure for drm: Provide client setup helper and convert drivers
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: drm: Provide client setup helper and convert drivers
URL : https://patchwork.freedesktop.org/series/137389/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_15247 -> Patchwork_137389v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_137389v1 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_137389v1, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/index.html
Participating hosts (42 -> 42)
------------------------------
Additional (1): fi-kbl-8809g
Missing (1): fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_137389v1:
### IGT changes ###
#### Possible regressions ####
* igt@i915_module_load@load:
- bat-arlh-2: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-arlh-2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-arlh-2/igt@[email protected]
- fi-kbl-8809g: NOTRUN -> [ABORT][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-kbl-8809g/igt@[email protected]
- bat-kbl-2: [PASS][4] -> [ABORT][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-kbl-2/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-kbl-2/igt@[email protected]
- bat-adlm-1: [PASS][6] -> [ABORT][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-adlm-1/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-adlm-1/igt@[email protected]
- bat-mtlp-6: [PASS][8] -> [ABORT][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-mtlp-6/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-mtlp-6/igt@[email protected]
- bat-dg2-9: [PASS][10] -> [ABORT][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-dg2-9/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-dg2-9/igt@[email protected]
- fi-kbl-x1275: [PASS][12] -> [ABORT][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-kbl-x1275/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-kbl-x1275/igt@[email protected]
- bat-adlp-11: [PASS][14] -> [ABORT][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-adlp-11/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-adlp-11/igt@[email protected]
- fi-kbl-guc: [PASS][16] -> [ABORT][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-kbl-guc/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-kbl-guc/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- bat-dg2-14: [PASS][18] -> [ABORT][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-dg2-14/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-dg2-14/igt@[email protected]
- bat-arls-5: [PASS][20] -> [ABORT][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-arls-5/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-arls-5/igt@[email protected]
- bat-adlp-6: [PASS][22] -> [ABORT][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-adlp-6/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-adlp-6/igt@[email protected]
- fi-rkl-11600: [PASS][24] -> [ABORT][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-rkl-11600/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-rkl-11600/igt@[email protected]
- bat-dg1-7: [PASS][26] -> [ABORT][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-dg1-7/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-dg1-7/igt@[email protected]
- bat-rpls-4: [PASS][28] -> [ABORT][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-rpls-4/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-rpls-4/igt@[email protected]
- fi-cfl-8109u: [PASS][30] -> [ABORT][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-cfl-8109u/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-cfl-8109u/igt@[email protected]
- fi-kbl-7567u: [PASS][32] -> [ABORT][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-kbl-7567u/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-kbl-7567u/igt@[email protected]
- bat-mtlp-8: [PASS][34] -> [ABORT][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-mtlp-8/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-mtlp-8/igt@[email protected]
- bat-adls-6: [PASS][36] -> [ABORT][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-adls-6/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-adls-6/igt@[email protected]
- bat-jsl-1: [PASS][38] -> [ABORT][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-jsl-1/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-jsl-1/igt@[email protected]
- bat-arls-1: [PASS][40] -> [ABORT][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-arls-1/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-arls-1/igt@[email protected]
- fi-cfl-guc: [PASS][42] -> [ABORT][43]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-cfl-guc/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-cfl-guc/igt@[email protected]
- bat-adlp-9: [PASS][44] -> [ABORT][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-adlp-9/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-adlp-9/igt@[email protected]
- bat-twl-2: [PASS][46] -> [ABORT][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-twl-2/igt@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-twl-2/igt@[email protected]
- fi-cfl-8700k: [PASS][48] -> [ABORT][49]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-cfl-8700k/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-cfl-8700k/igt@[email protected]
* igt@i915_selftest@live@coherency:
- fi-blb-e6850: [PASS][50] -> [ABORT][51]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-blb-e6850/igt@i915_selftest@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-blb-e6850/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@gem_contexts:
- fi-glk-j4005: [PASS][52] -> [ABORT][53]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-glk-j4005/igt@i915_selftest@live@gem_contexts.html
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-glk-j4005/igt@i915_selftest@live@gem_contexts.html
* igt@i915_selftest@live@gt_engines:
- fi-tgl-1115g4: [PASS][54] -> [ABORT][55]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-tgl-1115g4/igt@i915_selftest@live@gt_engines.html
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-tgl-1115g4/igt@i915_selftest@live@gt_engines.html
- bat-arls-2: [PASS][56] -> [ABORT][57]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-arls-2/igt@i915_selftest@live@gt_engines.html
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-arls-2/igt@i915_selftest@live@gt_engines.html
* igt@i915_selftest@live@gt_mocs:
- fi-elk-e7500: [PASS][58] -> [ABORT][59]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-elk-e7500/igt@i915_selftest@live@gt_mocs.html
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-elk-e7500/igt@i915_selftest@live@gt_mocs.html
* igt@i915_selftest@live@sanitycheck:
- bat-twl-1: [PASS][60] -> [ABORT][61]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-twl-1/igt@i915_selftest@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-twl-1/igt@i915_selftest@[email protected]
- bat-rplp-1: [PASS][62] -> [ABORT][63]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-rplp-1/igt@i915_selftest@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-rplp-1/igt@i915_selftest@[email protected]
- fi-ivb-3770: [PASS][64] -> [ABORT][65]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-ivb-3770/igt@i915_selftest@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-ivb-3770/igt@i915_selftest@[email protected]
- bat-dg2-8: [PASS][66] -> [ABORT][67]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-dg2-8/igt@i915_selftest@[email protected]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-dg2-8/igt@i915_selftest@[email protected]
- fi-ilk-650: [PASS][68] -> [ABORT][69]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-ilk-650/igt@i915_selftest@[email protected]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-ilk-650/igt@i915_selftest@[email protected]
- fi-pnv-d510: [PASS][70] -> [ABORT][71]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/fi-pnv-d510/igt@i915_selftest@[email protected]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/fi-pnv-d510/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@uncore:
- bat-dg2-11: [PASS][72] -> [ABORT][73]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-dg2-11/igt@i915_selftest@[email protected]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-dg2-11/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@workarounds:
- bat-apl-1: [PASS][74] -> [ABORT][75]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15247/bat-apl-1/igt@i915_selftest@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/bat-apl-1/igt@i915_selftest@[email protected]
Known issues
------------
Here are the changes found in Patchwork_137389v1 that come from known issues:
### IGT changes ###
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#11674]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11674
Build changes
-------------
* Linux: CI_DRM_15247 -> Patchwork_137389v1
CI-20190529: 20190529
CI_DRM_15247: cfdb0d68f7d07eecfafb5fda99e6dc313359d425 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7973: 9c3a20d0403a2fe80bde618de5c2ef83b7e08d50 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_137389v1: cfdb0d68f7d07eecfafb5fda99e6dc313359d425 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137389v1/index.html
Re: [PATCH 55/86] drm/hyperv_drm: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 43 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Deepak Rawat <[email protected]>--- drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/hyperv/hyperv_drm_drv.c +3
-2@@ -10,6 +10,7 @@#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_shmem.h> #include <drm/drm_gem_shmem_helper.h> @@ -36,6 +37,7 @@ static struct drm_driver hyperv_driver = { .fops = &hv_fops,DRM_GEM_SHMEM_DRIVER_OPS , + DRM_FBDEV_SHMEM_DRIVER_OPS, }; static int hyperv_pci_probe(struct pci_dev *pdev,@@ -149,7 +151,7 @@ static int hyperv_vmbus_probe(struct hv_device *hdev, goto err_free_mmio; } -drm_fbdev_shmem_setup (dev,0 ); +drm_client_setup (dev,NULL );return 0 ; --2.46.0
Re: [PATCH 28/86] drm/mi0283qt: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 14 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc "Noralf Trønnes" <[email protected]>--- drivers/gpu/drm/tiny/mi0283qt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/tiny/mi0283qt.c +0
-0
<snip>
drivers/gpu/drm/tiny/mi0283qt.c static int mi0283qt_probe(struct spi_device *spi) · line 231
Quoted 6 lines
drivers/gpu/drm/tiny/mi0283qt.c +1
-1@@ -226,7 +228,7 @@ static int mi0283qt_probe(struct spi_device *spi)spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );
Would it be possible for drm_dev_register() to handle the client setup so drivers won't have to? struct drm_driver could have a field for drivers that want a different color format.
Noralf.
Quoted 3 lines
drivers/gpu/drm/tiny/mi0283qt.c +0
-0return 0 ; }
kernel test robot
build botRe: [PATCH 83/86] drm/{i915,xe}: Run DRM default client setup
In reply to Thomas Zimmermannkernel test robot noticed the following build errors:
Hi Thomas,
kernel test robot noticed the following build errors:
[auto build test ERROR on 70d6d55dea574b7b78ccf714699cc5d8d62fcc2c]
url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/drm-fbdev-helper-Move-color-mode-lookup-into-4CC-format-helper/20240816-210651 base: 70d6d55dea574b7b78ccf714699cc5d8d62fcc2c patch link: https://lore.kernel.org/r/20240816125408.310253-84-tzimmermann%40suse.de patch subject: [PATCH 83/86] drm/{i915,xe}: Run DRM default client setup config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20240817/[email protected]/config) compiler: or1k-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240817/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/xe/xe_device.c:20:10: fatal error: intel_fbdev.h: No such file or directory
20 | #include "intel_fbdev.h"
| ^~~~~~~~~~~~~~~compilation terminated.
vim +20 drivers/gpu/drm/xe/xe_device.c
19
> 20 #include "intel_fbdev.h"
21 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH 83/86] drm/{i915,xe}: Run DRM default client setup
In reply to Thomas Zimmermannkernel test robot noticed the following build errors:
Hi Thomas,
kernel test robot noticed the following build errors:
[auto build test ERROR on 70d6d55dea574b7b78ccf714699cc5d8d62fcc2c]
url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/drm-fbdev-helper-Move-color-mode-lookup-into-4CC-format-helper/20240816-210651 base: 70d6d55dea574b7b78ccf714699cc5d8d62fcc2c patch link: https://lore.kernel.org/r/20240816125408.310253-84-tzimmermann%40suse.de patch subject: [PATCH 83/86] drm/{i915,xe}: Run DRM default client setup config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20240817/[email protected]/config) compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 26670e7fa4f032a019d23d56c6a02926e854e8af) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240817/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from drivers/gpu/drm/xe/xe_device.c:6:
In file included from drivers/gpu/drm/xe/xe_device.h:9:
In file included from include/drm/drm_util.h:35:
In file included from include/linux/interrupt.h:22:
In file included from arch/riscv/include/asm/sections.h:9:
In file included from include/linux/mm.h:2228:
include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
500 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
501 | item];
| ~~~~
include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
507 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
508 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
519 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
520 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
528 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
529 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_device.c:20:10: fatal error: 'intel_fbdev.h' file not found
20 | #include "intel_fbdev.h"
| ^~~~~~~~~~~~~~~5 warnings and 1 error generated.
vim +20 drivers/gpu/drm/xe/xe_device.c
19
> 20 #include "intel_fbdev.h"
21 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH 22/86] drm/ingenic: Run DRM default client setup
In reply to Thomas ZimmermannHi Thomas,
Le vendredi 16 août 2024 à 14:22 +0200, Thomas Zimmermann a écrit :
Quoted 9 lines
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The ingenic driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Paul Cercueil <[email protected]>
Cheers,
-Paul
Quoted 37 lines
---
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ingenic/ingenic-drm-drv.c +2
-0@@ -24,6 +24,7 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> #include <drm/drm_bridge_connector.h> +#include <drm/drm_client_setup.h> #include <drm/drm_color_mgmt.h> #include <drm/drm_crtc.h> #include <drm/drm_damage_helper.h>@@ -960,6 +961,7 @@ static const struct drm_driver ingenic_drm_driver_data = { .fops = &ingenic_drm_fops, .gem_create_object = ingenic_drm_gem_create_object, DRM_GEM_DMA_DRIVER_OPS, + DRM_FBDEV_DMA_DRIVER_OPS, };
static const structdrm_plane_funcsingenic_drm_primary_plane_funcs= {drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0
-0@@ -1399,7 +1401,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) goto err_clk_notifier_unregister; }drivers/gpu/drm/ingenic/ingenic-drm-drv.c +1
-1-drm_fbdev_dma_setup (drm,32 ); +drm_client_setup (drm,NULL );
return 0;
Re: [PATCH 46/86] drm/tve200: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 6 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Linus Walleij <[email protected]>
This way of passing a mode is definitely an improvement.
Yours,
Linus Walleij
Re: [PATCH 25/86] drm/mcde: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 9 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The mcde driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Linus Walleij <[email protected]>
Yours,
Linus Walleij
Re: [PATCH 01/86] drm/fbdev-helper: Move color-mode lookup into 4CC format helper
In reply to Thomas ZimmermannHi Thomas,
Thank you for the patch.
Quoted 3 lines · Thomas Zimmermann
The color mode specified on the kernel command line gives the user's preferred color depth and number of bits per pixel. Move the color-mode-to-format conversion form fbdev helpers into a 4CC helper,
s/form/from/
Quoted 3 lines
so that is can be shared among DRM clients.
Signed-off-by Thomas Zimmermann <[email protected]>
Quoted 178 lines
--- drivers/gpu/drm/drm_fb_helper.c | 70 +++++++-------------------------- drivers/gpu/drm/drm_fourcc.c | 30 +++++++++++++- include/drm/drm_fourcc.h | 1 + 3 files changed, 45 insertions(+), 56 deletions(-)drivers/gpu/drm/drm_fb_helper.c +15
-55@@ -1441,67 +1441,27 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,EXPORT_SYMBOL (drm_fb_helper_pan_display);static uint32_t drm_fb_helper_find_format (struct drm_fb_helper *fb_helper,const uint32_t *formats, -size_t format_count,uint32_t bpp,uint32_t depth) +size_t format_count,unsigned int color_mode) {struct drm_device *dev = fb_helper->dev;uint32_t format;size_t i; -/* -* Do not consider YUV or other complicated formats -* for framebuffers. This means only legacy formats -* are supported (fmt->depth is a legacy field), but -* the framebuffer emulation can only deal with such -* formats, specifically RGB/BGA formats. -*/ - format =drm_mode_legacy_fb_format (bpp, depth); -if (!format) - goto err; + format =drm_driver_color_mode_format (dev, color_mode); +if (!format) { +drm_info (dev,"unsupported color mode of %d\n" , color_mode); +return DRM_FORMAT_INVALID ; + }for (i =0 ; i < format_count; ++i) {if (formats[i] == format)return format; } - -err: -/* We found nothing. */ -drm_warn (dev,"bpp/depth value of %u/%u not supported\n" , bpp, depth); +drm_warn (dev,"format %p4cc not supported\n" , &format);return DRM_FORMAT_INVALID ; } -static uint32_t drm_fb_helper_find_color_mode_format (struct drm_fb_helper *fb_helper, -const uint32_t *formats,size_t format_count, -unsigned int color_mode) -{ -struct drm_device *dev = fb_helper->dev; -uint32_t bpp, depth; - -switch (color_mode) { -case 1 : -case 2 : -case 4 : -case 8 : -case 16 : -case 24 : - bpp = depth = color_mode; -break ; -case 15 : - bpp =16 ; - depth =15 ; -break ; -case 32 : - bpp =32 ; - depth =24 ; -break ; -default : -drm_info (dev,"unsupported color mode of %d\n" , color_mode); -return DRM_FORMAT_INVALID ; - } - -return drm_fb_helper_find_format (fb_helper, formats, format_count, bpp, depth); -} -static int __drm_fb_helper_find_sizes (struct drm_fb_helper *fb_helper,struct drm_fb_helper_surface_size *sizes) {@@ -1531,10 +1491,10 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper,if (!cmdline_mode->bpp_specified)continue ; - surface_format =drm_fb_helper_find_color_mode_format (fb_helper, - plane->format_types, - plane->format_count, - cmdline_mode->bpp); + surface_format =drm_fb_helper_find_format (fb_helper, + plane->format_types, + plane->format_count, + cmdline_mode->bpp);if (surface_format !=DRM_FORMAT_INVALID )break ;/* found supported format */ }@@ -1544,10 +1504,10 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper,break ;/* found supported format */ /* try preferred color mode */ - surface_format =drm_fb_helper_find_color_mode_format (fb_helper, - plane->format_types, - plane->format_count, - fb_helper->preferred_bpp); + surface_format =drm_fb_helper_find_format (fb_helper, + plane->format_types, + plane->format_count, + fb_helper->preferred_bpp);if (surface_format !=DRM_FORMAT_INVALID )break ;/* found supported format */ }drivers/gpu/drm/drm_fourcc.c +29
-1@@ -36,7 +36,6 @@* @depth: bit depth per pixel * * Computes a drm fourcc pixel format code for the given @bpp/@depth values. -* Useful in fbdev emulation code, since that deals in those values. */ uint32_t drm_mode_legacy_fb_format (uint32_t bpp,uint32_t depth) {@@ -140,6 +139,35 @@ uint32_t drm_driver_legacy_fb_format(struct drm_device *dev, }EXPORT_SYMBOL (drm_driver_legacy_fb_format); +/** +* drm_driver_color_mode_format - Compute DRM 4CC code from color mode +* @dev: DRM device +* @color_mode: command-line color mode +* +* Computes a DRM 4CC pixel format code for the given color mode using +* drm_driver_color_mode(). The color mode is in the format used and the +* kernel command line. It specifies the number of bits per pixel +* and color depth in a single value. +* +* Useful in fbdev emulation code, since that deals in those values. The +* helper does not consider YUV or other complicated formats. This means +* only legacy formats are supported (fmt->depth is a legacy field), but +* the framebuffer emulation can only deal with such formats, specifically +* RGB/BGA formats. +*/ +uint32_t drm_driver_color_mode_format (struct drm_device *dev,unsigned int color_mode) +{ +switch (color_mode) { +case 15 : +return drm_driver_legacy_fb_format (dev,16 ,15 ); +case 32 : +return drm_driver_legacy_fb_format (dev,32 ,24 ); +default : +return drm_driver_legacy_fb_format (dev, color_mode, color_mode); + } +} +EXPORT_SYMBOL (drm_driver_color_mode_format); +/* * Internal function to query information for a given format. See * drm_format_info() for the public API. include/drm/drm_fourcc.h +1
-0@@ -313,6 +313,7 @@ drm_get_format_info(struct drm_device *dev,uint32_t drm_mode_legacy_fb_format (uint32_t bpp,uint32_t depth);uint32_t drm_driver_legacy_fb_format (struct drm_device *dev,uint32_t bpp,uint32_t depth); +uint32_t drm_driver_color_mode_format (struct drm_device *dev,unsigned int color_mode);unsigned int drm_format_info_block_width (const struct drm_format_info *info,int plane); unsigned int drm_format_info_block_height(const struct drm_format_info *info,Signature · 1 line
2.46.0
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 04/86] drm: Add client-agnostic setup helper
In reply to Thomas ZimmermannHi Thomas,
Thank you for the patch.
Quoted 8 lines · Thomas Zimmermann
DRM may support multiple in-kernel clients that run as soon as a DRM driver has been registered. To select the client(s) in a single place, introduce
drm_client_setup().Drivers that call the new helper automatically instantiate the kernel's configured default clients. Only fbdev emulation is currently supported. Later versions can add support for DRM-based logging, a boot logo or even a console.
I really like the direction this is taking :-)
Quoted 32 lines
Some drivers handle the color mode for clients internally. Provide the helper
drm_client_setup_with_color_mode()for them.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_client_setup.c | 55 ++++++++++++++++++++++++++++++ include/drm/drm_client_setup.h | 12 +++++++ 3 files changed, 68 insertions(+) create mode 100644 drivers/gpu/drm/drm_client_setup.c create mode 100644 include/drm/drm_client_setup.hdrivers/gpu/drm/Makefile +1
-0@@ -129,6 +129,7 @@ drm_kms_helper-y := \ drm_atomic_helper.o \ drm_atomic_state_helper.o \ drm_bridge_connector.o \ + drm_client_setup.o \ drm_crtc_helper.o \ drm_damage_helper.o \ drm_encoder_slave.o \drivers/gpu/drm/drm_client_setup.c new file +2
-0@@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +
drivers/gpu/drm/drm_client_setup.c line 12
Quoted 10 lines
drivers/gpu/drm/drm_client_setup.c new file +10
-0+#include <drm/drm_client_setup.h> +#include <drm/drm_device.h> +#include <drm/drm_fbdev_client.h> +#include <drm/drm_fourcc.h> +#include <drm/drm_print.h> + +/** +* drm_client_setup() - Setup in-kernel DRM clients +* @dev: DRM device +* @format: Preferred color format for the device. Use NULL, unless
s/color format/pixel format/
Quoted 49 lines
drivers/gpu/drm/drm_client_setup.c new file +43
-0+* there is clearly a driver-preferred format. +* +* This function sets up the in-kernel DRM clients. Restore, hotplug +* events and teardown are all taken care of. +* +* Drivers should call drm_client_setup() after registering the new +* DRM device with drm_dev_register(). This function is safe to call +* even when there are no connectors present. Setup will be retried +* on the next hotplug event. +* +* The clients are destroyed by drm_dev_unregister(). +*/ +void drm_client_setup (struct drm_device *dev,const struct drm_format_info *format) +{ +int ret; + +if (!format) + format =drm_format_info (DRM_FORMAT_XRGB8888 ); + + ret =drm_fbdev_client_setup (dev, format); +if (ret) +drm_warn (dev,"Failed to set up DRM client; error %d\n" , ret); +} +EXPORT_SYMBOL (drm_client_setup); + +/** +* drm_client_setup_with_color_mode() - Setup in-kernel DRM clients for color mode +* @dev: DRM device +* @color_mode: Preferred color mode for the device +* +* This function sets up the in-kernel DRM clients. It is equivalent +* to drm_client_setup(), but expects a color mode as second argument. +* +* Do not use this function in new drivers. Prefer drm_client_setup() with a +* format of NULL. +*/ +void drm_client_setup_with_color_mode (struct drm_device *dev,unsigned int color_mode) +{ +uint32_t fmt =drm_driver_color_mode_format (dev, color_mode); + +drm_client_setup (dev,drm_format_info (fmt)); +} +EXPORT_SYMBOL (drm_client_setup_with_color_mode);include/drm/drm_client_setup.h new file +0
-0
include/drm/drm_client_setup.h line 10
Quoted 10 lines
include/drm/drm_client_setup.h new file +10
-0@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef DRM_CLIENT_SETUP_H +#define DRM_CLIENT_SETUP_H + +struct drm_device ; +struct drm_format_info ; + +void drm_client_setup (struct drm_device *dev,const struct drm_format_info *format); +void drm_client_setup_with_color_mode (struct drm_device *dev,unsigned int color_mode);
This is not common in DRM, so we may not want to introduce it here, but _Generic() gives a nice function overloading syntax:
void drm_client_setup_with_format(struct drm_device *dev, const struct drm_format_info *format); void drm_client_setup_with_color_mode(struct drm_device *dev, unsigned int color_mode);
#define drm_client_setup_(dev, format_or_color_mode) \ _Generic(format_or_color_mode, \ const struct drm_format_info *: drm_client_setup_with_format(dev, format_or_color_mode), \ unsigned int: drm_client_setup_with_color_mode(dev, format_or_color_mode) \ )
Up to you.
Quoted 2 lines
include/drm/drm_client_setup.h new file +2
-0+ +#endif
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 34/86] drm/renesas/rcar-du: Run DRM default client setup
In reply to Thomas ZimmermannHi Thomas,
Thank you for the patch.
Quoted 10 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The rcar-du driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Kieran Bingham <[email protected]>
Quoted 33 lines
--- drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c +3
-1@@ -19,6 +19,7 @@#include <linux/wait.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h> @@ -606,6 +607,7 @@ static const struct drm_driver rcar_du_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .dumb_create = rcar_du_dumb_create, .gem_prime_import_sg_table = rcar_du_gem_prime_import_sg_table, +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",@@ -716,7 +718,7 @@ static int rcar_du_probe(struct platform_device *pdev)drm_info (&rcdu->ddev,"Device %s probed\n" ,dev_name (&pdev->dev)); -drm_fbdev_dma_setup (&rcdu->ddev,32 ); +drm_client_setup (&rcdu->ddev,NULL );return 0 ;
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 36/86] drm/renesas/shmobile: Run DRM default client setup
In reply to Thomas ZimmermannHi Thomas,
Thank you for the patch.
Quoted 7 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Geert Uytterhoeven <[email protected]>
Quoted 36 lines
--- drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c +4
-1@@ -18,8 +18,10 @@#include <linux/slab.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_modeset_helper.h> #include <drm/drm_module.h> @@ -101,6 +103,7 @@ DEFINE_DRM_GEM_DMA_FOPS(shmob_drm_fops);static const struct drm_driver shmob_drm_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS , +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &shmob_drm_fops, .name ="shmob-drm" , .desc ="Renesas SH Mobile DRM" ,@@ -257,7 +260,7 @@ static int shmob_drm_probe(struct platform_device *pdev)if (ret <0 ) goto err_modeset_cleanup; -drm_fbdev_dma_setup (ddev,16 ); +drm_client_setup (ddev,drm_format_info (DRM_FORMAT_RGB565 ));return 0 ;
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 48/86] drm/xlnx: Run DRM default client setup
In reply to Thomas ZimmermannHi Thomas,
Thank you for the patch.
Quoted 33 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Michal Simek <[email protected]>--- drivers/gpu/drm/xlnx/zynqmp_kms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/xlnx/zynqmp_kms.c +2
-0@@ -14,6 +14,7 @@#include <drm/drm_blend.h> #include <drm/drm_bridge.h> #include <drm/drm_bridge_connector.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_crtc.h> #include <drm/drm_device.h> @@ -402,6 +403,7 @@ static const struct drm_driver zynqmp_dpsub_drm_driver = {DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (zynqmp_dpsub_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &zynqmp_dpsub_drm_fops,
drivers/gpu/drm/xlnx/zynqmp_kms.c int zynqmp_dpsub_drm_init(struct zynqmp_dpsub *dpsub) · line 528
Quoted 5 lines
drivers/gpu/drm/xlnx/zynqmp_kms.c +1
-1@@ -523,7 +525,7 @@ int zynqmp_dpsub_drm_init(struct zynqmp_dpsub *dpsub) goto err_poll_fini;/* Initialize fbdev generic emulation. */ -drm_fbdev_dma_setup (drm,24 ); +drm_client_setup (drm,drm_format_info (DRM_FORMAT_RGB888 ));
I know this would be a hassle to change, but do the majority of the callers of drm_client_setup() have a drm_format_info * already, or do they need to call drm_format_info() on a 4CC ? In the latter case, would it be better to pass the 4CC to drm_client_setup() ?
As far as this patch goes,
Quoted 3 lines
drivers/gpu/drm/xlnx/zynqmp_kms.c +0
-0return 0 ;
Signature · 3 lines
Regards, Laurent Pinchart
Re: [82/86] drm/i915: Move custom hotplug code into separate callback
In reply to Thomas ZimmermannHi, Thomas
I love your patch, yet ...
Quoted 23 lines · Thomas Zimmermann
i915's fbdev contains additional code for hotplugging a display that cannot be ported to the common fbdev client. Introduce the callback struct drm_fb_helper.fb_hotplug and implement it for i915. The fbdev helpers invoke the callback before handing the hotplug event.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Jani Nikula <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Lucas De Marchi <[email protected]>Cc "Thomas Hellström" <[email protected]>--- drivers/gpu/drm/drm_fb_helper.c | 6 +++ drivers/gpu/drm/i915/display/intel_fbdev.c | 43 ++++++++++++---------- include/drm/drm_fb_helper.h | 13 +++++++ 3 files changed, 42 insertions(+), 20 deletions(-)drivers/gpu/drm/drm_fb_helper.c +0
-0
drivers/gpu/drm/drm_fb_helper.c int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) · line 1941
Quoted 4 lines
drivers/gpu/drm/drm_fb_helper.c +1
-0@@ -1938,6 +1938,12 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)if (!drm_fbdev_emulation || !fb_helper)return 0 ; +if (fb_helper->funcs->fb_hotplug) {
We seems need to check the existence on the 'fb_helper->funcs' here,
For example:
if (fb_helper->funcs && fb_helper->funcs->fb_hotplug) {
Otherwise, it will de-reference NULL pointer.
Can be observed on a trivial driver though,
with no monitor(display) connected.
Quoted 104 lines
drivers/gpu/drm/drm_fb_helper.c +5
-0+ err = fb_helper->funcs->fb_hotplug (fb_helper); +if (err) +return err; + } +mutex_lock (&fb_helper->lock);if (fb_helper->deferred_setup) { err =__drm_fb_helper_initial_config_and_unlock (fb_helper);drivers/gpu/drm/i915/display/intel_fbdev.c +23
-20@@ -305,10 +305,32 @@ static void intelfb_restore(struct drm_fb_helper *fb_helper)intel_fbdev_invalidate (ifbdev); } +static int intelfb_hotplug (struct drm_fb_helper *fb_helper) +{ +struct drm_device *dev = fb_helper->client.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; +bool send_hpd; + +if (!ifbdev) +return -EINVAL ; + +mutex_lock (&ifbdev->hpd_lock); + send_hpd = !ifbdev->hpd_suspended; + ifbdev->hpd_waiting = true; +mutex_unlock (&ifbdev->hpd_lock); + +if (!send_hpd || !(ifbdev->vma || dev->fb_helper->deferred_setup)) +return -EAGAIN ; + +return 0 ; +} +static const struct drm_fb_helper_funcs intel_fb_helper_funcs = { .fb_probe = intelfb_create, .fb_dirty = intelfb_dirty, .fb_restore = intelfb_restore, + .fb_hotplug = intelfb_hotplug, };/* @@ -557,25 +579,6 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronousintel_fbdev_hpd_set_suspend (dev_priv, state); } -static int intel_fbdev_output_poll_changed (struct drm_device *dev) -{ -struct intel_fbdev *ifbdev =to_i915 (dev)->display.fbdev.fbdev; -bool send_hpd; - -if (!ifbdev) -return -EINVAL ; - -mutex_lock (&ifbdev->hpd_lock); - send_hpd = !ifbdev->hpd_suspended; - ifbdev->hpd_waiting = true; -mutex_unlock (&ifbdev->hpd_lock); - -if (send_hpd && (ifbdev->vma || dev->fb_helper->deferred_setup)) -drm_fb_helper_hotplug_event (dev->fb_helper); - -return 0 ; -} -static int intel_fbdev_restore_mode (struct drm_i915_private *dev_priv) {struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev;@@ -637,7 +640,7 @@ static int intel_fbdev_client_hotplug(struct drm_client_dev *client)int ret;if (dev->fb_helper) -return intel_fbdev_output_poll_changed (dev); +return drm_fb_helper_hotplug_event (fb_helper); ret =drm_fb_helper_init (dev, fb_helper);if (ret)include/drm/drm_fb_helper.h +13
-0@@ -112,6 +112,19 @@ struct drm_fb_helper_funcs {* TODO: Fix i915 to not require this callback. */ void (*fb_restore)(struct drm_fb_helper *helper); + +/** +* @fb_hotplug: +* +* Driver callback to prepare hotplug event. If set, fbdev +* emulation will invoke this callback before sending a hotplug +* event. +* +* Only for i915. Do not use in new code. +* +* TODO: Fix i915 to not require this callback. +*/ +int (*fb_hotplug)(struct drm_fb_helper *helper); };/**
Signature · 2 lines
Best regards, Sui
Re: [68/86] drm/loongson: Run DRM default client setup
In reply to Thomas ZimmermannHi,
Quoted 8 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The loongson driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>
Thanks,
Signature · 2 lines
Best regards, Sui
RE: [PATCH 35/86] drm/renesas/rz-du: Run DRM default client setup
In reply to Thomas ZimmermannHi Thomas Zimmermann,
Quoted 5 lines
-----Original Message-----
From: Thomas Zimmermann <[email protected]>
Sent: Friday, August 16, 2024 1:23 PM
Subject: [PATCH 35/86] drm/renesas/rz-du: Run DRM default client setup
Quoted 8 lines
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.The rz-du driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Biju Das <[email protected]>
Cheers,
Biju
Quoted 36 lines
--- drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/renesas/rz- renamed from drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c +0
-0
du/rzg2l_du_drv.c
indexe5eca8691a33..53f9e1b7fa87100644drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c +3
-2@@ -13,6 +13,7 @@#include <linux/platform_device.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_dma_helper.h> @@ -68,6 +69,7 @@ DEFINE_DRM_GEM_DMA_FOPS(rzg2l_du_fops);static const struct drm_driver rzg2l_du_driver = { .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , .dumb_create = rzg2l_du_dumb_create, +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &rzg2l_du_fops, .name ="rzg2l-du" , .desc ="Renesas RZ/G2L Display Unit" ,@@ -149,7 +151,7 @@ static int rzg2l_du_probe(struct platform_device *pdev)drm_info (&rcdu->ddev,"Device %s probed\n" ,dev_name (&pdev->dev)); -drm_fbdev_dma_setup (&rcdu->ddev,32 ); +drm_client_setup (&rcdu->ddev,NULL );return 0 ; --2.46.0
Re: [PATCH 31/86] drm/panel/ili9341: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 32 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Neil Armstrong <[email protected]>Cc Jessica Zhang <[email protected]>--- drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/panel/panel-ilitek-ili9341.c +2
-0@@ -31,6 +31,7 @@#include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h> @@ -591,6 +592,7 @@ static struct drm_driver ili9341_dbi_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9341_dbi_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "ili9341", .desc = "Ilitek ILI9341",
drivers/gpu/drm/panel/panel-ilitek-ili9341.c static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc, · line 659
Quoted 8 lines
drivers/gpu/drm/panel/panel-ilitek-ili9341.c +1
-1@@ -651,7 +653,7 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc,spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
Neil Armstrong
maintainerRe: [PATCH 31/86] drm/panel/ili9341: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 32 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Neil Armstrong <[email protected]>Cc Jessica Zhang <[email protected]>--- drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/panel/panel-ilitek-ili9341.c +2
-0@@ -31,6 +31,7 @@#include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h> @@ -591,6 +592,7 @@ static struct drm_driver ili9341_dbi_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9341_dbi_fops,DRM_GEM_DMA_DRIVER_OPS_VMAP , +DRM_FBDEV_DMA_DRIVER_OPS , .debugfs_init = mipi_dbi_debugfs_init, .name = "ili9341", .desc = "Ilitek ILI9341",
drivers/gpu/drm/panel/panel-ilitek-ili9341.c static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc, · line 659
Quoted 8 lines
drivers/gpu/drm/panel/panel-ilitek-ili9341.c +1
-1@@ -651,7 +653,7 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc,spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );return 0 ; }
So which one is right, this one or :
https://lore.kernel.org/all/[email protected]/
?
Neil
Re: [PATCH 57/86] drm/ofdrm: Use DRM default client setup
In reply to Thomas ZimmermannThomas Zimmermann <[email protected]> writes:
Hello Thomas,
Quoted 10 lines
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Javier Martinez Canillas <[email protected]>--- drivers/gpu/drm/tiny/ofdrm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Re: [PATCH 58/86] drm/simpledrm: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 11 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Javier Martinez Canillas <[email protected]>--- drivers/gpu/drm/tiny/simpledrm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Re: [PATCH 59/86] drm/solomon: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 4 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.
Quoted 9 lines
The solomon driver specifies a preferred color mode of 32. As this is the default if no format has been given, leave it out entirely.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Javier Martinez Canillas <[email protected]>--- drivers/gpu/drm/solomon/ssd130x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Thomas Zimmermann
maintainerRe: [PATCH 04/86] drm: Add client-agnostic setup helper
In reply to Laurent PinchartHi
Am 18.08.24 um 22:07 schrieb Laurent Pinchart:
Quoted 50 lines
Hi Thomas,
Thank you for the patch.
Quoted 8 lines · Thomas Zimmermann
DRM may support multiple in-kernel clients that run as soon as a DRM driver has been registered. To select the client(s) in a single place, introduce
drm_client_setup().Drivers that call the new helper automatically instantiate the kernel's configured default clients. Only fbdev emulation is currently supported. Later versions can add support for DRM-based logging, a boot logo or even a console.
I really like the direction this is taking :-)
Quoted 35 lines
Some drivers handle the color mode for clients internally. Provide the helper
drm_client_setup_with_color_mode()for them.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_client_setup.c | 55 ++++++++++++++++++++++++++++++ include/drm/drm_client_setup.h | 12 +++++++ 3 files changed, 68 insertions(+)create mode 100644
drivers/gpu/drm/drm_client_setup.ccreate mode 100644include/drm/drm_client_setup.hdrivers/gpu/drm/Makefile +1
-0@@ -129,6 +129,7 @@ drm_kms_helper-y := \ drm_atomic_helper.o \ drm_atomic_state_helper.o \ drm_bridge_connector.o \ + drm_client_setup.o \ drm_crtc_helper.o \ drm_damage_helper.o \ drm_encoder_slave.o \drivers/gpu/drm/drm_client_setup.c new file +5
-0@@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT + +#include <drm/drm_client_setup.h> +#include <drm/drm_device.h> +#include <drm/drm_fbdev_client.h>
Quoted 8 lines
drivers/gpu/drm/drm_client_setup.c line 12
Quoted 7 lines
drivers/gpu/drm/drm_client_setup.c new file +7
-0+#include <drm/drm_fourcc.h> +#include <drm/drm_print.h> + +/** +* drm_client_setup() - Setup in-kernel DRM clients +* @dev: DRM device +* @format: Preferred color format for the device. Use NULL, unless s/color format/pixel format/
Ah, ok.
Quoted 66 lines
Quoted 50 lines
drivers/gpu/drm/drm_client_setup.c new file +43
-0+* there is clearly a driver-preferred format. +* +* This function sets up the in-kernel DRM clients. Restore, hotplug +* events and teardown are all taken care of. +* +* Drivers should call drm_client_setup() after registering the new +* DRM device with drm_dev_register(). This function is safe to call +* even when there are no connectors present. Setup will be retried +* on the next hotplug event. +* +* The clients are destroyed by drm_dev_unregister(). +*/ +void drm_client_setup (struct drm_device *dev,const struct drm_format_info *format) +{ +int ret; + +if (!format) + format =drm_format_info (DRM_FORMAT_XRGB8888 ); + + ret =drm_fbdev_client_setup (dev, format); +if (ret) +drm_warn (dev,"Failed to set up DRM client; error %d\n" , ret); +} +EXPORT_SYMBOL (drm_client_setup); + +/** +* drm_client_setup_with_color_mode() - Setup in-kernel DRM clients for color mode +* @dev: DRM device +* @color_mode: Preferred color mode for the device +* +* This function sets up the in-kernel DRM clients. It is equivalent +* to drm_client_setup(), but expects a color mode as second argument. +* +* Do not use this function in new drivers. Prefer drm_client_setup() with a +* format of NULL. +*/ +void drm_client_setup_with_color_mode (struct drm_device *dev,unsigned int color_mode) +{ +uint32_t fmt =drm_driver_color_mode_format (dev, color_mode); + +drm_client_setup (dev,drm_format_info (fmt)); +} +EXPORT_SYMBOL (drm_client_setup_with_color_mode);include/drm/drm_client_setup.h new file +0
-0include/drm/drm_client_setup.h line 10
Quoted 10 lines
include/drm/drm_client_setup.h new file +10
-0@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef DRM_CLIENT_SETUP_H +#define DRM_CLIENT_SETUP_H + +struct drm_device ; +struct drm_format_info ; + +void drm_client_setup (struct drm_device *dev,const struct drm_format_info *format); +void drm_client_setup_with_color_mode (struct drm_device *dev,unsigned int color_mode);This is not common in DRM, so we may not want to introduce it here, but
_Generic()gives a nice function overloading syntax:void
drm_client_setup_with_format(struct drm_device *dev, const struct drm_format_info *format); voiddrm_client_setup_with_color_mode(struct drm_device *dev, unsigned int color_mode);
Quoted 7 lines
#define drm_client_setup_(dev, format_or_color_mode) \ _Generic(format_or_color_mode, \ const struct drm_format_info *: drm_client_setup_with_format(dev, format_or_color_mode), \ unsigned int: drm_client_setup_with_color_mode(dev, format_or_color_mode) \ )Up to you.
The color format is really a user interface. I'd rather like to remove it from the implementation where possible.
Best regards
Thomas
Quoted 5 lines
Reviewed-by Laurent Pinchart <[email protected]>Quoted 2 lines
include/drm/drm_client_setup.h new file +2
-0+ +#endif
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerRe: [PATCH 28/86] drm/mi0283qt: Run DRM default client setup
In reply to Noralf TrønnesHi
Am 16.08.24 um 18:01 schrieb Noralf Trønnes:
Quoted 20 lines · Thomas Zimmermann
Quoted 14 lines
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc "Noralf Trønnes" <[email protected]>--- drivers/gpu/drm/tiny/mi0283qt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/tiny/mi0283qt.c +0
-0<snip>
Quoted 2 lines
drivers/gpu/drm/tiny/mi0283qt.c +0
-0@@ -226,7 +228,7 @@ static int mi0283qt_probe(struct spi_device *spi)
Quoted 7 lines
drivers/gpu/drm/tiny/mi0283qt.c static int mi0283qt_probe(struct spi_device *spi) · line 231
Quoted 4 lines
drivers/gpu/drm/tiny/mi0283qt.c +1
-1spi_set_drvdata (spi, drm); -drm_fbdev_dma_setup (drm,0 ); +drm_client_setup (drm,NULL );Would it be possible for
drm_dev_register()to handle the client setup so drivers won't have to? structdrm_drivercould have a field for drivers that want a different color format.
There's drm_mode_config.preferred_depth, which at least serves this purpose to some extend.
I briefly considered using drm_dev_register() while making the patches, but then decided against it. In terms of design, functions should only do one thing. In practical terms, there is at least one driver author that explicitly decided against instantiating clients in the driver (sprd IIRC). And there is at least one driver where client format and preferred_depth are different (vc4).
But hopefully this series is the final major interface rework of this kind and later changes can be done within drm_client_setup() or incrementally.
Best regards
Thomas
Quoted 6 lines
Noralf.
Quoted 3 lines
drivers/gpu/drm/tiny/mi0283qt.c +0
-0return 0 ; }
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerRe: [PATCH 31/86] drm/panel/ili9341: Run DRM default client setup
In reply to Neil ArmstrongHi
Am 19.08.24 um 17:39 schrieb Neil Armstrong:
Quoted 42 lines · Thomas Zimmermann
Quoted 31 lines
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Neil Armstrong <[email protected]>Cc Jessica Zhang <[email protected]>---
drivers/gpu/drm/panel/panel-ilitek-ili9341.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/panel/panel-ilitek-ili9341.c +2
-0@@ -31,6 +31,7 @@ #include <video/mipi_display.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> #include <drm/drm_gem_atomic_helper.h>@@ -591,6 +592,7 @@ static struct drm_driver ili9341_dbi_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &ili9341_dbi_fops, DRM_GEM_DMA_DRIVER_OPS_VMAP, + DRM_FBDEV_DMA_DRIVER_OPS, .debugfs_init = mipi_dbi_debugfs_init, .name = "ili9341", .desc = "Ilitek ILI9341",drivers/gpu/drm/panel/panel-ilitek-ili9341.c static int ili9341_dbi_probe(struct spi_device · line 658
Quoted 6 lines
drivers/gpu/drm/panel/panel-ilitek-ili9341.c +1
-0@@ -651,7 +653,7 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc, spi_set_drvdata(spi, drm); - drm_fbdev_dma_setup(drm, 0); + drm_client_setup(drm, NULL); return 0; }So which one is right, this one or :
https://lore.kernel.org/all/[email protected]/
Quoted 1 line
?
There's long been talk about removing some duplicated drivers. IDK which is the correct or best one. I'll patch the panel driver if it will still be there.
Best regards
Thomas
Quoted 2 lines
Neil
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerRe: [82/86] drm/i915: Move custom hotplug code into separate callback
In reply to Sui JingfengHi
Am 19.08.24 um 10:52 schrieb Sui Jingfeng:
Quoted 37 lines
Hi, Thomas
I love your patch, yet ...
Quoted 23 lines · Thomas Zimmermann
i915's fbdev contains additional code for hotplugging a display that cannot be ported to the common fbdev client. Introduce the callback struct drm_fb_helper.fb_hotplug and implement it for i915. The fbdev helpers invoke the callback before handing the hotplug event.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Jani Nikula <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Lucas De Marchi <[email protected]>Cc "Thomas Hellström" <[email protected]>---
drivers/gpu/drm/drm_fb_helper.c | 6 +++drivers/gpu/drm/i915/display/intel_fbdev.c| 43 ++++++++++++---------- include/drm/drm_fb_helper.h | 13 +++++++3 files changed, 42 insertions(+), 20 deletions(-)drivers/gpu/drm/drm_fb_helper.c +0
-0drivers/gpu/drm/drm_fb_helper.c int drm_fb_helper_hotplug_event(struct · line 1941
Quoted 4 lines
drivers/gpu/drm/drm_fb_helper.c +0
-0@@ -1938,6 +1938,12 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) if (!drm_fbdev_emulation || !fb_helper) return 0; + if (fb_helper->funcs->fb_hotplug) {We seems need to check the existence on the '
fb_helper->funcs' here,
Quoted 8 lines
For example:
if (
fb_helper->funcs&&fb_helper->funcs->fb_hotplug) {Otherwise, it will de-reference NULL pointer.
Can be observed on a trivial driver though,
with no monitor(display) connected.
Indeed. That needs to be fixed. Thank you for noting.
To give some context: I was hoping to remove drm_fb_helper_funcs at some point. fb_probe is now gone with these patches and fb_dirty can certainly be replaced as well. (I once had prototype patches to do that). This leaves the new callbacks for 915, for which I don't have a good alternative solution. So it seems that drm_fb_helper_funcs will only be used by i915/xe in the long term.
Best regards
Thomas
Quoted 104 lines
Quoted 103 lines
drivers/gpu/drm/drm_fb_helper.c +5
-0+ err = fb_helper->funcs->fb_hotplug(fb_helper); + if (err) + return err; + } + mutex_lock(&fb_helper->lock); if (fb_helper->deferred_setup) {err =
__drm_fb_helper_initial_config_and_unlock(fb_helper);drivers/gpu/drm/i915/display/intel_fbdev.c +21
-18@@ -305,10 +305,32 @@ static void intelfb_restore(struct drm_fb_helper *fb_helper) intel_fbdev_invalidate(ifbdev); } +static int intelfb_hotplug(struct drm_fb_helper *fb_helper) +{ + struct drm_device *dev = fb_helper->client.dev; + struct drm_i915_private *dev_priv = to_i915(dev); + struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev; + bool send_hpd; + + if (!ifbdev) + return -EINVAL; + + mutex_lock(&ifbdev->hpd_lock); + send_hpd = !ifbdev->hpd_suspended; + ifbdev->hpd_waiting = true; + mutex_unlock(&ifbdev->hpd_lock); + + if (!send_hpd || !(ifbdev->vma || dev->fb_helper->deferred_setup)) + return -EAGAIN; + + return 0; +} + static const struct drm_fb_helper_funcs intel_fb_helper_funcs = { .fb_probe = intelfb_create, .fb_dirty = intelfb_dirty, .fb_restore = intelfb_restore, + .fb_hotplug = intelfb_hotplug, }; /*@@ -557,25 +579,6 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous intel_fbdev_hpd_set_suspend(dev_priv, state); } -static int intel_fbdev_output_poll_changed(struct drm_device *dev) -{ - struct intel_fbdev *ifbdev = to_i915(dev)->display.fbdev.fbdev; - bool send_hpd; - - if (!ifbdev) - return -EINVAL; - - mutex_lock(&ifbdev->hpd_lock); - send_hpd = !ifbdev->hpd_suspended; - ifbdev->hpd_waiting = true; - mutex_unlock(&ifbdev->hpd_lock); - - if (send_hpd && (ifbdev->vma || dev->fb_helper->deferred_setup)) - drm_fb_helper_hotplug_event(dev->fb_helper); - - return 0; -} - static int intel_fbdev_restore_mode(struct drm_i915_private *dev_priv) {struct
intel_fbdev*ifbdev =dev_priv->display.fbdev.fbdev;drivers/gpu/drm/i915/display/intel_fbdev.c +1
-1@@ -637,7 +640,7 @@ static int intel_fbdev_client_hotplug(struct drm_client_dev *client) int ret; if (dev->fb_helper) - return intel_fbdev_output_poll_changed(dev); + return drm_fb_helper_hotplug_event(fb_helper); ret = drm_fb_helper_init(dev, fb_helper); if (ret)include/drm/drm_fb_helper.h +13
-0@@ -112,6 +112,19 @@ struct drm_fb_helper_funcs {* TODO: Fix i915 to not require this callback. */ void (*fb_restore)(struct drm_fb_helper *helper); + + /** + * @fb_hotplug: + * + * Driver callback to prepare hotplug event. If set, fbdev + * emulation will invoke this callback before sending a hotplug + * event. + * + * Only for i915. Do not use in new code. + * + * TODO: Fix i915 to not require this callback. + */ + int (*fb_hotplug)(struct drm_fb_helper *helper); }; /**
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Laurent Pinchart
maintainerRe: [PATCH 04/86] drm: Add client-agnostic setup helper
In reply to Thomas ZimmermannHi Thomas,
Quoted 130 lines · Thomas Zimmermann
Am 18.08.24 um 22:07 schrieb Laurent Pinchart:
Quoted 47 lines · Thomas Zimmermann
Quoted 8 lines
DRM may support multiple in-kernel clients that run as soon as a DRM driver has been registered. To select the client(s) in a single place, introduce
drm_client_setup().Drivers that call the new helper automatically instantiate the kernel's configured default clients. Only fbdev emulation is currently supported. Later versions can add support for DRM-based logging, a boot logo or even a console.
I really like the direction this is taking :-)
Quoted 36 lines
Some drivers handle the color mode for clients internally. Provide the helper
drm_client_setup_with_color_mode()for them.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_client_setup.c | 55 ++++++++++++++++++++++++++++++ include/drm/drm_client_setup.h | 12 +++++++ 3 files changed, 68 insertions(+)create mode 100644
drivers/gpu/drm/drm_client_setup.ccreate mode 100644include/drm/drm_client_setup.hdrivers/gpu/drm/Makefile +1
-0@@ -129,6 +129,7 @@ drm_kms_helper-y := \ drm_atomic_helper.o \ drm_atomic_state_helper.o \ drm_bridge_connector.o \ + drm_client_setup.o \ drm_crtc_helper.o \ drm_damage_helper.o \ drm_encoder_slave.o \drivers/gpu/drm/drm_client_setup.c new file +6
-0@@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT + +#include <drm/drm_client_setup.h> +#include <drm/drm_device.h> +#include <drm/drm_fbdev_client.h> +#include <drm/drm_fourcc.h> Quoted 8 lines
drivers/gpu/drm/drm_client_setup.c line 12
Quoted 7 lines
drivers/gpu/drm/drm_client_setup.c new file +6
-0+#include <drm/drm_print.h> + +/** +* drm_client_setup() - Setup in-kernel DRM clients +* @dev: DRM device +* @format: Preferred color format for the device. Use NULL, unless s/color format/pixel format/
Ah, ok.
Quoted 71 lines
Quoted 49 lines
drivers/gpu/drm/drm_client_setup.c new file +43
-0+* there is clearly a driver-preferred format. +* +* This function sets up the in-kernel DRM clients. Restore, hotplug +* events and teardown are all taken care of. +* +* Drivers should call drm_client_setup() after registering the new +* DRM device with drm_dev_register(). This function is safe to call +* even when there are no connectors present. Setup will be retried +* on the next hotplug event. +* +* The clients are destroyed by drm_dev_unregister(). +*/ +void drm_client_setup (struct drm_device *dev,const struct drm_format_info *format) +{ +int ret; + +if (!format) + format =drm_format_info (DRM_FORMAT_XRGB8888 ); + + ret =drm_fbdev_client_setup (dev, format); +if (ret) +drm_warn (dev,"Failed to set up DRM client; error %d\n" , ret); +} +EXPORT_SYMBOL (drm_client_setup); + +/** +* drm_client_setup_with_color_mode() - Setup in-kernel DRM clients for color mode +* @dev: DRM device +* @color_mode: Preferred color mode for the device +* +* This function sets up the in-kernel DRM clients. It is equivalent +* to drm_client_setup(), but expects a color mode as second argument. +* +* Do not use this function in new drivers. Prefer drm_client_setup() with a +* format of NULL. +*/ +void drm_client_setup_with_color_mode (struct drm_device *dev,unsigned int color_mode) +{ +uint32_t fmt =drm_driver_color_mode_format (dev, color_mode); + +drm_client_setup (dev,drm_format_info (fmt)); +} +EXPORT_SYMBOL (drm_client_setup_with_color_mode);include/drm/drm_client_setup.h new file +0
-0include/drm/drm_client_setup.h line 10
Quoted 10 lines
include/drm/drm_client_setup.h new file +10
-0@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef DRM_CLIENT_SETUP_H +#define DRM_CLIENT_SETUP_H + +struct drm_device ; +struct drm_format_info ; + +void drm_client_setup (struct drm_device *dev,const struct drm_format_info *format); +void drm_client_setup_with_color_mode (struct drm_device *dev,unsigned int color_mode);This is not common in DRM, so we may not want to introduce it here, but
_Generic()gives a nice function overloading syntax:void
drm_client_setup_with_format(struct drm_device *dev, const struct drm_format_info *format); voiddrm_client_setup_with_color_mode(struct drm_device *dev, unsigned int color_mode);#define drm_client_setup_(dev, format_or_color_mode) \ _Generic(format_or_color_mode, \ const struct drm_format_info *: drm_client_setup_with_format(dev, format_or_color_mode), \ unsigned int: drm_client_setup_with_color_mode(dev, format_or_color_mode) \ )
Quoted 4 lines
Quoted 1 line
Up to you.
The color format is really a user interface. I'd rather like to remove it from the implementation where possible.
Do you mean the color mode ? If so I agree.
Quoted 4 lines
Quoted 4 lines
Reviewed-by Laurent Pinchart <[email protected]>Quoted 2 lines
include/drm/drm_client_setup.h new file +2
-0+ +#endif
Signature · 3 lines
Regards, Laurent Pinchart
Thomas Zimmermann
maintainerRe: [PATCH 48/86] drm/xlnx: Run DRM default client setup
In reply to Laurent PinchartHi
Am 18.08.24 um 22:19 schrieb Laurent Pinchart:
Quoted 40 lines
Hi Thomas,
Thank you for the patch.
Quoted 35 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Michal Simek <[email protected]>--- drivers/gpu/drm/xlnx/zynqmp_kms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/xlnx/zynqmp_kms.c +2
-0@@ -14,6 +14,7 @@#include <drm/drm_blend.h> #include <drm/drm_bridge.h> #include <drm/drm_bridge_connector.h> +#include <drm/drm_client_setup.h> #include <drm/drm_connector.h> #include <drm/drm_crtc.h> #include <drm/drm_device.h> @@ -402,6 +403,7 @@ static const struct drm_driver zynqmp_dpsub_drm_driver = {DRIVER_ATOMIC ,DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE (zynqmp_dpsub_dumb_create), +DRM_FBDEV_DMA_DRIVER_OPS , .fops = &zynqmp_dpsub_drm_fops,@@ -523,7 +525,7 @@ int zynqmp_dpsub_drm_init(struct zynqmp_dpsub *dpsub) goto err_poll_fini;
Quoted 7 lines
drivers/gpu/drm/xlnx/zynqmp_kms.c int zynqmp_dpsub_drm_init(struct zynqmp_dpsub *dpsub) · line 528
Quoted 3 lines
drivers/gpu/drm/xlnx/zynqmp_kms.c +1
-1/* Initialize fbdev generic emulation. */ -drm_fbdev_dma_setup (drm,24 ); +drm_client_setup (drm,drm_format_info (DRM_FORMAT_RGB888 ));I know this would be a hassle to change, but do the majority of the callers of
drm_client_setup()have adrm_format_info* already, or do they need to calldrm_format_info()on a 4CC ? In the latter case, would it be better to pass the 4CC todrm_client_setup()?
Good idea. Most of the drivers have a 4cc code, but no format-info pointer. I think there are enough instances that it makes sense to add a little helper, drm_client_setup_with_fourcc(), for these drivers.
There's also preferred_depth from drm_mode_config. It's already used in the client mode-setting code. That means that in some drivers, the format parameter to drm_client_setup() could likely be dropped.
Best regards
Thomas
Quoted 8 lines
As far as this patch goes,
Reviewed-by Laurent Pinchart <[email protected]>Quoted 3 lines
drivers/gpu/drm/xlnx/zynqmp_kms.c +0
-0return 0 ;
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerRe: [PATCH 04/86] drm: Add client-agnostic setup helper
In reply to Laurent PinchartHi
Am 20.08.24 um 09:40 schrieb Laurent Pinchart:
Quoted 3 lines
Quoted 2 lines
The color format is really a user interface. I'd rather like to remove it from the implementation where possible.
Do you mean the color mode ? If so I agree.
Yeah, the "color mode". This number with inconsistent semantics.
Best regards
Thomas
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Reviewed-by Laurent Pinchart <[email protected]>Quoted 2 lines
(quoted diff) +2
-0+ +#endif
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Re: [PATCH 28/86] drm/mi0283qt: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 7 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc "Noralf Trønnes" <[email protected]>---
Re: [PATCH 32/86] drm/panel-mipi-dbi: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 7 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc "Noralf Trønnes" <[email protected]>---
Re: [PATCH 37/86] drm/repaper: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 7 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc "Noralf Trønnes" <[email protected]>---
Re: [PATCH 54/86] drm/gud: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 7 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc "Noralf Trønnes" <[email protected]>---
Re: [82/86] drm/i915: Move custom hotplug code into separate callback
In reply to Thomas ZimmermannHi,
Quoted 44 lines · Thomas Zimmermann
Hi
Am 19.08.24 um 10:52 schrieb Sui Jingfeng:
Quoted 41 lines
Hi, Thomas
I love your patch, yet ...
Quoted 24 lines · Thomas Zimmermann
i915's fbdev contains additional code for hotplugging a display that cannot be ported to the common fbdev client. Introduce the callback struct drm_fb_helper.fb_hotplug and implement it for i915. The fbdev helpers invoke the callback before handing the hotplug event.
Signed-off-by Thomas Zimmermann <[email protected]>Cc Jani Nikula <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Lucas De Marchi <[email protected]>Cc "Thomas Hellström" <[email protected]>---
drivers/gpu/drm/drm_fb_helper.c | 6 +++drivers/gpu/drm/i915/display/intel_fbdev.c| 43
++++++++++++----------
include/drm/drm_fb_helper.h | 13 +++++++3 files changed, 42 insertions(+), 20 deletions(-)drivers/gpu/drm/drm_fb_helper.c +0
-0drivers/gpu/drm/drm_fb_helper.c int drm_fb_helper_hotplug_event(struct · line 1941
Quoted 4 lines
drivers/gpu/drm/drm_fb_helper.c +0
-0@@ -1938,6 +1938,12 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) if (!drm_fbdev_emulation || !fb_helper) return 0; + if (fb_helper->funcs->fb_hotplug) {We seems need to check the existence on the '
fb_helper->funcs' here,For example:
Quoted 8 lines
Quoted 5 lines
if (
fb_helper->funcs&&fb_helper->funcs->fb_hotplug) {Otherwise, it will de-reference NULL pointer.
Can be observed on a trivial driver though,
with no monitor(display) connected.Indeed. That needs to be fixed. Thank you for noting.
Thanks for you efforts then.
Quoted 1 line
To give some context: I was hoping to remove
drm_fb_helper_funcsat some point.
Yeah, too many helper functions may make peoples daze.
Quoted 1 line
fb_probeis now gone with these patches andfb_dirtycan certainly be replaced as well. (I once had prototype patches to do that).
Well, the grammar of "ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes);" looks strange, It's lengthy and I observed you have cleaned it up at the last patch. Which also eliminates one pair "if and else" clause, the codes looks more fluent now.
Quoted 2 lines
This leaves the new callbacks for 915, for which I don't have a good alternative solution. So it seems that
drm_fb_helper_funcswill only be used by i915/xe in the long term.
Well, since it is a DRM client now, maybe we could try to drop it into struct drm_driver. Just like the '.fbdev_probe' callback, this may help to achieve a 100% DRM-based console/logger IMO.
Besides, a lot of DRM driver instances has the DMA/2D acceleration hardware, promote it into drm_driver structure may has the potential to utilize hardware acceleration. Drivers will more easily to have custom implementation. I'm not 100% sure if it will only be used by i915 in the future.
Best regards,
Sui
Re: [PATCH 40/86] drm/stm: Run DRM default client setup
In reply to Thomas ZimmermannQuoted 10 lines · Thomas Zimmermann
Call
drm_client_setup()to run the kernel's default client setup for DRM. Setfbdev_probein structdrm_driver, so that the client setup can start the common fbdev client.Signed-off-by Thomas Zimmermann <[email protected]>Cc Yannick Fertre <[email protected]>Cc Raphael Gallais-Pou <[email protected]>Cc Philippe Cornu <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>
Hi Thomas,
Thanks,
Regards,
Raphaël
Thomas Zimmermann
maintainerRe: [82/86] drm/i915: Move custom hotplug code into separate callback
In reply to Sui JingfengHi
Am 20.08.24 um 12:39 schrieb Sui Jingfeng:
Quoted 6 lines
Besides, a lot of DRM driver instances has the DMA/2D acceleration hardware, promote it into
drm_driverstructure may has the potential to utilize hardware acceleration. Drivers will more easily to have custom implementation. I'm not 100% sure if it will only be used by i915 in the future.
The correct place to do acceleration would be in the blit helpers in drm_format_helper.c. But no one bothered so far. For fbdev-only acceleration, DRM drivers could have custom fb_ops for accelerated drawing, copying, etc. Few cared and almost all removed that code at some point. The latest consent was that the complexity of the implementation outweights the performance gains. Even the few devs who actually asked for it didn't bother in the end.
Best regards
Thomas
Quoted 4 lines
Best regards,
Sui
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)