[PATCH v3 2/3] drm/vc4: Remove conflicting framebuffers before callind bind_all

Thomas Zimmermann tzimmermann at suse.de
Mon Dec 13 01:47:08 PST 2021


Hi Maxime

Am 13.12.21 um 10:25 schrieb Maxime Ripard:
> The bind hooks will modify their controller registers, so simplefb is
> going to be unusable anyway. Let's avoid any transient state where it
> could still be in the system but no longer functionnal.
> 
> Acked-by: Nicolas Saenz Julienne <nsaenz at kernel.org>
> Signed-off-by: Maxime Ripard <maxime at cerno.tech>
> ---
>   drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
> index 16abc3a3d601..8ab89f805826 100644
> --- a/drivers/gpu/drm/vc4/vc4_drv.c
> +++ b/drivers/gpu/drm/vc4/vc4_drv.c
> @@ -251,6 +251,10 @@ static int vc4_drm_bind(struct device *dev)

Since you work on this, I'd like to suggest to call 
drm_firmware_drivers_only() at the very top of this function. It's our 
new interface for the kernel's nomodeset argument. If it returns false, 
the user has disabled native drivers for this boot. The generic DRM 
driver will continue to run the device.

>   	if (ret)
>   		return ret;
>   
> +	ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver);
> +	if (ret)
> +		return ret;
> +

There's quite a bit of work being done before calling this function. 
None of it is allowed to touch HW.

Is that reliable? If so, the code is fine, otherwise the call should go 
to the top of the function.

Best regards
Thomas

>   	ret = component_bind_all(dev, drm);
>   	if (ret)
>   		return ret;
> @@ -259,10 +263,6 @@ static int vc4_drm_bind(struct device *dev)
>   	if (ret)
>   		goto unbind_all;
>   
> -	ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver);
> -	if (ret)
> -		goto unbind_all;
> -
>   	ret = vc4_kms_load(drm);
>   	if (ret < 0)
>   		goto unbind_all;
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211213/f37bbf6d/attachment.sig>


More information about the linux-arm-kernel mailing list