diff mbox

[v4,2/3] drm/vc4: Don't try to initialize FBDEV if we're only bound to V3D.

Message ID 20170428224223.21904-2-eric@anholt.net (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Anholt April 28, 2017, 10:42 p.m. UTC
The FBDEV initialization would throw an error in dmesg, when we just
want to silently not initialize fbdev on a V3D-only VC4 instance.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/gpu/drm/vc4/vc4_kms.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Daniel Vetter May 2, 2017, 9:24 a.m. UTC | #1
On Fri, Apr 28, 2017 at 03:42:22PM -0700, Eric Anholt wrote:
> The FBDEV initialization would throw an error in dmesg, when we just
> want to silently not initialize fbdev on a V3D-only VC4 instance.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>

With the commit message updated that passing num_connector is the bug that
throws the error (and not that we set up a no-op fbdev):

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Still kinda hoping for a follow-up to entirely get rid fo num_connector in
the fbdev init funcs.
-Daniel
> ---
>  drivers/gpu/drm/vc4/vc4_kms.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
> index ad7925a9e0ea..237a504f11f0 100644
> --- a/drivers/gpu/drm/vc4/vc4_kms.c
> +++ b/drivers/gpu/drm/vc4/vc4_kms.c
> @@ -230,10 +230,12 @@ int vc4_kms_load(struct drm_device *dev)
>  
>  	drm_mode_config_reset(dev);
>  
> -	vc4->fbdev = drm_fbdev_cma_init(dev, 32,
> -					dev->mode_config.num_connector);
> -	if (IS_ERR(vc4->fbdev))
> -		vc4->fbdev = NULL;
> +	if (dev->mode_config.num_connector) {
> +		vc4->fbdev = drm_fbdev_cma_init(dev, 32,
> +						dev->mode_config.num_connector);
> +		if (IS_ERR(vc4->fbdev))
> +			vc4->fbdev = NULL;
> +	}
>  
>  	drm_kms_helper_poll_init(dev);
>  
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Eric Anholt May 3, 2017, 7:06 p.m. UTC | #2
Daniel Vetter <daniel@ffwll.ch> writes:

> On Fri, Apr 28, 2017 at 03:42:22PM -0700, Eric Anholt wrote:
>> The FBDEV initialization would throw an error in dmesg, when we just
>> want to silently not initialize fbdev on a V3D-only VC4 instance.
>> 
>> Signed-off-by: Eric Anholt <eric@anholt.net>
>
> With the commit message updated that passing num_connector is the bug that
> throws the error (and not that we set up a no-op fbdev):
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Still kinda hoping for a follow-up to entirely get rid fo num_connector in
> the fbdev init funcs.

New commit message:

    drm/vc4: Don't try to initialize FBDEV if we're only bound to V3D.
    
    There's no sense in having an fbdev if there's no display, since
    connectors don't get hotplugged to this hardware.  On Cygnus we were
    getting a dmesg error from passing in num_connectors (0), when that
    argument is supposed to be the maximum number of cloned connectors per
    CRTC (1).

Still no drm-misc acks on the other two patches, so I don't think I can
merge them.
diff mbox

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index ad7925a9e0ea..237a504f11f0 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -230,10 +230,12 @@  int vc4_kms_load(struct drm_device *dev)
 
 	drm_mode_config_reset(dev);
 
-	vc4->fbdev = drm_fbdev_cma_init(dev, 32,
-					dev->mode_config.num_connector);
-	if (IS_ERR(vc4->fbdev))
-		vc4->fbdev = NULL;
+	if (dev->mode_config.num_connector) {
+		vc4->fbdev = drm_fbdev_cma_init(dev, 32,
+						dev->mode_config.num_connector);
+		if (IS_ERR(vc4->fbdev))
+			vc4->fbdev = NULL;
+	}
 
 	drm_kms_helper_poll_init(dev);