From: Thomas Zimmermann Date: Thu, 21 Aug 2025 08:17:14 +0000 (+0200) Subject: drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb() X-Git-Tag: v6.19-rc1~157^2~24^2~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecf29357b6268f70d13949f86df9d62e077d4b89;p=thirdparty%2Fkernel%2Flinux.git drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb() Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar Acked-by: Inki Dae Link: https://lore.kernel.org/r/20250821081918.79786-8-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index e3fbb45f37a27..02714c9ab6394 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -329,15 +330,16 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, unsigned int flags; int ret; + ret = drm_mode_size_dumb(dev, args, 0, 0); + if (ret) + return ret; + /* * allocate memory to be used for framebuffer. * - this callback would be called by user application * with DRM_IOCTL_MODE_CREATE_DUMB command. */ - args->pitch = args->width * ((args->bpp + 7) / 8); - args->size = args->pitch * args->height; - if (is_drm_iommu_supported(dev)) flags = EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC; else