[PATCH v2] drm: log errors in drm_gem_fb_init_with_funcs

Rodrigo Siqueira Rodrigo.Siqueira at amd.com
Wed May 5 00:14:42 UTC 2021


On 05/03, Simon Ser wrote:
> On Monday, May 3rd, 2021 at 4:20 PM, Rodrigo Siqueira <Rodrigo.Siqueira at amd.com> wrote:
> 
> > > diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> > > index 109d11fb4cd4..aeb808a0ba54 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");
> >
> > Just for curiosity,
> > Why not say something like "FB format is not supported" by the driver?
> > I'm asking because the kernel-doc for drm_get_format_info says "NULL if
> > the format is unsupported".
> 
> As Ville said, if things got this far and the format is unsupported, something
> must be going wrong. I'm not confident enough to switch this to a WARN_ON,
> though.

Hi Simon, thanks for your explanation.

Is it common to get "!info" equal true? If not, and imho, I think that
WARN_ON would be good to raise attention to a possible issue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210504/06405e02/attachment.sig>


More information about the dri-devel mailing list