[PATCH] drm/gem-framebuffer: log errors when gem size < afbc_size

Andy Yan posted 1 patch 9 months ago
drivers/gpu/drm/drm_gem_framebuffer_helper.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[PATCH] drm/gem-framebuffer: log errors when gem size < afbc_size
Posted by Andy Yan 9 months ago
Let the user know what went wrong in drm_gem_fb_afbc_init
failure paths.

Signed-off-by: Andy Yan <andyshrk@163.com>
---

 drivers/gpu/drm/drm_gem_framebuffer_helper.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
index 6f72e7a0f427..baf99a68bdb5 100644
--- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
+++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
@@ -607,8 +607,11 @@ int drm_gem_fb_afbc_init(struct drm_device *dev,
 	if (ret < 0)
 		return ret;
 
-	if (objs[0]->size < afbc_fb->afbc_size)
+	if (objs[0]->size < afbc_fb->afbc_size) {
+		drm_dbg_kms(dev, "GEM object size (%zu) smaller than minimum afbc size (%u)\n",
+			    objs[0]->size, afbc_fb->afbc_size);
 		return -EINVAL;
+	}
 
 	return 0;
 }
-- 
2.43.0
Re: [PATCH] drm/gem-framebuffer: log errors when gem size < afbc_size
Posted by Daniel Stone 9 months ago
Hi Andy,

On Thu, 8 May 2025 at 11:49, Andy Yan <andyshrk@163.com> wrote:
> Let the user know what went wrong in drm_gem_fb_afbc_init
> failure paths.

Thanks for this, and thanks also for using drm_dbg_kms() to make sure
that userspace can't flood the log with errors.

Reviewed-by: Daniel Stone <daniels@collabora.com>

Cheers,
Daniel
Re:Re: [PATCH] drm/gem-framebuffer: log errors when gem size < afbc_size
Posted by Andy Yan 8 months, 3 weeks ago
Hello,


At 2025-05-08 17:11:01, "Daniel Stone" <daniel@fooishbar.org> wrote:
>Hi Andy,
>
>On Thu, 8 May 2025 at 11:49, Andy Yan <andyshrk@163.com> wrote:
>> Let the user know what went wrong in drm_gem_fb_afbc_init
>> failure paths.
>
>Thanks for this, and thanks also for using drm_dbg_kms() to make sure
>that userspace can't flood the log with errors.
>
>Reviewed-by: Daniel Stone <daniels@collabora.com>


May I kindly ask which Maintainer can take this patch?

>
>Cheers,
>Daniel
Re: [PATCH] drm/gem-framebuffer: log errors when gem size < afbc_size
Posted by Thomas Zimmermann 8 months, 2 weeks ago
Hi

Am 22.05.25 um 09:54 schrieb Andy Yan:
> Hello,
>
>
> At 2025-05-08 17:11:01, "Daniel Stone" <daniel@fooishbar.org> wrote:
>> Hi Andy,
>>
>> On Thu, 8 May 2025 at 11:49, Andy Yan <andyshrk@163.com> wrote:
>>> Let the user know what went wrong in drm_gem_fb_afbc_init
>>> failure paths.
>> Thanks for this, and thanks also for using drm_dbg_kms() to make sure
>> that userspace can't flood the log with errors.
>>
>> Reviewed-by: Daniel Stone <daniels@collabora.com>
>
> May I kindly ask which Maintainer can take this patch?

Merged into drm-misc-next. Thanks for the patch.

Best regards
Thomas

>
>> Cheers,
>> Daniel

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)