dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <contact@emersion.fr>
Cc: "Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	dri-devel@lists.freedesktop.org,
	"Andrzej Pietrasiewicz" <andrzej.p@collabora.com>
Subject: Re: [PATCH] drm: log errors in drm_gem_fb_init_with_funcs
Date: Fri, 30 Apr 2021 18:28:15 +0300	[thread overview]
Message-ID: <YIwiD3KFC67fiSYB@intel.com> (raw)
In-Reply-To: <R359hIfrDhyN2VBgiSyQ1ogbifYmn7KwIuMUqS3u3A@cp4-web-032.plabs.ch>

On Fri, Apr 30, 2021 at 02:40:02PM +0000, Simon Ser wrote:
> Let the user know what went wrong in drm_gem_fb_init_with_funcs
> failure paths.
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> ---
>  drivers/gpu/drm/drm_gem_framebuffer_helper.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> index 109d11fb4cd4..e4a3c7eb43b2 100644
> --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> @@ -155,8 +155,10 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev,
>  	int ret, i;
>  
>  	info = drm_get_format_info(dev, mode_cmd);
> -	if (!info)
> +	if (!info) {
> +		drm_dbg_kms(dev, "Failed to get FB format info\n");
>  		return -EINVAL;
> +	}

Assuming this thing gets plugged into .fb_create() getting
this far with a bogus format would be rather suprising.

>  
>  	for (i = 0; i < info->num_planes; i++) {
>  		unsigned int width = mode_cmd->width / (i ? info->hsub : 1);
> @@ -175,6 +177,9 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev,
>  			 + mode_cmd->offsets[i];
>  
>  		if (objs[i]->size < min_size) {
> +			drm_dbg_kms(dev,
> +				    "GEM object size (%u) smaller than minimum size (%u) for plane %d\n",
> +				    objs[i]->size, min_size, i);
>  			drm_gem_object_put(objs[i]);
>  			ret = -EINVAL;
>  			goto err_gem_object_put;
> -- 
> 2.31.1
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2021-04-30 15:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 14:40 [PATCH] drm: log errors in drm_gem_fb_init_with_funcs Simon Ser
2021-04-30 14:46 ` Michel Dänzer
2021-04-30 15:28 ` Ville Syrjälä [this message]
2021-04-30 17:59 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YIwiD3KFC67fiSYB@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=andrzej.p@collabora.com \
    --cc=contact@emersion.fr \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=noralf@tronnes.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).