Skip to content

Commit

Permalink
drm: remove drivers trying to take the framebuffer
Browse files Browse the repository at this point in the history
Signed-off-by: Yusuf Khan <[email protected]>
  • Loading branch information
YusufKhan-gamedev committed Nov 23, 2022
1 parent 9855350 commit 0779583
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel-open/conftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ test_headers() {
FILES="$FILES drm/drm_ioctl.h"
FILES="$FILES drm/drm_device.h"
FILES="$FILES drm/drm_mode_config.h"
FILES="$FILES drm/drm_aperture.h"
FILES="$FILES dt-bindings/interconnect/tegra_icc_id.h"
FILES="$FILES generated/autoconf.h"
FILES="$FILES generated/compile.h"
Expand All @@ -139,6 +140,7 @@ test_headers() {
FILES="$FILES linux/sched/signal.h"
FILES="$FILES linux/sched/task.h"
FILES="$FILES linux/sched/task_stack.h"
FILES="$FILES linux/aperture.h"
FILES="$FILES xen/ioemu.h"
FILES="$FILES linux/fence.h"
FILES="$FILES linux/dma-resv.h"
Expand Down
19 changes: 19 additions & 0 deletions kernel-open/nvidia-drm/nvidia-drm-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@
#include <drm/drm_atomic_helper.h>
#endif

#if defined(NV_DRM_DRM_APERTURE_H_PRESENT)
#include <drm/drm_aperture.h>
#endif

#if defined(NV_LINUX_APERTURE_H_PRESENT)
#include <linux/aperture.h>
#endif

static struct nv_drm_device *dev_list = NULL;

#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
Expand Down Expand Up @@ -941,6 +949,17 @@ static void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info)
NV_DRM_DEV_LOG_ERR(nv_dev, "Failed to register device");
goto failed_drm_register;
}
/*
* Remove conflicting framebuffers, some framebuffers might interfere
* with the operation of nvidia-drm(eg. nouveau) so remove all that
* might.
*/
#if defined(NV_LINUX_APERTURE_H_PRESENT)
/* Linux 6.0-rc1 has this, the drm apreture func wraps this */
aperture_remove_conflicting_pci_devices(to_pci_dev(device), "nvidia-drm");
#elif defined(NV_DRM_DRM_APERTURE_H_PRESENT)
drm_aperture_remove_conflicting_pci_framebuffers(to_pci_dev(device), dev);
#endif

/* Add NVIDIA-DRM device into list */

Expand Down

0 comments on commit 0779583

Please sign in to comment.