Comments

Kernel – 5.12-rc1 is Out. OK with Patched VMware, NVIDIA fails.. — 2 Comments

  1. joanbm’s patch works but it was written for an older version of the driver sources. For recent versions, the line numbers need to be updated, and, depending on the driver version, additional changes might be necessary:
    “`
    diff –git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
    index 1b4cc6d..0c26646 100644
    — a/kernel/nvidia-drm/nvidia-drm-drv.c
    +++ b/kernel/nvidia-drm/nvidia-drm-drv.c
    @@ -20,6 +20,7 @@
    * DEALINGS IN THE SOFTWARE.
    */

    +#include
    #include “nvidia-drm-conftest.h” /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */

    #include “nvidia-drm-priv.h”
    @@ -700,10 +701,10 @@
    .num_ioctls = ARRAY_SIZE(nv_drm_ioctls),

    .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
    – .gem_prime_export = nv_drm_gem_prime_export,
    – .gem_prime_get_sg_table = nv_drm_gem_prime_get_sg_table,
    – .gem_prime_vmap = nv_drm_gem_prime_vmap,
    – .gem_prime_vunmap = nv_drm_gem_prime_vunmap,
    +/* .gem_prime_export = nv_drm_gem_prime_export, */
    +/* .gem_prime_get_sg_table = nv_drm_gem_prime_get_sg_table, */
    +/* .gem_prime_vmap = nv_drm_gem_prime_vmap, */
    +/* .gem_prime_vunmap = nv_drm_gem_prime_vunmap, */

    #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
    .gem_prime_res_obj = nv_drm_gem_prime_res_obj,
    @@ -730,10 +731,17 @@
    #if defined(NV_DRM_DRIVER_HAS_LEGACY_DEV_LIST)
    .legacy_dev_list = LIST_HEAD_INIT(nv_drm_driver.legacy_dev_list),
    #else
    – .device_list = LIST_HEAD_INIT(nv_drm_driver.device_list),
    + /* .device_list = LIST_HEAD_INIT(nv_drm_driver.device_list),*/
    #endif
    };

    +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
    +// Reimport trivial forwarder function deleted in commit “drm: Don’t export the drm_gem_dumb_destroy() function” (file drivers/gpu/drm/drm_gem.c)
    +static int nv_drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, u32 handle)
    +{
    + return drm_gem_handle_delete(file, handle);
    +}
    +#endif

    /*
    * Update the global nv_drm_driver for the intended features.
    @@ -757,9 +765,12 @@

    nv_drm_driver.dumb_create = nv_drm_dumb_create;
    nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset;
    – nv_drm_driver.dumb_destroy = drm_gem_dumb_destroy;

    – nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops;
    + #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
    + nv_drm_driver.dumb_destroy = drm_gem_dumb_destroy;
    + #else
    + nv_drm_driver.dumb_destroy = nv_drm_gem_dumb_destroy;
    + #endif
    + /* nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops; */
    #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
    }
    “`

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.