From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jani Nikula <jani.nikula@linux.intel.com>,
"Saarinen, Jani" <jani.saarinen@intel.com>,
"rajat.gupta@oss.qualcomm.com" <rajat.gupta@oss.qualcomm.com>,
"simona@ffwll.ch" <simona@ffwll.ch>,
"airlied@gmail.com" <airlied@gmail.com>,
"mripard@kernel.org" <mripard@kernel.org>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Syrjala, Ville" <ville.syrjala@intel.com>
Subject: Re: [PATCH] drm/dumb-buffers: Increase size limits to match current devices
Date: Tue, 2 Jun 2026 13:23:13 +0200 [thread overview]
Message-ID: <bec1d275-8c6e-48d9-8611-137dfaf52acf@suse.de> (raw)
In-Reply-To: <577c2e6c08b96844a5144bee0d5a0536b4ab939e@intel.com>
Hi
Am 02.06.26 um 12:53 schrieb Jani Nikula:
> On Tue, 02 Jun 2026, "Saarinen, Jani" <jani.saarinen@intel.com> wrote:
>> Hi,
>>> -----Original Message-----
>>> From: Thomas Zimmermann <tzimmermann@suse.de>
>>> Sent: Tuesday, 2 June 2026 10.30
>>> To: rajat.gupta@oss.qualcomm.com; jani.nikula@linux.intel.com; Saarinen,
>>> Jani <jani.saarinen@intel.com>; simona@ffwll.ch; airlied@gmail.com;
>>> mripard@kernel.org; maarten.lankhorst@linux.intel.com
>>> Cc: dri-devel@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; intel-
>>> xe@lists.freedesktop.org; Thomas Zimmermann <tzimmermann@suse.de>
>>> Subject: [PATCH] drm/dumb-buffers: Increase size limits to match current
>>> devices
>>>
>>> Increase the limits for dumb-buffer arguments to sizes of 16384x16384 at 64
>>> bpp. Such buffer sizes are still within 32-bit unsigned limits.
>>> Fixes CI and high-end devices.
>>>
>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> Fixes: 5ab62dd3687b ("drm: prevent integer overflows in dumb buffer
>>> creation helpers")
>>> Reported-by: Jani Nikula <jani.nikula@linux.intel.com>
>>> Closes: https://lore.kernel.org/dri-
>>> devel/ddf0233e50044059c85279f928661563ef6a55bf@intel.com/
>> Seems not helping on i915 CI BAT issue https://lore.kernel.org/intel-gfx/178038951063.34290.3796875109342598028@6beec6c84f66/T/#u
>> => https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_167719v1/index.html?
> Right, so vgem_basic has this, among other things:
>
> bo.width = 1<<15;
> bo.height = 1<<15;
> bo.bpp = 16;
> vgem_create(fd, &bo);
>
> i.e. 32768x32768.
>
> Not so sure about this one.
>
> Anyone else care to chime in?
I give up. I'll send out a patch to remove the size limits in a bit. The
rest of the overflow fixes in the broken patch should not be a problem,
I think.
But TBH allocating a dumb buffer of that size makes no sense. Who uses a
2-GiB buffer for software rendering?
And as I mentioned elsewhere, there are reports about devices with GiBs
of VRAM but only a few hundered MiB of PCI-BAR ranges. As we don't have
DMA here, there will be some size limits required to make mmap work
correctly.
Best regards
Thomas
>
>
> BR,
> Jani.
>
>>> Cc: Rajat Gupta <rajat.gupta@oss.qualcomm.com>
>>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>> Cc: Maxime Ripard <mripard@kernel.org>
>> Br,
>> Jani
>>
>>> ---
>>> drivers/gpu/drm/drm_dumb_buffers.c | 9 +++++----
>>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_dumb_buffers.c
>>> b/drivers/gpu/drm/drm_dumb_buffers.c
>>> index e60130b2bb0c..9c4cfb3210aa 100644
>>> --- a/drivers/gpu/drm/drm_dumb_buffers.c
>>> +++ b/drivers/gpu/drm/drm_dumb_buffers.c
>>> @@ -201,11 +201,12 @@ int drm_mode_create_dumb(struct drm_device
>>> *dev,
>>> if (!args->width || !args->height || !args->bpp)
>>> return -EINVAL;
>>>
>>> - /* Reject unreasonable inputs early. Dumb buffers are for software
>>> - * rendering; nothing legitimate needs more than 8192x8192 at
>>> 32bpp.
>>> - * This prevents overflows in downstream alignment helpers.
>>> + /*
>>> + * Reject unreasonable inputs early. Dumb buffers are for software
>>> + * rendering; nothing legitimate needs more than 16384x16384 at
>>> + * 64 bpp. This prevents overflows in downstream alignment helpers.
>>> */
>>> - if (args->width >= 8192 || args->height >= 8192 || args->bpp > 32)
>>> + if (args->width > 16384 || args->height > 16384 || args->bpp > 64)
>>> return -EINVAL;
>>>
>>> /* overflow checks for 32bit size calculations */
>>>
>>> base-commit: a980196655477a8f5067112946401fe52e510664
>>> --
>>> 2.54.0
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2026-06-02 11:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 7:30 [PATCH] drm/dumb-buffers: Increase size limits to match current devices Thomas Zimmermann
2026-06-02 10:37 ` Saarinen, Jani
2026-06-02 10:53 ` Jani Nikula
2026-06-02 11:23 ` Thomas Zimmermann [this message]
2026-06-04 3:08 ` Claude review: " Claude Code Review Bot
2026-06-04 3:08 ` Claude Code Review Bot
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=bec1d275-8c6e-48d9-8611-137dfaf52acf@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jani.saarinen@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=rajat.gupta@oss.qualcomm.com \
--cc=simona@ffwll.ch \
--cc=ville.syrjala@intel.com \
/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