drm: Allow simpledrm to setup its emulated FB as firmware provided
Subsystems (42)
v2 cover drm: Allow simpledrm to setup its emulated FB as firmware provided
Hello,
This series contain patches suggested by Thomas Zimmermann as a feedback for "[RFC PATCH v4 00/11] Fix some race between sysfb device registration and drivers probe" [0].
Since other changes in [0] were more controversial, I decided to just split this part in a new patch-set and revisit the rest of the patches later.
This is a v2 that addresses issues pointed out in v1.
Patch #1 is just a cleanup since when working on this noticed that some DRM drivers were passing as preferred bits per pixel to drm_fbdev_generic_setup() the value that is the default anyways.
Patch #2 renames the 'preferred_bpp' drm_fbdev_generic_setup() parameter to 'options', and make this a multi field parameter so that it can be extended later to pass other options as well.
Patch #3 finally adds the new DRM_FB_FW option and makes simpledrm to use it so that the registered framebuffer device is also marked as firmware provided.
[0]: https://lore.kernel.org/lkml/[email protected]/
Changes in v2:
- Rename DRM_FB_SET_OPTION() to DRM_FB_SET() and make more clear in the kernel-doc what this macro does (Laurent Pinchart).
- Fix some kernel-doc issues I didn't notice in v1.
- Add Reviewed-by tags from Thomas and Laurent.
Javier Martinez Canillas (3):
drm: Remove superfluous arg when calling to drm_fbdev_generic_setup() drm/fb-helper: Rename preferred_bpp drm_fbdev_generic_setup()
parameter
drm: Allow simpledrm to setup its emulated FB as firmware provided
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 +++-- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/arm/malidp_drv.c | 2 +- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 2 +- drivers/gpu/drm/ast/ast_drv.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +- drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 26 ++++++++++++++++--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +- .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 +- drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 +- drivers/gpu/drm/imx/imx-drm-core.c | 2 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +- drivers/gpu/drm/mcde/mcde_drv.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 +- drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 +- drivers/gpu/drm/pl111/pl111_drv.c | 2 +- drivers/gpu/drm/qxl/qxl_drv.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- drivers/gpu/drm/sti/sti_drv.c | 2 +- drivers/gpu/drm/stm/drv.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/tiny/bochs.c | 2 +- drivers/gpu/drm/tiny/cirrus.c | 2 +- drivers/gpu/drm/tiny/simpledrm.c | 2 +- drivers/gpu/drm/tve200/tve200_drv.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 +- include/drm/drm_fb_helper.h | 22 ++++++++++++++++ 36 files changed, 81 insertions(+), 39 deletions(-)
Signature · 1 line
2.35.1
PATCH v2 1/3 drm: Remove superfluous arg when calling to drm_fbdev_generic_setup()
The drm_fbdev_generic_setup() function already sets the preferred bits per pixel for the device to dev->mode_config.preferred_depth, if preferred_bpp value is zero.
Passing the same value to the function is unnecessary. Let's cleanup that in the two drivers that do it.
---
(no changes since v1)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +- drivers/gpu/drm/tiny/cirrus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +1 -1
@@ -349,7 +349,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev, goto err_unload; } -drm_fbdev_generic_setup (dev, dev->mode_config.preferred_depth); +drm_fbdev_generic_setup (dev,0 );return 0 ;
drivers/gpu/drm/tiny/cirrus.c +1 -1
@@ -601,7 +601,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,if (ret)return ret; -drm_fbdev_generic_setup (dev, dev->mode_config.preferred_depth); +drm_fbdev_generic_setup (dev,0 );return 0 ; }
Signature · 1 line
2.35.1
Re: [PATCH v2 1/3] drm: Remove superfluous arg when calling to drm_fbdev_generic_setup()
Hi Javier,
Thank you for the patch.
Quoted 6 lines · Javier Martinez Canillas
The
drm_fbdev_generic_setup()function already sets the preferred bits per pixel for the device todev->mode_config.preferred_depth, ifpreferred_bppvalue is zero.Passing the same value to the function is unnecessary. Let's cleanup that in the two drivers that do it.
This looks fine, so
but why do we have two different mechanisms to set the preferred depth ? Could we get all drivers to set dev->mode_config.preferred_depth and drop the depth option to drm_fbdev_generic_setup() ? There's a FIXME comment in drm_fbdev_generic_setup() that could be related.
Quoted 36 lines
Signed-off-by Javier Martinez Canillas <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>---
(no changes since v1)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +- drivers/gpu/drm/tiny/cirrus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +1
-1@@ -349,7 +349,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev, goto err_unload; } -drm_fbdev_generic_setup (dev, dev->mode_config.preferred_depth); +drm_fbdev_generic_setup (dev,0 );return 0 ;drivers/gpu/drm/tiny/cirrus.c +1
-1@@ -601,7 +601,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,if (ret)return ret; -drm_fbdev_generic_setup (dev, dev->mode_config.preferred_depth); +drm_fbdev_generic_setup (dev,0 );return 0 ; }
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH v2 1/3] drm: Remove superfluous arg when calling to drm_fbdev_generic_setup()
Hello Laurent,
Quoted 12 lines · Laurent Pinchart
Hi Javier,
Thank you for the patch.
Quoted 6 lines · Javier Martinez Canillas
The
drm_fbdev_generic_setup()function already sets the preferred bits per pixel for the device todev->mode_config.preferred_depth, ifpreferred_bppvalue is zero.Passing the same value to the function is unnecessary. Let's cleanup that in the two drivers that do it.
Quoted 6 lines
This looks fine, so
Reviewed-by Laurent Pinchart <[email protected]>but why do we have two different mechanisms to set the preferred depth ? Could we get all drivers to set
dev->mode_config.preferred_depthand
Yes, that's the plan and the reason why when we were discussing with Thomas about how to pass this option to the FB helper layer, we agreed on reusing the @preferred_bpp parameter rather than adding a third parameter to drm_fbdev_generic_setup(). Since in the future drivers shouldn't pass that information to the FB helper and just get it from the default mode config.
But doing that would require more auditing to all drivers and it could add regressions while patches 1/2 and 2/2 in this series shouldn't cause any behavioral changes.
Quoted 3 lines
drop the depth option to
drm_fbdev_generic_setup()? There's a FIXME comment indrm_fbdev_generic_setup()that could be related.
A FIXME makes sense, I'll add that to when posting a v3.
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
Re: [PATCH v2 1/3] drm: Remove superfluous arg when calling to drm_fbdev_generic_setup()
On 5/2/22 18:55, Javier Martinez Canillas wrote:
[snip]
Quoted 6 lines
Quoted 4 lines
drop the depth option to
drm_fbdev_generic_setup()? There's a FIXME comment indrm_fbdev_generic_setup()that could be related.A FIXME makes sense, I'll add that to when posting a v3.
There's actually a FIXME already in drm_fbdev_generic_setup(), so it's a documented issue [0]:
void drm_fbdev_generic_setup(struct drm_device *dev,
unsigned int preferred_bpp)
{
...
/* * FIXME: This mixes up depth with bpp, which results in a glorious * mess, resulting in some drivers picking wrong fbdev defaults and * others wrong preferred_depth defaults. */ if (!preferred_bpp) preferred_bpp = dev->mode_config.preferred_depth; if (!preferred_bpp) preferred_bpp = 32; fb_helper->preferred_bpp = preferred_bpp;
...
}
[0]: https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/gpu/drm/drm_fb_helper.c#L2553
Signature · 5 lines
Best regards, Javier Martinez Canillas Linux Engineering Red Hat
Laurent Pinchart
maintainerRe: [PATCH v2 1/3] drm: Remove superfluous arg when calling to drm_fbdev_generic_setup()
Quoted 11 lines · Javier Martinez Canillas
On 5/2/22 18:55, Javier Martinez Canillas wrote:
[snip]
Quoted 4 lines
Quoted 2 lines
drop the depth option to
drm_fbdev_generic_setup()? There's a FIXME comment indrm_fbdev_generic_setup()that could be related.A FIXME makes sense, I'll add that to when posting a v3.
There's actually a FIXME already in
drm_fbdev_generic_setup(), so it's a documented issue [0]:
That's what I meant by "there's a FIXME" :-) It doesn't have to be addressed by this series, but it would be good to fix it.
Quoted 18 lines
void drm_fbdev_generic_setup(struct
drm_device*dev,
unsigned intpreferred_bpp)
{
.../* * FIXME: This mixes up depth with bpp, which results in a glorious * mess, resulting in some drivers picking wrong fbdev defaults and * others wrong preferred_depth defaults. */ if (!preferred_bpp) preferred_bpp = dev->mode_config.preferred_depth; if (!preferred_bpp) preferred_bpp = 32; fb_helper->preferred_bpp = preferred_bpp;...
}[0]: https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/gpu/drm/drm_fb_helper.c#L2553
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH v2 1/3] drm: Remove superfluous arg when calling to drm_fbdev_generic_setup()
Quoted 8 lines · Laurent Pinchart
Quoted 7 lines · Javier Martinez Canillas
On 5/2/22 18:55, Javier Martinez Canillas wrote:
[snip]
Quoted 3 lines
Quoted 2 lines
drop the depth option to
drm_fbdev_generic_setup()? There's a FIXME comment indrm_fbdev_generic_setup()that could be related.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
A FIXME makes sense, I'll add that to when posting a v3.
There's actually a FIXME already in
drm_fbdev_generic_setup(), so it's a documented issue [0]:That's what I meant by "there's a FIXME" :-) It doesn't have to be addressed by this series, but it would be good to fix it.
doh, I misread your original email. Yes, it's the same issue as you said and something that I plan to look at some point as a follow-up.
I hope that we could just replace fbcon with a kms/systemd-consoled/foo user-space implementation before fixing all the stuff in the DRM fbdev emulation layer :)
Signature · 5 lines
Best regards, Javier Martinez Canillas Linux Engineering Red Hat
Laurent Pinchart
maintainerRe: [PATCH v2 1/3] drm: Remove superfluous arg when calling to drm_fbdev_generic_setup()
Quoted 17 lines · Javier Martinez Canillas
Quoted 8 lines · Laurent Pinchart
Quoted 7 lines · Javier Martinez Canillas
On 5/2/22 18:55, Javier Martinez Canillas wrote:
[snip]
Quoted 3 lines
Quoted 2 lines
drop the depth option to
drm_fbdev_generic_setup()? There's a FIXME comment indrm_fbdev_generic_setup()that could be related.Quoted 7 lines
Quoted 4 lines
Quoted 1 line
A FIXME makes sense, I'll add that to when posting a v3.
There's actually a FIXME already in
drm_fbdev_generic_setup(), so it's a documented issue [0]:That's what I meant by "there's a FIXME" :-) It doesn't have to be addressed by this series, but it would be good to fix it.
Quoted 6 lines
doh, I misread your original email. Yes, it's the same issue as you said and something that I plan to look at some point as a follow-up.
I hope that we could just replace fbcon with a kms/systemd-consoled/foo user-space implementation before fixing all the stuff in the DRM fbdev emulation layer :)
If you can do that, I'll provide champagne :-)
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v2 2/3 drm/fb-helper: Rename preferred_bpp drm_fbdev_generic_setup() parameter
In reply to Javier Martinez CanillasBy default the bits per pixel for the emulated framebuffer device is set to dev->mode_config.preferred_depth, but some devices need another value.
Since this second parameter is only used by a few drivers, and to allow drivers to use it for passing other configurations when registering the fbdev, rename @preferred_bpp to @options and make it a multi-field param.
The DRM_FB_OPTION() and DRM_FB_GET_OPTION() macros are provided to drivers for computing options bitfield values and getting the values respectively
For now, only the DRM_FB_BPP option exists but other options can be added.
---
Changes in v2:
- Rename DRM_FB_SET_OPTION() to DRM_FB_SET() and make more clear in the kernel-doc what this macro does (Laurent Pinchart).
- Fix some kernel-doc issues I didn't notice in v1.
- Add Reviewed-by tags from Thomas and Laurent.
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 ++++-- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/arm/malidp_drv.c | 2 +- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 2 +- drivers/gpu/drm/ast/ast_drv.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +- drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 17 +++++++++++++---- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 +- drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 +- drivers/gpu/drm/imx/imx-drm-core.c | 2 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +- drivers/gpu/drm/mcde/mcde_drv.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 +- drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 +- drivers/gpu/drm/pl111/pl111_drv.c | 2 +- drivers/gpu/drm/qxl/qxl_drv.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- drivers/gpu/drm/sti/sti_drv.c | 2 +- drivers/gpu/drm/stm/drv.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/tiny/bochs.c | 2 +- drivers/gpu/drm/tve200/tve200_drv.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 +- include/drm/drm_fb_helper.h | 12 ++++++++++++ 33 files changed, 59 insertions(+), 36 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -2
@@ -2118,9 +2118,11 @@ 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_generic_setup (adev_to_drm (adev),8 ); +drm_fbdev_generic_setup (adev_to_drm (adev), +DRM_FB_OPTION (DRM_FB_BPP ,8 ));else -drm_fbdev_generic_setup (adev_to_drm (adev),32 ); +drm_fbdev_generic_setup (adev_to_drm (adev), +DRM_FB_OPTION (DRM_FB_BPP ,32 )); } ret =amdgpu_debugfs_init (adev);
drivers/gpu/drm/arm/hdlcd_drv.c +1 -1
@@ -321,7 +321,7 @@ static int hdlcd_drm_bind(struct device *dev)if (ret) goto err_register; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/arm/malidp_drv.c +1 -1
@@ -863,7 +863,7 @@ static int malidp_bind(struct device *dev)if (ret) goto register_fail; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1 -1
@@ -343,7 +343,7 @@ static int aspeed_gfx_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (&priv->drm,32 ); +drm_fbdev_generic_setup (&priv->drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; err_unload:
drivers/gpu/drm/ast/ast_drv.c +1 -1
@@ -126,7 +126,7 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret)return ret; -drm_fbdev_generic_setup (dev,32 ); +drm_fbdev_generic_setup (dev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; }
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1 -1
@@ -760,7 +760,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (ddev,24 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,24 ));return 0 ;
drivers/gpu/drm/drm_drv.c +1 -1
@@ -324,7 +324,7 @@ void drm_minor_release(struct drm_minor *minor)* if (ret) * return ret; * -* drm_fbdev_generic_setup(drm, 32); +* drm_fbdev_generic_setup(drm, DRM_FB_OPTION(DRM_FB_BPP, 32)); * * return 0; * }
drivers/gpu/drm/drm_fb_helper.c +13 -4
@@ -2501,8 +2501,17 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {/** * drm_fbdev_generic_setup() - Setup generic fbdev emulation * @dev: DRM device -* @preferred_bpp: Preferred bits per pixel for the device. -* @dev->mode_config.preferred_depth is used if this is zero. +* @options: options for the registered framebuffer. +* +* The @options parameter is a multi-field parameter that can contain +* different options for the emulated framebuffer device registered. +* +* The options field values can be set using DRM_FB_OPTION() to compute +* the value according to the option bitfield and can be obtained using +* DRM_FB_GET_OPTION(). The options fields are the following: +* +* * DRM_FB_BPP: bits per pixel for the device. If the field is not set, +* @dev->mode_config.preferred_depth is used instead. * * This function sets up generic fbdev emulation for drivers that supports * dumb buffers with a virtual address and that can be mmap'ed.
@@ -2525,10 +2534,10 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {* * The fbdev is destroyed by drm_dev_unregister(). */ -void drm_fbdev_generic_setup (struct drm_device *dev, -unsigned int preferred_bpp) +void drm_fbdev_generic_setup (struct drm_device *dev,unsigned int options) {struct drm_fb_helper *fb_helper; +unsigned int preferred_bpp =DRM_FB_GET_OPTION (DRM_FB_BPP , options);int ret;drm_WARN (dev, !dev->registered,"Device has not been registered.\n" );
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
@@ -334,7 +334,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)if (ret <0 ) goto put; -drm_fbdev_generic_setup (drm, legacyfb_depth); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP , legacyfb_depth));return 0 ;
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +1 -1
@@ -237,7 +237,7 @@ static int kirin_drm_bind(struct device *dev)if (ret) goto err_kms_cleanup; -drm_fbdev_generic_setup (drm_dev,32 ); +drm_fbdev_generic_setup (drm_dev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/imx/dcss/dcss-kms.c +1 -1
@@ -148,7 +148,7 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)if (ret) goto cleanup_crtc; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return kms;
drivers/gpu/drm/imx/imx-drm-core.c +1 -1
@@ -251,7 +251,7 @@ static int imx_drm_bind(struct device *dev)if (ret) goto err_poll_fini; -drm_fbdev_generic_setup (drm, legacyfb_depth); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP , legacyfb_depth));return 0 ;
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +1 -1
@@ -1388,7 +1388,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) goto err_clk_notifier_unregister; } -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/mcde/mcde_drv.c +1 -1
@@ -238,7 +238,7 @@ static int mcde_drm_bind(struct device *dev)if (ret <0 ) goto unbind; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/mediatek/mtk_drm_drv.c +1 -1
@@ -393,7 +393,7 @@ static int mtk_drm_bind(struct device *dev)if (ret <0 ) goto err_deinit; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/meson/meson_drv.c +1 -1
@@ -350,7 +350,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)if (ret) goto uninstall_irq; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/mxsfb/mxsfb_drv.c +1 -1
@@ -357,7 +357,7 @@ static int mxsfb_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/pl111/pl111_drv.c +1 -1
@@ -308,7 +308,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,if (ret <0 ) goto dev_put; -drm_fbdev_generic_setup (drm, priv->variant->fb_bpp); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP , priv->variant->fb_bpp));return 0 ;
drivers/gpu/drm/qxl/qxl_drv.c +1 -1
@@ -122,7 +122,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto modeset_cleanup; -drm_fbdev_generic_setup (&qdev->ddev,32 ); +drm_fbdev_generic_setup (&qdev->ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; modeset_cleanup:
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1 -1
@@ -681,7 +681,7 @@ static int rcar_du_probe(struct platform_device *pdev)DRM_INFO ("Device %s probed\n" ,dev_name (&pdev->dev)); -drm_fbdev_generic_setup (&rcdu->ddev,32 ); +drm_fbdev_generic_setup (&rcdu->ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/sti/sti_drv.c +1 -1
@@ -200,7 +200,7 @@ static int sti_bind(struct device *dev)drm_mode_config_reset (ddev); -drm_fbdev_generic_setup (ddev,32 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/stm/drv.c +1 -1
@@ -203,7 +203,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)if (ret) goto err_put; -drm_fbdev_generic_setup (ddev,16 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -1
@@ -112,7 +112,7 @@ static int sun4i_drv_bind(struct device *dev)if (ret) goto finish_poll; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/tidss/tidss_drv.c +1 -1
@@ -180,7 +180,7 @@ static int tidss_probe(struct platform_device *pdev) goto err_irq_uninstall; } -drm_fbdev_generic_setup (ddev,32 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));dev_dbg (dev,"%s done\n" , __func__);
drivers/gpu/drm/tilcdc/tilcdc_drv.c +1 -1
@@ -384,7 +384,7 @@ static int tilcdc_init(const struct drm_driver *ddrv, struct device *dev) goto init_failed; priv->is_registered = true; -drm_fbdev_generic_setup (ddev, bpp); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP , bpp));return 0 ; init_failed:
drivers/gpu/drm/tiny/arcpgu.c +1 -1
@@ -392,7 +392,7 @@ static int arcpgu_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (&arcpgu->drm,16 ); +drm_fbdev_generic_setup (&arcpgu->drm,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;
drivers/gpu/drm/tiny/bochs.c +1 -1
@@ -663,7 +663,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *entif (ret) goto err_free_dev; -drm_fbdev_generic_setup (dev,32 ); +drm_fbdev_generic_setup (dev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return ret; err_free_dev:
drivers/gpu/drm/tve200/tve200_drv.c +1 -1
@@ -226,7 +226,7 @@ static int tve200_probe(struct platform_device *pdev)* Passing in 16 here will make the RGB565 mode the default * Passing in 32 will use XRGB8888 mode */ -drm_fbdev_generic_setup (drm,16 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
@@ -79,7 +79,7 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto err_irq_fini; -drm_fbdev_generic_setup (&vbox->ddev,32 ); +drm_fbdev_generic_setup (&vbox->ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;
drivers/gpu/drm/vc4/vc4_drv.c +1 -1
@@ -291,7 +291,7 @@ static int vc4_drm_bind(struct device *dev)if (ret <0 ) goto unbind_all; -drm_fbdev_generic_setup (drm,16 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;
drivers/gpu/drm/virtio/virtgpu_drv.c +1 -1
@@ -128,7 +128,7 @@ static int virtio_gpu_probe(struct virtio_device *vdev)if (ret) goto err_deinit; -drm_fbdev_generic_setup (vdev->priv,32 ); +drm_fbdev_generic_setup (vdev->priv,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; err_deinit:
drivers/gpu/drm/xlnx/zynqmp_dpsub.c +1 -1
@@ -135,7 +135,7 @@ static int zynqmp_dpsub_drm_init(struct zynqmp_dpsub *dpsub) goto err_poll_fini;/* Initialize fbdev generic emulation. */ -drm_fbdev_generic_setup (drm,24 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,24 ));return 0 ;
include/drm/drm_fb_helper.h +12 -0
@@ -35,6 +35,7 @@ struct drm_fb_helper;#include <drm/drm_client.h> #include <drm/drm_crtc.h> #include <drm/drm_device.h> +#include <linux/bitfield.h> #include <linux/kgdb.h> enum mode_set_atomic {
@@ -42,6 +43,17 @@ enum mode_set_atomic { ENTER_ATOMIC_MODE_SET, }; +#define DRM_FB_BPP_MASK GENMASK(7, 0) + +/* Using the GNU statement expression extension */ +#define DRM_FB_OPTION (option, value) \ + ({ \ + WARN_ON(!FIELD_FIT(option##_MASK, value)); \ + FIELD_PREP(option##_MASK, value); \ + }) + +#define DRM_FB_GET_OPTION (option, word) FIELD_GET(option##_MASK, word) +/** * struct drm_fb_helper_surface_size - describes fbdev size and scanout surface size * @fb_width: fbdev width
Signature · 1 line
2.35.1
Laurent Pinchart
maintainerRe: [PATCH v2 2/3] drm/fb-helper: Rename preferred_bpp drm_fbdev_generic_setup() parameter
Hi Javier,
Thank you for the patch.
Quoted 12 lines · Javier Martinez Canillas
By default the bits per pixel for the emulated framebuffer device is set to
dev->mode_config.preferred_depth, but some devices need another value.Since this second parameter is only used by a few drivers, and to allow drivers to use it for passing other configurations when registering the fbdev, rename @preferred_bpp to @options and make it a multi-field param.
The
DRM_FB_OPTION()andDRM_FB_GET_OPTION()macros are provided to drivers for computing options bitfield values and getting the values respectivelyFor now, only the
DRM_FB_BPPoption exists but other options can be added.
Quoted 8 lines
Suggested-by Thomas Zimmermann <[email protected]>Signed-off-by Javier Martinez Canillas <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>---
Changes in v2:
- RenameDRM_FB_SET_OPTION()toDRM_FB_SET()and make more clear in the
I assume you meant DRM_FB_OPTION() here, not DRM_FB_SET().
Quoted 517 lines
kernel-doc what this macro does (Laurent Pinchart).
- Fix some kernel-doc issues I didn't notice in v1.
- Add Reviewed-by tags from Thomas and Laurent.drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 ++++-- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/arm/malidp_drv.c | 2 +- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 2 +- drivers/gpu/drm/ast/ast_drv.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +- drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 17 +++++++++++++---- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 +- drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 +- drivers/gpu/drm/imx/imx-drm-core.c | 2 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +- drivers/gpu/drm/mcde/mcde_drv.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 +- drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 +- drivers/gpu/drm/pl111/pl111_drv.c | 2 +- drivers/gpu/drm/qxl/qxl_drv.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- drivers/gpu/drm/sti/sti_drv.c | 2 +- drivers/gpu/drm/stm/drv.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/tiny/bochs.c | 2 +- drivers/gpu/drm/tve200/tve200_drv.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 +- include/drm/drm_fb_helper.h | 12 ++++++++++++ 33 files changed, 59 insertions(+), 36 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4
-2@@ -2118,9 +2118,11 @@ 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_generic_setup (adev_to_drm (adev),8 ); +drm_fbdev_generic_setup (adev_to_drm (adev), +DRM_FB_OPTION (DRM_FB_BPP ,8 ));else -drm_fbdev_generic_setup (adev_to_drm (adev),32 ); +drm_fbdev_generic_setup (adev_to_drm (adev), +DRM_FB_OPTION (DRM_FB_BPP ,32 )); } ret =amdgpu_debugfs_init (adev);drivers/gpu/drm/arm/hdlcd_drv.c +1
-1@@ -321,7 +321,7 @@ static int hdlcd_drm_bind(struct device *dev)if (ret) goto err_register; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/arm/malidp_drv.c +1
-1@@ -863,7 +863,7 @@ static int malidp_bind(struct device *dev)if (ret) goto register_fail; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1
-1@@ -343,7 +343,7 @@ static int aspeed_gfx_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (&priv->drm,32 ); +drm_fbdev_generic_setup (&priv->drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; err_unload:drivers/gpu/drm/ast/ast_drv.c +1
-1@@ -126,7 +126,7 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret)return ret; -drm_fbdev_generic_setup (dev,32 ); +drm_fbdev_generic_setup (dev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; }drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1
-1@@ -760,7 +760,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (ddev,24 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,24 ));return 0 ;drivers/gpu/drm/drm_drv.c +1
-1@@ -324,7 +324,7 @@ void drm_minor_release(struct drm_minor *minor)* if (ret) * return ret; * -* drm_fbdev_generic_setup(drm, 32); +* drm_fbdev_generic_setup(drm, DRM_FB_OPTION(DRM_FB_BPP, 32)); * * return 0; * } drivers/gpu/drm/drm_fb_helper.c +13
-4@@ -2501,8 +2501,17 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {/** * drm_fbdev_generic_setup() - Setup generic fbdev emulation * @dev: DRM device -* @preferred_bpp: Preferred bits per pixel for the device. -* @dev->mode_config.preferred_depth is used if this is zero. +* @options: options for the registered framebuffer. +* +* The @options parameter is a multi-field parameter that can contain +* different options for the emulated framebuffer device registered. +* +* The options field values can be set using DRM_FB_OPTION() to compute +* the value according to the option bitfield and can be obtained using +* DRM_FB_GET_OPTION(). The options fields are the following: +* +* * DRM_FB_BPP: bits per pixel for the device. If the field is not set, +* @dev->mode_config.preferred_depth is used instead. * * This function sets up generic fbdev emulation for drivers that supports * dumb buffers with a virtual address and that can be mmap'ed. @@ -2525,10 +2534,10 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {* * The fbdev is destroyed by drm_dev_unregister(). */ -void drm_fbdev_generic_setup (struct drm_device *dev, -unsigned int preferred_bpp) +void drm_fbdev_generic_setup (struct drm_device *dev,unsigned int options) {struct drm_fb_helper *fb_helper; +unsigned int preferred_bpp =DRM_FB_GET_OPTION (DRM_FB_BPP , options);int ret;drm_WARN (dev, !dev->registered,"Device has not been registered.\n" );drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1
-1@@ -334,7 +334,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)if (ret <0 ) goto put; -drm_fbdev_generic_setup (drm, legacyfb_depth); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP , legacyfb_depth));return 0 ;drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +1
-1@@ -237,7 +237,7 @@ static int kirin_drm_bind(struct device *dev)if (ret) goto err_kms_cleanup; -drm_fbdev_generic_setup (drm_dev,32 ); +drm_fbdev_generic_setup (drm_dev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/imx/dcss/dcss-kms.c +1
-1@@ -148,7 +148,7 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)if (ret) goto cleanup_crtc; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return kms;drivers/gpu/drm/imx/imx-drm-core.c +1
-1@@ -251,7 +251,7 @@ static int imx_drm_bind(struct device *dev)if (ret) goto err_poll_fini; -drm_fbdev_generic_setup (drm, legacyfb_depth); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP , legacyfb_depth));return 0 ;drivers/gpu/drm/ingenic/ingenic-drm-drv.c +1
-1@@ -1388,7 +1388,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) goto err_clk_notifier_unregister; } -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/mcde/mcde_drv.c +1
-1@@ -238,7 +238,7 @@ static int mcde_drm_bind(struct device *dev)if (ret <0 ) goto unbind; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/mediatek/mtk_drm_drv.c +1
-1@@ -393,7 +393,7 @@ static int mtk_drm_bind(struct device *dev)if (ret <0 ) goto err_deinit; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/meson/meson_drv.c +1
-1@@ -350,7 +350,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)if (ret) goto uninstall_irq; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/mxsfb/mxsfb_drv.c +1
-1@@ -357,7 +357,7 @@ static int mxsfb_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/pl111/pl111_drv.c +1
-1@@ -308,7 +308,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,if (ret <0 ) goto dev_put; -drm_fbdev_generic_setup (drm, priv->variant->fb_bpp); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP , priv->variant->fb_bpp));return 0 ;drivers/gpu/drm/qxl/qxl_drv.c +1
-1@@ -122,7 +122,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto modeset_cleanup; -drm_fbdev_generic_setup (&qdev->ddev,32 ); +drm_fbdev_generic_setup (&qdev->ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; modeset_cleanup:drivers/gpu/drm/rcar-du/rcar_du_drv.c +1
-1@@ -681,7 +681,7 @@ static int rcar_du_probe(struct platform_device *pdev)DRM_INFO ("Device %s probed\n" ,dev_name (&pdev->dev)); -drm_fbdev_generic_setup (&rcdu->ddev,32 ); +drm_fbdev_generic_setup (&rcdu->ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/sti/sti_drv.c +1
-1@@ -200,7 +200,7 @@ static int sti_bind(struct device *dev)drm_mode_config_reset (ddev); -drm_fbdev_generic_setup (ddev,32 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/stm/drv.c +1
-1@@ -203,7 +203,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)if (ret) goto err_put; -drm_fbdev_generic_setup (ddev,16 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;drivers/gpu/drm/sun4i/sun4i_drv.c +1
-1@@ -112,7 +112,7 @@ static int sun4i_drv_bind(struct device *dev)if (ret) goto finish_poll; -drm_fbdev_generic_setup (drm,32 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/tidss/tidss_drv.c +1
-1@@ -180,7 +180,7 @@ static int tidss_probe(struct platform_device *pdev) goto err_irq_uninstall; } -drm_fbdev_generic_setup (ddev,32 ); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));dev_dbg (dev,"%s done\n" , __func__);drivers/gpu/drm/tilcdc/tilcdc_drv.c +1
-1@@ -384,7 +384,7 @@ static int tilcdc_init(const struct drm_driver *ddrv, struct device *dev) goto init_failed; priv->is_registered = true; -drm_fbdev_generic_setup (ddev, bpp); +drm_fbdev_generic_setup (ddev,DRM_FB_OPTION (DRM_FB_BPP , bpp));return 0 ; init_failed:drivers/gpu/drm/tiny/arcpgu.c +1
-1@@ -392,7 +392,7 @@ static int arcpgu_probe(struct platform_device *pdev)if (ret) goto err_unload; -drm_fbdev_generic_setup (&arcpgu->drm,16 ); +drm_fbdev_generic_setup (&arcpgu->drm,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;drivers/gpu/drm/tiny/bochs.c +1
-1@@ -663,7 +663,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *entif (ret) goto err_free_dev; -drm_fbdev_generic_setup (dev,32 ); +drm_fbdev_generic_setup (dev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return ret; err_free_dev:drivers/gpu/drm/tve200/tve200_drv.c +1
-1@@ -226,7 +226,7 @@ static int tve200_probe(struct platform_device *pdev)* Passing in 16 here will make the RGB565 mode the default * Passing in 32 will use XRGB8888 mode */ -drm_fbdev_generic_setup (drm,16 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;drivers/gpu/drm/vboxvideo/vbox_drv.c +1
-1@@ -79,7 +79,7 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (ret) goto err_irq_fini; -drm_fbdev_generic_setup (&vbox->ddev,32 ); +drm_fbdev_generic_setup (&vbox->ddev,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ;drivers/gpu/drm/vc4/vc4_drv.c +1
-1@@ -291,7 +291,7 @@ static int vc4_drm_bind(struct device *dev)if (ret <0 ) goto unbind_all; -drm_fbdev_generic_setup (drm,16 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,16 ));return 0 ;drivers/gpu/drm/virtio/virtgpu_drv.c +1
-1@@ -128,7 +128,7 @@ static int virtio_gpu_probe(struct virtio_device *vdev)if (ret) goto err_deinit; -drm_fbdev_generic_setup (vdev->priv,32 ); +drm_fbdev_generic_setup (vdev->priv,DRM_FB_OPTION (DRM_FB_BPP ,32 ));return 0 ; err_deinit:drivers/gpu/drm/xlnx/zynqmp_dpsub.c +1
-1@@ -135,7 +135,7 @@ static int zynqmp_dpsub_drm_init(struct zynqmp_dpsub *dpsub) goto err_poll_fini;/* Initialize fbdev generic emulation. */ -drm_fbdev_generic_setup (drm,24 ); +drm_fbdev_generic_setup (drm,DRM_FB_OPTION (DRM_FB_BPP ,24 ));return 0 ;include/drm/drm_fb_helper.h +12
-0@@ -35,6 +35,7 @@ struct drm_fb_helper;#include <drm/drm_client.h> #include <drm/drm_crtc.h> #include <drm/drm_device.h> +#include <linux/bitfield.h> #include <linux/kgdb.h> enum mode_set_atomic {@@ -42,6 +43,17 @@ enum mode_set_atomic { ENTER_ATOMIC_MODE_SET, }; +#define DRM_FB_BPP_MASK GENMASK(7, 0) + +/* Using the GNU statement expression extension */ +#define DRM_FB_OPTION (option, value) \ + ({ \ + WARN_ON(!FIELD_FIT(option##_MASK, value)); \ + FIELD_PREP(option##_MASK, value); \ + }) + +#define DRM_FB_GET_OPTION (option, word) FIELD_GET(option##_MASK, word) +/** * struct drm_fb_helper_surface_size - describes fbdev size and scanout surface size * @fb_width: fbdev width Signature · 1 line
2.35.1
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH v2 2/3] drm/fb-helper: Rename preferred_bpp drm_fbdev_generic_setup() parameter
Quoted 23 lines · Laurent Pinchart
Hi Javier,
Thank you for the patch.
Quoted 18 lines · Javier Martinez Canillas
By default the bits per pixel for the emulated framebuffer device is set to
dev->mode_config.preferred_depth, but some devices need another value.Since this second parameter is only used by a few drivers, and to allow drivers to use it for passing other configurations when registering the fbdev, rename @preferred_bpp to @options and make it a multi-field param.
The
DRM_FB_OPTION()andDRM_FB_GET_OPTION()macros are provided to drivers for computing options bitfield values and getting the values respectivelyFor now, only the
DRM_FB_BPPoption exists but other options can be added.Suggested-by Thomas Zimmermann <[email protected]>Signed-off-by Javier Martinez Canillas <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>---
Quoted 7 lines
Quoted 2 lines
Changes in v2:
- RenameDRM_FB_SET_OPTION()toDRM_FB_SET()and make more clear in theI assume you meant
DRM_FB_OPTION()here, notDRM_FB_SET().Quoted 2 lines
kernel-doc what this macro does (Laurent Pinchart).
Right, that's a typo. The patch description and content are correct though.
I'll fix the patch history log in v3.
Signature · 5 lines
Best regards, Javier Martinez Canillas Linux Engineering Red Hat
PATCH v2 3/3 drm: Allow simpledrm to setup its emulated FB as firmware provided
In reply to Javier Martinez CanillasIndicate to fbdev subsystem that the registered framebuffer is provided by the system firmware, so that it can handle accordingly. For example, would unregister the FB devices if asked to remove the conflicting framebuffers.
Add a new DRM_FB_FW field to drm_fbdev_generic_setup() options parameter. Drivers can use this to indicate the FB helper initialization that the FB registered is provided by the firmware, so it can be configured as such.
---
(no changes since v1)
drivers/gpu/drm/drm_fb_helper.c | 9 +++++++++ drivers/gpu/drm/tiny/simpledrm.c | 2 +- include/drm/drm_fb_helper.h | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_fb_helper.c +9 -0
@@ -1891,6 +1891,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,/* don't leak any physical addresses to userspace */ info->flags |=FBINFO_HIDE_SMEM_START ; +/* Indicate that the framebuffer is provided by the firmware */ +if (fb_helper->firmware) + info->flags |=FBINFO_MISC_FIRMWARE ; +/* Need to drop locks to avoid recursive deadlock in * register_framebuffer. This is ok because the only thing left to do is * register the fbdev emulation instance in kernel_fb_helper_list. */
@@ -2512,6 +2516,8 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {* * * DRM_FB_BPP: bits per pixel for the device. If the field is not set, * @dev->mode_config.preferred_depth is used instead. +* * DRM_FB_FW: if the framebuffer for the device is provided by the +* system firmware. * * This function sets up generic fbdev emulation for drivers that supports * dumb buffers with a virtual address and that can be mmap'ed.
@@ -2538,6 +2544,7 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) {struct drm_fb_helper *fb_helper;unsigned int preferred_bpp =DRM_FB_GET_OPTION (DRM_FB_BPP , options); +bool firmware =DRM_FB_GET_OPTION (DRM_FB_FW , options);int ret;drm_WARN (dev, !dev->registered,"Device has not been registered.\n" );
@@ -2570,6 +2577,8 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) preferred_bpp =32 ; fb_helper->preferred_bpp = preferred_bpp; + fb_helper->firmware = firmware; + ret =drm_fbdev_client_hotplug (&fb_helper->client);if (ret)drm_dbg_kms (dev,"client hotplug ret=%d\n" , ret);
drivers/gpu/drm/tiny/simpledrm.c +1 -1
@@ -901,7 +901,7 @@ static int simpledrm_probe(struct platform_device *pdev)if (ret)return ret; -drm_fbdev_generic_setup (dev,0 ); +drm_fbdev_generic_setup (dev,DRM_FB_SET_OPTION (DRM_FB_FW ,1 ));return 0 ; }
include/drm/drm_fb_helper.h +10 -0
@@ -44,6 +44,7 @@ enum mode_set_atomic { };#define DRM_FB_BPP_MASK GENMASK(7, 0) +#define DRM_FB_FW_MASK GENMASK(8, 8)/* Using the GNU statement expression extension */ #define DRM_FB_OPTION (option, value) \
@@ -197,6 +198,15 @@ struct drm_fb_helper {* See also: @deferred_setup */ int preferred_bpp; + +/** +* @firmware: +* +* Set if the driver indicates to the FB helper initialization that the +* framebuffer for the device being registered is provided by firmware, +* so that it can pass this on when registering the framebuffer device. +*/ +bool firmware; }; static inline struct drm_fb_helper *
Signature · 1 line
2.35.1
Hi Javier,
Thank you for the patch.
Quoted 53 lines · Javier Martinez Canillas
Indicate to fbdev subsystem that the registered framebuffer is provided by the system firmware, so that it can handle accordingly. For example, would unregister the FB devices if asked to remove the conflicting framebuffers.
Add a new
DRM_FB_FWfield todrm_fbdev_generic_setup()options parameter. Drivers can use this to indicate the FB helper initialization that the FB registered is provided by the firmware, so it can be configured as such.Suggested-by Thomas Zimmermann <[email protected]>Signed-off-by Javier Martinez Canillas <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>---
(no changes since v1)
drivers/gpu/drm/drm_fb_helper.c | 9 +++++++++ drivers/gpu/drm/tiny/simpledrm.c | 2 +- include/drm/drm_fb_helper.h | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_fb_helper.c +7
-0@@ -1891,6 +1891,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,/* don't leak any physical addresses to userspace */ info->flags |=FBINFO_HIDE_SMEM_START ; +/* Indicate that the framebuffer is provided by the firmware */ +if (fb_helper->firmware) + info->flags |=FBINFO_MISC_FIRMWARE ; +/* Need to drop locks to avoid recursive deadlock in * register_framebuffer. This is ok because the only thing left to do is * register the fbdev emulation instance in kernel_fb_helper_list. */ @@ -2512,6 +2516,8 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {* * * DRM_FB_BPP: bits per pixel for the device. If the field is not set, * @dev->mode_config.preferred_depth is used instead. +* * DRM_FB_FW: if the framebuffer for the device is provided by the +* system firmware. * * This function sets up generic fbdev emulation for drivers that supports * dumb buffers with a virtual address and that can be mmap'ed. @@ -2538,6 +2544,7 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) {struct drm_fb_helper *fb_helper;unsigned int preferred_bpp =DRM_FB_GET_OPTION (DRM_FB_BPP , options); +bool firmware =DRM_FB_GET_OPTION (DRM_FB_FW , options);int ret;drm_WARN (dev, !dev->registered,"Device has not been registered.\n" );
drivers/gpu/drm/drm_fb_helper.c void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) · line 2580
Quoted 4 lines
drivers/gpu/drm/drm_fb_helper.c +1
-0@@ -2570,6 +2577,8 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) preferred_bpp =32 ; fb_helper->preferred_bpp = preferred_bpp; + fb_helper->firmware = firmware;
I'd get rid of the local variable and write
fb_helper->firmware = DRM_FB_GET_OPTION(DRM_FB_FW, options);
Quoted 45 lines
drivers/gpu/drm/drm_fb_helper.c +1
-0+ ret =drm_fbdev_client_hotplug (&fb_helper->client);if (ret)drm_dbg_kms (dev,"client hotplug ret=%d\n" , ret);drivers/gpu/drm/tiny/simpledrm.c +1
-1@@ -901,7 +901,7 @@ static int simpledrm_probe(struct platform_device *pdev)if (ret)return ret; -drm_fbdev_generic_setup (dev,0 ); +drm_fbdev_generic_setup (dev,DRM_FB_SET_OPTION (DRM_FB_FW ,1 ));return 0 ; }include/drm/drm_fb_helper.h +10
-0@@ -44,6 +44,7 @@ enum mode_set_atomic { };#define DRM_FB_BPP_MASK GENMASK(7, 0) +#define DRM_FB_FW_MASK GENMASK(8, 8)/* Using the GNU statement expression extension */ #define DRM_FB_OPTION (option, value) \@@ -197,6 +198,15 @@ struct drm_fb_helper {* See also: @deferred_setup */ int preferred_bpp; + +/** +* @firmware: +* +* Set if the driver indicates to the FB helper initialization that the +* framebuffer for the device being registered is provided by firmware, +* so that it can pass this on when registering the framebuffer device. +*/ +bool firmware; }; static inline struct drm_fb_helper *
Signature · 3 lines
Regards, Laurent Pinchart
Hello Laurent,
Quoted 56 lines · Laurent Pinchart
Hi Javier,
Thank you for the patch.
Quoted 51 lines · Javier Martinez Canillas
Indicate to fbdev subsystem that the registered framebuffer is provided by the system firmware, so that it can handle accordingly. For example, would unregister the FB devices if asked to remove the conflicting framebuffers.
Add a new
DRM_FB_FWfield todrm_fbdev_generic_setup()options parameter. Drivers can use this to indicate the FB helper initialization that the FB registered is provided by the firmware, so it can be configured as such.Suggested-by Thomas Zimmermann <[email protected]>Signed-off-by Javier Martinez Canillas <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>---
(no changes since v1)
drivers/gpu/drm/drm_fb_helper.c | 9 +++++++++ drivers/gpu/drm/tiny/simpledrm.c | 2 +- include/drm/drm_fb_helper.h | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_fb_helper.c +7
-0@@ -1891,6 +1891,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,/* don't leak any physical addresses to userspace */ info->flags |=FBINFO_HIDE_SMEM_START ; +/* Indicate that the framebuffer is provided by the firmware */ +if (fb_helper->firmware) + info->flags |=FBINFO_MISC_FIRMWARE ; +/* Need to drop locks to avoid recursive deadlock in * register_framebuffer. This is ok because the only thing left to do is * register the fbdev emulation instance in kernel_fb_helper_list. */ @@ -2512,6 +2516,8 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {* * * DRM_FB_BPP: bits per pixel for the device. If the field is not set, * @dev->mode_config.preferred_depth is used instead. +* * DRM_FB_FW: if the framebuffer for the device is provided by the +* system firmware. * * This function sets up generic fbdev emulation for drivers that supports * dumb buffers with a virtual address and that can be mmap'ed. @@ -2538,6 +2544,7 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) {struct drm_fb_helper *fb_helper;unsigned int preferred_bpp =DRM_FB_GET_OPTION (DRM_FB_BPP , options); +bool firmware =DRM_FB_GET_OPTION (DRM_FB_FW , options);int ret;
Quoted 9 lines
drivers/gpu/drm/drm_fb_helper.c void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) · line 2580
Quoted 6 lines
drivers/gpu/drm/drm_fb_helper.c +1
-0drm_WARN (dev, !dev->registered,"Device has not been registered.\n" );@@ -2570,6 +2577,8 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) preferred_bpp =32 ; fb_helper->preferred_bpp = preferred_bpp; + fb_helper->firmware = firmware;I'd get rid of the local variable and write
I actually considered that but then decided to add a local variable to have both options set in the same place, since I thought that would be easier to read and also consistent with how preferred_bpp is handled.
Maybe I could go the other way around and rework patch 2/3 to also not require a preferred_bpp local variable ? That patch won't be as small as it's now though. --
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
Laurent Pinchart
maintainerHi Javier,
Quoted 63 lines · Javier Martinez Canillas
Quoted 52 lines · Laurent Pinchart
Quoted 51 lines · Javier Martinez Canillas
Indicate to fbdev subsystem that the registered framebuffer is provided by the system firmware, so that it can handle accordingly. For example, would unregister the FB devices if asked to remove the conflicting framebuffers.
Add a new
DRM_FB_FWfield todrm_fbdev_generic_setup()options parameter. Drivers can use this to indicate the FB helper initialization that the FB registered is provided by the firmware, so it can be configured as such.Suggested-by Thomas Zimmermann <[email protected]>Signed-off-by Javier Martinez Canillas <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>---
(no changes since v1)
drivers/gpu/drm/drm_fb_helper.c | 9 +++++++++ drivers/gpu/drm/tiny/simpledrm.c | 2 +- include/drm/drm_fb_helper.h | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_fb_helper.c +7
-0@@ -1891,6 +1891,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,/* don't leak any physical addresses to userspace */ info->flags |=FBINFO_HIDE_SMEM_START ; +/* Indicate that the framebuffer is provided by the firmware */ +if (fb_helper->firmware) + info->flags |=FBINFO_MISC_FIRMWARE ; +/* Need to drop locks to avoid recursive deadlock in * register_framebuffer. This is ok because the only thing left to do is * register the fbdev emulation instance in kernel_fb_helper_list. */ @@ -2512,6 +2516,8 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {* * * DRM_FB_BPP: bits per pixel for the device. If the field is not set, * @dev->mode_config.preferred_depth is used instead. +* * DRM_FB_FW: if the framebuffer for the device is provided by the +* system firmware. * * This function sets up generic fbdev emulation for drivers that supports * dumb buffers with a virtual address and that can be mmap'ed. @@ -2538,6 +2544,7 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) {struct drm_fb_helper *fb_helper;unsigned int preferred_bpp =DRM_FB_GET_OPTION (DRM_FB_BPP , options); +bool firmware =DRM_FB_GET_OPTION (DRM_FB_FW , options);int ret;Quoted 9 lines
drivers/gpu/drm/drm_fb_helper.c void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) · line 2580
Quoted 6 lines
drivers/gpu/drm/drm_fb_helper.c +1
-0drm_WARN (dev, !dev->registered,"Device has not been registered.\n" );@@ -2570,6 +2577,8 @@ void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) preferred_bpp =32 ; fb_helper->preferred_bpp = preferred_bpp; + fb_helper->firmware = firmware;I'd get rid of the local variable and write
Quoted 7 lines
I actually considered that but then decided to add a local variable to have both options set in the same place, since I thought that would be easier to read and also consistent with how
preferred_bppis handled.Maybe I could go the other way around and rework patch 2/3 to also not require a
preferred_bpplocal variable ? That patch won't be as small as it's now though. --
Up to you, or you could ignore the comment, it's minor. If you want to keep the variable, you could also make it const, it's a good practice to show it isn't intended to be modified.
Signature · 3 lines
Regards, Laurent Pinchart
Hello Laurent,
Quoted 1 line · Laurent Pinchart
Hi Javier,
[snip]
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
drivers/gpu/drm/drm_fb_helper.c void drm_fbdev_generic_setup(struct drm_device *dev, unsigned int options) · line 2580
Quoted 1 line
drivers/gpu/drm/drm_fb_helper.c +1
-0+ fb_helper->firmware = firmware;I'd get rid of the local variable and write
I actually considered that but then decided to add a local variable to have both options set in the same place, since I thought that would be easier to read and also consistent with how
preferred_bppis handled.
Quoted 8 lines
Quoted 3 lines
Maybe I could go the other way around and rework patch 2/3 to also not require a
preferred_bpplocal variable ? That patch won't be as small as it's now though. --Up to you, or you could ignore the comment, it's minor. If you want to keep the variable, you could also make it const, it's a good practice to show it isn't intended to be modified.
Right. I'll also do the same for the preferred_bpp variable in patch 2/3 if I choose to keep them in v3.
Thanks again for your feedback and comments!
Signature · 5 lines
Best regards, Javier Martinez Canillas Linux Engineering Red Hat
kernel test robot
build botI love your patch! Yet something to improve:
Hi Javier,
I love your patch! Yet something to improve:
[auto build test ERROR on drm/drm-next]
[also build test ERROR on shawnguo/for-next linus/master linux/master v5.18-rc5 next-20220502] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Javier-Martinez-Canillas/drm-Allow-simpledrm-to-setup-its-emulated-FB-as-firmware-provided/20220502-234145 base: git://anongit.freedesktop.org/drm/drm drm-next config: hexagon-randconfig-r045-20220501 (https://download.01.org/0day-ci/archive/20220503/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 09325d36061e42b495d1f4c7e933e260eac260ed)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/28ef46724e385165777a21d9f661188fa2577a1e
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Javier-Martinez-Canillas/drm-Allow-simpledrm-to-setup-its-emulated-FB-as-firmware-provided/20220502-234145 git checkout 28ef46724e385165777a21d9f661188fa2577a1e
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/gpu/drm/tiny/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/tiny/simpledrm.c:904:31: error: call to undeclared function 'DRM_FB_SET_OPTION'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
drm_fbdev_generic_setup(dev, DRM_FB_SET_OPTION(DRM_FB_FW, 1));
^
>> drivers/gpu/drm/tiny/simpledrm.c:904:49: error: use of undeclared identifier 'DRM_FB_FW'
drm_fbdev_generic_setup(dev, DRM_FB_SET_OPTION(DRM_FB_FW, 1));
^2 errors generated.
vim +/DRM_FB_SET_OPTION +904 drivers/gpu/drm/tiny/simpledrm.c
884
885 /*
886 * Platform driver
887 */
888
889 static int simpledrm_probe(struct platform_device *pdev)
890 {
891 struct simpledrm_device *sdev;
892 struct drm_device *dev;
893 int ret;
894
895 sdev = simpledrm_device_create(&simpledrm_driver, pdev);
896 if (IS_ERR(sdev))
897 return PTR_ERR(sdev);
898 dev = &sdev->dev;
899
900 ret = drm_dev_register(dev, 0);
901 if (ret)
902 return ret;
903
> 904 drm_fbdev_generic_setup(dev, DRM_FB_SET_OPTION(DRM_FB_FW, 1));
905
906 return 0;
907 }
908
Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
kernel test robot
build botI love your patch! Yet something to improve:
Hi Javier,
I love your patch! Yet something to improve:
[auto build test ERROR on drm/drm-next]
[also build test ERROR on shawnguo/for-next linus/master linux/master v5.18-rc5 next-20220502] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Javier-Martinez-Canillas/drm-Allow-simpledrm-to-setup-its-emulated-FB-as-firmware-provided/20220502-234145 base: git://anongit.freedesktop.org/drm/drm drm-next config: x86_64-randconfig-a011 (https://download.01.org/0day-ci/archive/20220503/[email protected]/config) compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/28ef46724e385165777a21d9f661188fa2577a1e git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Javier-Martinez-Canillas/drm-Allow-simpledrm-to-setup-its-emulated-FB-as-firmware-provided/20220502-234145 git checkout 28ef46724e385165777a21d9f661188fa2577a1e # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
drivers/gpu/drm/tiny/simpledrm.c: In function 'simpledrm_probe':
>> drivers/gpu/drm/tiny/simpledrm.c:904:38: error: implicit declaration of function 'DRM_FB_SET_OPTION'; did you mean 'DRM_FB_GET_OPTION'? [-Werror=implicit-function-declaration]
904 | drm_fbdev_generic_setup(dev, DRM_FB_SET_OPTION(DRM_FB_FW, 1));
| ^~~~~~~~~~~~~~~~~
| DRM_FB_GET_OPTION
>> drivers/gpu/drm/tiny/simpledrm.c:904:56: error: 'DRM_FB_FW' undeclared (first use in this function)
904 | drm_fbdev_generic_setup(dev, DRM_FB_SET_OPTION(DRM_FB_FW, 1));
| ^~~~~~~~~ drivers/gpu/drm/tiny/simpledrm.c:904:56: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
vim +904 drivers/gpu/drm/tiny/simpledrm.c
884
885 /*
886 * Platform driver
887 */
888
889 static int simpledrm_probe(struct platform_device *pdev)
890 {
891 struct simpledrm_device *sdev;
892 struct drm_device *dev;
893 int ret;
894
895 sdev = simpledrm_device_create(&simpledrm_driver, pdev);
896 if (IS_ERR(sdev))
897 return PTR_ERR(sdev);
898 dev = &sdev->dev;
899
900 ret = drm_dev_register(dev, 0);
901 if (ret)
902 return ret;
903
> 904 drm_fbdev_generic_setup(dev, DRM_FB_SET_OPTION(DRM_FB_FW, 1));
905
906 return 0;
907 }
908
Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp