Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch to a multiple of 256.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Cc: Karol Herbst <kherbst@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250821081918.79786-15-tzimmermann@suse.de

+4 -3
+4 -3
drivers/gpu/drm/nouveau/nouveau_display.c
··· 30 30 #include <drm/drm_atomic_helper.h> 31 31 #include <drm/drm_client_event.h> 32 32 #include <drm/drm_crtc_helper.h> 33 + #include <drm/drm_dumb_buffers.h> 33 34 #include <drm/drm_fourcc.h> 34 35 #include <drm/drm_gem_framebuffer_helper.h> 35 36 #include <drm/drm_probe_helper.h> ··· 808 807 uint32_t domain; 809 808 int ret; 810 809 811 - args->pitch = roundup(args->width * (args->bpp / 8), 256); 812 - args->size = args->pitch * args->height; 813 - args->size = roundup(args->size, PAGE_SIZE); 810 + ret = drm_mode_size_dumb(dev, args, SZ_256, 0); 811 + if (ret) 812 + return ret; 814 813 815 814 /* Use VRAM if there is any ; otherwise fallback to system memory */ 816 815 if (nouveau_drm(dev)->client.device.info.ram_size != 0)