From e837f4e112461ddb174ddabd0be08dc4cdcd8aaf Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 10 Jan 2023 17:06:45 +0000 Subject: [PATCH] drm/tegra: Fix build for Linux v6.2 Linux v6.2 makes the following changes in the DRM subsystem ... 1. Commit 7c99616e3fe7 ("drm: Remove drm_mode_config::fb_base") removes the fb_base member from the drm_mode_config structure. 2. Commit 9877d8f6bc37 ("drm/fb_helper: Rename field fbdev to info in struct drm_fb_helper") renames the 'fbdev' field of the drm_fb_helper structure to 'info'. 3. Commit 7fd50bc39d12 ("drm/fb-helper: Rename drm_fb_helper_alloc_fbi() to use _info postfix") renames the function drm_fb_helper_alloc_fbi() to drm_fb_helper_alloc_info(). 4. Commit afb0ff78c13c ("drm/fb-helper: Rename drm_fb_helper_unregister_fbi() to use _info postfix") renames the function drm_fb_helper_unregister_fbi() to drm_fb_helper_unregister_info(). Update the Tegra DRM out-of-tree module as necessary to fix the build for Linux v6.2. Bug 3936429 Signed-off-by: Jon Hunter Change-Id: I501cb1d5dc772bc86b357f536431b76427e4888e Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2841023 Reviewed-by: svc_kernel_abi Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/gpu/drm/tegra/fb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c index 69d486aa..da625375 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -248,7 +248,11 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, if (IS_ERR(bo)) return PTR_ERR(bo); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) + info = drm_fb_helper_alloc_info(helper); +#else info = drm_fb_helper_alloc_fbi(helper); +#endif if (IS_ERR(info)) { dev_err(drm->dev, "failed to allocate framebuffer info\n"); drm_gem_object_put(&bo->gem); @@ -266,7 +270,11 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, fb = fbdev->fb; helper->fb = fb; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) + helper->info = info; +#else helper->fbdev = info; +#endif info->fbops = &tegra_fb_ops; @@ -285,7 +293,9 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0) drm->mode_config.fb_base = (resource_size_t)bo->iova; +#endif info->screen_base = (void __iomem *)bo->vaddr + offset; info->screen_size = size; info->fix.smem_start = (unsigned long)(bo->iova + offset); @@ -353,7 +363,11 @@ fini: static void tegra_fbdev_exit(struct tegra_fbdev *fbdev) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) + drm_fb_helper_unregister_info(&fbdev->base); +#else drm_fb_helper_unregister_fbi(&fbdev->base); +#endif if (fbdev->fb) { struct tegra_bo *bo = tegra_fb_get_plane(fbdev->fb, 0);