[PATCH] drm/amd: print error on convert_tiling_flags_to_modifier failure
Michel Dänzer
michel at daenzer.net
Fri Dec 4 11:52:03 UTC 2020
On 2020-12-03 9:15 p.m., Simon Ser wrote:
> If this function fails, it means the tiling flags didn't make sense.
> This likely indicates a user-space bug. Log the error alongside with the
> provided tiling flags to make debugging easier.
>
> Signed-off-by: Simon Ser <contact at emersion.fr>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Harry Wentland <hwentlan at amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
> Cc: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index 2ef9734eb119..467ff1655341 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -901,8 +901,11 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev,
> if (dev->mode_config.allow_fb_modifiers &&
> !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) {
> ret = convert_tiling_flags_to_modifier(rfb);
> - if (ret)
> + if (ret) {
> + dev_err(&dev->pdev->dev, "Failed to convert tiling flags 0x%llX to a modifier",
> + rfb->tiling_flags);
> goto fail;
> + }
> }
>
> for (i = 1; i < rfb->base.format->num_planes; ++i) {
>
This should be either a debugging message disabled by default, or
rate-limited somehow, or user-space can spam dmesg.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and X developer
More information about the amd-gfx
mailing list