* [PATCH 0/3] revert the 8-byte pitch-alignment constraint for memory managers
@ 2025-11-26 14:44 Ludovic Desroches
2025-11-26 14:44 ` [PATCH 1/3] drm/gem-dma: revert the 8-byte alignment constraint Ludovic Desroches
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ludovic Desroches @ 2025-11-26 14:44 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Ludovic Desroches
The change in the pitch-alignment requirement may disrupt applications
that do not retrieve the pitch calculated by the kernel. Although these
applications are at fault, this can still introduce some regressions.
Moreover, if this new constraint isn’t actually necessary, the size of
the dumb buffers is increased for no good reason.
Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
---
Ludovic Desroches (3):
drm/gem-dma: revert the 8-byte alignment constraint
drm/gem-shmem: revert the 8-byte alignment constraint
drm/gem-vram: revert the 8-byte alignment constraint
drivers/gpu/drm/drm_gem_dma_helper.c | 2 +-
drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +-
drivers/gpu/drm/drm_gem_vram_helper.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 14509f7d56d42d8847353fe483f84091be5199a9
change-id: 20251126-lcd_pitch_alignment-8c5c902fb1a6
prerequisite-message-id: <20250821081918.79786-1-tzimmermann@suse.de>
prerequisite-patch-id: b1c78eb783d0b3fb3cf63e4402782071d20449e7
prerequisite-patch-id: 321d1d3a7d30d0bc724ab408d9417d1a1885644c
prerequisite-patch-id: 4f9d2dc7675f1c08ef2a9f9bd27ff47892d8f1e8
prerequisite-patch-id: 2d9f278d56119da1825aab22bb8a6ec3c2a45696
prerequisite-patch-id: ff0c065b1774bba9e2b375ac16adbab1d44779ab
prerequisite-patch-id: b70a266e6876dd07ddc16fc982ddda98111bb5e8
prerequisite-patch-id: 59a80afc752822e352b662bf419b5c7862e9f07c
prerequisite-patch-id: 4822b326bab93d9b47fdca7660bddb68646f26ce
prerequisite-patch-id: 7ae8292f96e64edcb6f6684e2c8d3c0ee7ec94c8
prerequisite-patch-id: b06d15a09811f984a1e46b2fed09e7705f09c7df
prerequisite-patch-id: 76c1fdbdf4636bf2c2b67005a8ccba3670d613c0
prerequisite-patch-id: ebc25bdc0df5a714a63dcc311d4c283918f4aa4a
prerequisite-patch-id: f7c8dad90e8b9fa1b04801dd41d62269aafe9a5f
prerequisite-patch-id: 3ac15fa5280d34198b06add3628076b6002ae040
prerequisite-patch-id: bb6b891dd660f8efcd4f320d9832ea9b73e0582d
prerequisite-patch-id: 211a1b184494478a05cfa86401492e85a08fbe1e
prerequisite-patch-id: 7ee1ae23fc07a2fc093d882e186b98d479821d07
prerequisite-patch-id: 000809cb517d09fe5d29bc8091e9d9850e5d2257
prerequisite-patch-id: ac1b96c9e8d3153de9f8c3481b5a29490c294caa
prerequisite-patch-id: 5b1f19fe0a0a301d8256ff0aad1631edb7d33285
prerequisite-patch-id: adbddb54dcce63f7bda8bd924ae24233b6f1ece9
prerequisite-patch-id: dfe677d1204e4db7efe2eefcdf7bcf9dd02d2edb
prerequisite-patch-id: 8a71a1cba53b804bbf22bb3e91e19cda5d1643f4
prerequisite-patch-id: 0d7463bcc06ff83a921b6123aa7e0492ba6db16a
prerequisite-patch-id: 15518f62ee3502aa8baed5f7ba5a752e35e07c26
Best regards,
--
Ludovic Desroches <ludovic.desroches@microchip.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] drm/gem-dma: revert the 8-byte alignment constraint
2025-11-26 14:44 [PATCH 0/3] revert the 8-byte pitch-alignment constraint for memory managers Ludovic Desroches
@ 2025-11-26 14:44 ` Ludovic Desroches
2025-12-02 17:02 ` Thomas Zimmermann
2025-11-26 14:44 ` [PATCH 2/3] drm/gem-shmem: " Ludovic Desroches
2025-11-26 14:44 ` [PATCH 3/3] drm/gem-vram: " Ludovic Desroches
2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Desroches @ 2025-11-26 14:44 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Ludovic Desroches
Using drm_mode_size_dumb() to compute the size of dumb buffers introduced
an 8-byte alignment constraint on the pitch that wasn’t present before.
Let’s remove this constraint, which isn’t necessarily required and may
cause buffers to be allocated larger than needed.
Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
---
drivers/gpu/drm/drm_gem_dma_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c
index 12d8307997a0a90a9b5c0469bd742130fa6722d5..eb56ba2347966040a3c7fd27e09c8b81bc797daa 100644
--- a/drivers/gpu/drm/drm_gem_dma_helper.c
+++ b/drivers/gpu/drm/drm_gem_dma_helper.c
@@ -308,7 +308,7 @@ int drm_gem_dma_dumb_create(struct drm_file *file_priv,
struct drm_gem_dma_object *dma_obj;
int ret;
- ret = drm_mode_size_dumb(drm, args, SZ_8, 0);
+ ret = drm_mode_size_dumb(drm, args, 0, 0);
if (ret)
return ret;
--
2.51.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] drm/gem-shmem: revert the 8-byte alignment constraint
2025-11-26 14:44 [PATCH 0/3] revert the 8-byte pitch-alignment constraint for memory managers Ludovic Desroches
2025-11-26 14:44 ` [PATCH 1/3] drm/gem-dma: revert the 8-byte alignment constraint Ludovic Desroches
@ 2025-11-26 14:44 ` Ludovic Desroches
2025-12-02 17:03 ` Thomas Zimmermann
2025-11-26 14:44 ` [PATCH 3/3] drm/gem-vram: " Ludovic Desroches
2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Desroches @ 2025-11-26 14:44 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Ludovic Desroches
Using drm_mode_size_dumb() to compute the size of dumb buffers introduced
an 8-byte alignment constraint on the pitch that wasn’t present before.
Let’s remove this constraint, which isn’t necessarily required and may
cause buffers to be allocated larger than needed.
Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
---
drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index dc94a27710e5f48839a5d2e9e9ea5152ff22e438..93b9cff89080f94e5d6e4663ef642b4c36e93c71 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -559,7 +559,7 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev,
{
int ret;
- ret = drm_mode_size_dumb(dev, args, SZ_8, 0);
+ ret = drm_mode_size_dumb(dev, args, 0, 0);
if (ret)
return ret;
--
2.51.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] drm/gem-vram: revert the 8-byte alignment constraint
2025-11-26 14:44 [PATCH 0/3] revert the 8-byte pitch-alignment constraint for memory managers Ludovic Desroches
2025-11-26 14:44 ` [PATCH 1/3] drm/gem-dma: revert the 8-byte alignment constraint Ludovic Desroches
2025-11-26 14:44 ` [PATCH 2/3] drm/gem-shmem: " Ludovic Desroches
@ 2025-11-26 14:44 ` Ludovic Desroches
2025-12-02 17:09 ` Thomas Zimmermann
2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Desroches @ 2025-11-26 14:44 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, Ludovic Desroches
Using drm_mode_size_dumb() to compute the size of dumb buffers introduced
an 8-byte alignment constraint on the pitch that wasn’t present before.
Let’s remove this constraint, which isn’t necessarily required and may
cause buffers to be allocated larger than needed.
Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
---
drivers/gpu/drm/drm_gem_vram_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index f40f6e167f126681201b13d60be9c508f25d481f..3ab91965ec6f8fa275b9556079dfb335a02664bb 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -553,7 +553,7 @@ int drm_gem_vram_driver_dumb_create(struct drm_file *file,
if (WARN_ONCE(!dev->vram_mm, "VRAM MM not initialized"))
return -EINVAL;
- ret = drm_mode_size_dumb(dev, args, SZ_8, 0);
+ ret = drm_mode_size_dumb(dev, args, 0, 0);
if (ret)
return ret;
--
2.51.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] drm/gem-dma: revert the 8-byte alignment constraint
2025-11-26 14:44 ` [PATCH 1/3] drm/gem-dma: revert the 8-byte alignment constraint Ludovic Desroches
@ 2025-12-02 17:02 ` Thomas Zimmermann
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Zimmermann @ 2025-12-02 17:02 UTC (permalink / raw)
To: Ludovic Desroches, Maarten Lankhorst, Maxime Ripard,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel
Am 26.11.25 um 15:44 schrieb Ludovic Desroches:
> Using drm_mode_size_dumb() to compute the size of dumb buffers introduced
> an 8-byte alignment constraint on the pitch that wasn’t present before.
> Let’s remove this constraint, which isn’t necessarily required and may
> cause buffers to be allocated larger than needed.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: dcacfcd35cef ("drm/gem-dma: Compute dumb-buffer sizes with
drm_mode_size_dumb()")
> ---
> drivers/gpu/drm/drm_gem_dma_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c
> index 12d8307997a0a90a9b5c0469bd742130fa6722d5..eb56ba2347966040a3c7fd27e09c8b81bc797daa 100644
> --- a/drivers/gpu/drm/drm_gem_dma_helper.c
> +++ b/drivers/gpu/drm/drm_gem_dma_helper.c
> @@ -308,7 +308,7 @@ int drm_gem_dma_dumb_create(struct drm_file *file_priv,
> struct drm_gem_dma_object *dma_obj;
> int ret;
>
> - ret = drm_mode_size_dumb(drm, args, SZ_8, 0);
> + ret = drm_mode_size_dumb(drm, args, 0, 0);
> if (ret)
> return ret;
>
>
--
--
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)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] drm/gem-shmem: revert the 8-byte alignment constraint
2025-11-26 14:44 ` [PATCH 2/3] drm/gem-shmem: " Ludovic Desroches
@ 2025-12-02 17:03 ` Thomas Zimmermann
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Zimmermann @ 2025-12-02 17:03 UTC (permalink / raw)
To: Ludovic Desroches, Maarten Lankhorst, Maxime Ripard,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel
Am 26.11.25 um 15:44 schrieb Ludovic Desroches:
> Using drm_mode_size_dumb() to compute the size of dumb buffers introduced
> an 8-byte alignment constraint on the pitch that wasn’t present before.
> Let’s remove this constraint, which isn’t necessarily required and may
> cause buffers to be allocated larger than needed.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 4977dcecb931 ("drm/gem-shmem: Compute dumb-buffer sizes with
drm_mode_size_dumb()")
> ---
> drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
> index dc94a27710e5f48839a5d2e9e9ea5152ff22e438..93b9cff89080f94e5d6e4663ef642b4c36e93c71 100644
> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> @@ -559,7 +559,7 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev,
> {
> int ret;
>
> - ret = drm_mode_size_dumb(dev, args, SZ_8, 0);
> + ret = drm_mode_size_dumb(dev, args, 0, 0);
> if (ret)
> return ret;
>
>
--
--
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)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] drm/gem-vram: revert the 8-byte alignment constraint
2025-11-26 14:44 ` [PATCH 3/3] drm/gem-vram: " Ludovic Desroches
@ 2025-12-02 17:09 ` Thomas Zimmermann
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Zimmermann @ 2025-12-02 17:09 UTC (permalink / raw)
To: Ludovic Desroches, Maarten Lankhorst, Maxime Ripard,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel
Hi
Am 26.11.25 um 15:44 schrieb Ludovic Desroches:
> Using drm_mode_size_dumb() to compute the size of dumb buffers introduced
> an 8-byte alignment constraint on the pitch that wasn’t present before.
> Let’s remove this constraint, which isn’t necessarily required and may
> cause buffers to be allocated larger than needed.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> ---
> drivers/gpu/drm/drm_gem_vram_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index f40f6e167f126681201b13d60be9c508f25d481f..3ab91965ec6f8fa275b9556079dfb335a02664bb 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -553,7 +553,7 @@ int drm_gem_vram_driver_dumb_create(struct drm_file *file,
> if (WARN_ONCE(!dev->vram_mm, "VRAM MM not initialized"))
> return -EINVAL;
>
> - ret = drm_mode_size_dumb(dev, args, SZ_8, 0);
> + ret = drm_mode_size_dumb(dev, args, 0, 0);
> if (ret)
> return ret;
This code has not been merged yet AFAICT. I'll add the fix to the
patch's next update.
Best regards
Thomas
>
>
--
--
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)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-12-02 17:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-26 14:44 [PATCH 0/3] revert the 8-byte pitch-alignment constraint for memory managers Ludovic Desroches
2025-11-26 14:44 ` [PATCH 1/3] drm/gem-dma: revert the 8-byte alignment constraint Ludovic Desroches
2025-12-02 17:02 ` Thomas Zimmermann
2025-11-26 14:44 ` [PATCH 2/3] drm/gem-shmem: " Ludovic Desroches
2025-12-02 17:03 ` Thomas Zimmermann
2025-11-26 14:44 ` [PATCH 3/3] drm/gem-vram: " Ludovic Desroches
2025-12-02 17:09 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®