Skip to content

Commit

Permalink
Revert "radeon, amdgpu: Firmware is required for DRM and KMS on R600 …
Browse files Browse the repository at this point in the history
…onward"

Although this patch helps in Debian, not all distributions using Zen
Kernrel have the same folder structure (/lib/firmware).  And as @Atemu
pointed out in raspberrypi#200, the patch is technically incredibly old for kernel
standards so it may only do harm than good.  Revert this patch.

This reverts commit 789af38.
  • Loading branch information
damentz committed Feb 12, 2021
1 parent 789af38 commit 70906d3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
29 changes: 0 additions & 29 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#include <linux/vga_switcheroo.h>
#include <drm/drm_probe_helper.h>
#include <linux/mmu_notifier.h>
#include <linux/namei.h>
#include <linux/path.h>

#include "amdgpu.h"
#include "amdgpu_irq.h"
Expand Down Expand Up @@ -1098,28 +1096,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);

static struct drm_driver kms_driver;

/* Test that /lib/firmware/amdgpu is a directory (or symlink to a
* directory). We could try to match the udev search path, but let's
* keep it simple.
*/
static bool amdgpu_firmware_installed(void)
{
#if IS_BUILTIN(CONFIG_DRM_AMDGPU)
/* It may be too early to tell. Assume it's there. */
return true;
#else
struct path path;

if (kern_path("/lib/firmware/amdgpu", LOOKUP_DIRECTORY | LOOKUP_FOLLOW,
&path) == 0) {
path_put(&path);
return true;
}

return false;
#endif
}

static int amdgpu_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
Expand Down Expand Up @@ -1184,11 +1160,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
}
#endif

if (!amdgpu_firmware_installed()) {
DRM_ERROR("amdgpu requires firmware installed\n");
return -ENODEV;
}

/* Get rid of things like offb */
ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "amdgpudrmfb");
if (ret)
Expand Down
30 changes: 0 additions & 30 deletions drivers/gpu/drm/radeon/radeon_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>
#include <drm/radeon_drm.h>
#include <linux/namei.h>
#include <linux/path.h>

#include "radeon_drv.h"

Expand Down Expand Up @@ -316,28 +314,6 @@ static struct drm_driver kms_driver;

bool radeon_device_is_virtual(void);

/* Test that /lib/firmware/radeon is a directory (or symlink to a
* directory). We could try to match the udev search path, but let's
* keep it simple.
*/
static bool radeon_firmware_installed(void)
{
#if IS_BUILTIN(CONFIG_DRM_RADEON)
/* It may be too early to tell. Assume it's there. */
return true;
#else
struct path path;

if (kern_path("/lib/firmware/radeon", LOOKUP_DIRECTORY | LOOKUP_FOLLOW,
&path) == 0) {
path_put(&path);
return true;
}

return false;
#endif
}

static int radeon_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
Expand Down Expand Up @@ -378,12 +354,6 @@ static int radeon_pci_probe(struct pci_dev *pdev,
if (vga_switcheroo_client_probe_defer(pdev))
return -EPROBE_DEFER;

if ((ent->driver_data & RADEON_FAMILY_MASK) >= CHIP_R600 &&
!radeon_firmware_installed()) {
DRM_ERROR("radeon kernel modesetting for R600 or later requires firmware installed\n");
return -ENODEV;
}

/* Get rid of things like offb */
ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "radeondrmfb");
if (ret)
Expand Down

0 comments on commit 70906d3

Please sign in to comment.