View Issue Details

IDProjectCategoryView StatusLast Update
0001404channel: elrepo/el8kmod-nvidia-390xxpublic2023-11-23 03:36
Reporterpperry Assigned Topperry  
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Summary0001404: kmod-nvidia-390xx fails to build on RHEL8.9
DescriptionBuild error when attempting to rebuild kmod-nvidia-390xx for RHEL8.9

/home/phil/rpmbuild/BUILD/kmod-nvidia-390xx-390.157/_kmod_build_/kernel/nvidia-drm/nvidia-drm-drv.c: In function 'nv_drm_init_mode_config':
/home/phil/rpmbuild/BUILD/kmod-nvidia-390xx-390.157/_kmod_build_/kernel/nvidia-drm/nvidia-drm-drv.c:244:22: error: 'struct drm_mode_config' has no member named 'fb_base'; did you mean 'fb_list'?
     dev->mode_config.fb_base = 0;
                      ^~~~~~~
                      fb_list
TagsNo tags attached.

Activities

tqhoang

2023-11-22 22:53

manager   ~0009445

Last edited: 2023-11-22 22:54

Attached is a working patch to build the NVIDIA 390.157 driver under RHEL 8.9. It appears that the RHEL 8.9 kernel's DRM subsystem is similar to upstream kernel 6.2.

The patch is inspired by Ubuntu's nvidia-graphics-drivers-390 patch, but only the DRM changes not the ACPI changes.
https://git.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/tree/debian/dkms_nvidia/patches/buildfix_kernel_6.2.patch
nvidia-390xx-buildfix-el8_9.patch (3,582 bytes)   
diff -Naurp kmod-nvidia-390xx-390.157/nvidiapkg/kernel/nvidia-drm/nvidia-drm-connector.c kmod-nvidia-390xx-390.157.buildfix/nvidiapkg/kernel/nvidia-drm/nvidia-drm-connector.c
--- kmod-nvidia-390xx-390.157/nvidiapkg/kernel/nvidia-drm/nvidia-drm-connector.c	2022-10-12 05:30:31.000000000 -0400
+++ kmod-nvidia-390xx-390.157.buildfix/nvidiapkg/kernel/nvidia-drm/nvidia-drm-connector.c	2023-11-22 21:51:01.001472520 -0500
@@ -20,6 +20,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
+#include <drm/drm_edid.h>
 #include "nvidia-drm-conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -98,6 +100,7 @@ __nv_drm_detect_encoder(struct NvKmsKapi
             break;
     }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
     if (connector->override_edid) {
         const struct drm_property_blob *edid = connector->edid_blob_ptr;
 
@@ -110,6 +113,25 @@ __nv_drm_detect_encoder(struct NvKmsKapi
                     sizeof(pDetectParams->edid.buffer));
         }
     }
+#else
+    // Rel. commit "drm/edid: detach debugfs EDID override from EDID property update" (Jani Nikula, 24 Oct 2022)
+    // NOTE: HUGE HACK!
+    mutex_lock(&connector->edid_override_mutex);
+    if (connector->edid_override) {
+        const struct edid *edid = drm_edid_raw(connector->edid_override);
+        size_t edid_length = EDID_LENGTH * (edid->extensions + 1);
+        if (edid_length <= sizeof(pDetectParams->edid.buffer)) {
+            memcpy(pDetectParams->edid.buffer, edid, edid_length);
+            pDetectParams->edid.bufferSize = edid_length;
+            pDetectParams->overrideEdid = NV_TRUE;
+        } else {
+            WARN_ON(edid_length >
+                    sizeof(pDetectParams->edid.buffer));
+        }
+    }
+    mutex_unlock(&connector->edid_override_mutex);
+
+#endif
 
     if (!nvKms->getDynamicDisplayInfo(nv_dev->pDevice, pDetectParams)) {
         NV_DRM_DEV_LOG_ERR(
diff -Naurp kmod-nvidia-390xx-390.157/nvidiapkg/kernel/nvidia-drm/nvidia-drm-drv.c kmod-nvidia-390xx-390.157.buildfix/nvidiapkg/kernel/nvidia-drm/nvidia-drm-drv.c
--- kmod-nvidia-390xx-390.157/nvidiapkg/kernel/nvidia-drm/nvidia-drm-drv.c	2022-10-12 05:30:31.000000000 -0400
+++ kmod-nvidia-390xx-390.157.buildfix/nvidiapkg/kernel/nvidia-drm/nvidia-drm-drv.c	2023-11-22 21:51:01.001472520 -0500
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
 #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
 
 #include "nvidia-drm-priv.h"
@@ -239,9 +240,12 @@ nv_drm_init_mode_config(struct nv_drm_de
     dev->mode_config.preferred_depth = 24;
     dev->mode_config.prefer_shadow = 1;
 
+// Rel. commit "drm: Remove drm_mode_config::fb_base" (Zack Rusin, 18 Oct 2022)
+#if defined(CONFIG_FB) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
     /* Currently unused. Update when needed. */
 
     dev->mode_config.fb_base = 0;
+#endif
 
     dev->mode_config.async_page_flip = false;
 
diff -Naurp kmod-nvidia-390xx-390.157/nvidiapkg/kernel/nvidia-drm/nvidia-drm-fb.c kmod-nvidia-390xx-390.157.buildfix/nvidiapkg/kernel/nvidia-drm/nvidia-drm-fb.c
--- kmod-nvidia-390xx-390.157/nvidiapkg/kernel/nvidia-drm/nvidia-drm-fb.c	2022-10-12 05:30:31.000000000 -0400
+++ kmod-nvidia-390xx-390.157.buildfix/nvidiapkg/kernel/nvidia-drm/nvidia-drm-fb.c	2023-11-22 21:56:50.433477927 -0500
@@ -31,6 +31,7 @@
 #include "nvidia-drm-gem.h"
 
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_modeset_helper.h>
 
 static void nv_drm_framebuffer_destroy(struct drm_framebuffer *fb)
 {

pperry

2023-11-23 03:36

administrator   ~0009448

Thanks - packages built cleanly with patch applied, and released to the main elrepo repository.

Issue History

Date Modified Username Field Change
2023-11-14 11:22 pperry New Issue
2023-11-14 11:22 pperry Status new => assigned
2023-11-14 11:22 pperry Assigned To => pperry
2023-11-22 22:53 tqhoang Note Added: 0009445
2023-11-22 22:53 tqhoang File Added: nvidia-390xx-buildfix-el8_9.patch
2023-11-22 22:54 tqhoang Note Edited: 0009445
2023-11-23 03:36 pperry Note Added: 0009448
2023-11-23 03:36 pperry Status assigned => resolved
2023-11-23 03:36 pperry Resolution open => fixed