Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions kernel-open/common/inc/nv-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@
#include <linux/efi.h> /* efi_enabled */
#include <linux/fb.h> /* fb_info struct */
#include <linux/screen_info.h> /* screen_info */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 20, 0)
#include <linux/sysfb.h> /* sysfb_primary_display */
#endif

#if !defined(CONFIG_PCI)
#warning "Attempting to build driver for a platform with no PCI support!"
Expand Down
25 changes: 16 additions & 9 deletions kernel-open/nvidia/nv.c
Original file line number Diff line number Diff line change
Expand Up @@ -6375,22 +6375,29 @@ void NV_API_CALL nv_get_screen_info(
* After commit b8466fe82b79 ("efi: move screen_info into efi init code")
* in v6.7, 'screen_info' is exported as GPL licensed symbol for ARM64.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 20, 0)
// Rel. commit "sysfb: Replace screen_info with sysfb_primary_display" (Thomas Zimmermann, 26 Nov 2025)
const struct screen_info *si = &sysfb_primary_display.screen;
#elif NV_CHECK_EXPORT_SYMBOL(screen_info)
const struct screen_info *si = &screen_info;
#endif

#if NV_CHECK_EXPORT_SYMBOL(screen_info)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 20, 0)) || \
NV_CHECK_EXPORT_SYMBOL(screen_info)
/*
* If there is not a framebuffer console, return 0 size.
*
* orig_video_isVGA is set to 1 during early Linux kernel
* initialization, and then will be set to a value, such as
* VIDEO_TYPE_VLFB or VIDEO_TYPE_EFI if an fbdev console is used.
*/
if (screen_info.orig_video_isVGA > 1)
if (si->orig_video_isVGA > 1)
{
NvU64 physAddr = screen_info.lfb_base;
NvU64 physAddr = si->lfb_base;
#if defined(VIDEO_CAPABILITY_64BIT_BASE)
if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
if (si->capabilities & VIDEO_CAPABILITY_64BIT_BASE)
{
physAddr |= (NvU64)screen_info.ext_lfb_base << 32;
physAddr |= (NvU64)si->ext_lfb_base << 32;
}
#endif
/*
Expand All @@ -6402,10 +6409,10 @@ void NV_API_CALL nv_get_screen_info(
NV_IS_CONSOLE_MAPPED(nv, physAddr))
{
*pPhysicalAddress = physAddr;
*pFbWidth = screen_info.lfb_width;
*pFbHeight = screen_info.lfb_height;
*pFbDepth = screen_info.lfb_depth;
*pFbPitch = screen_info.lfb_linelength;
*pFbWidth = si->lfb_width;
*pFbHeight = si->lfb_height;
*pFbDepth = si->lfb_depth;
*pFbPitch = si->lfb_linelength;
*pFbSize = (NvU64)(*pFbHeight) * (NvU64)(*pFbPitch);
return;
}
Expand Down