aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org> 2021-11-19 10:50:11 -0800
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2021-11-19 10:50:11 -0800
commitad44518affc66611644654cec9c165eb4e848030 (patch)
treebb2a252da2bdbde9ab3e2e55991954e50f78b700 /drivers/video
parentx86: Pin task-stack in __get_wchan() (diff)
parentMerge tag 'amd-drm-fixes-5.16-2021-11-17' of https://gitlab.freedesktop.org/a... (diff)
downloadlinux-ad44518affc66611644654cec9c165eb4e848030.tar.gz
linux-ad44518affc66611644654cec9c165eb4e848030.tar.bz2
linux-ad44518affc66611644654cec9c165eb4e848030.zip
Merge tag 'drm-fixes-2021-11-19' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "This week's fixes, pretty quiet, about right for rc2. amdgpu is the bulk of them but the scheduler ones have been reported in a few places I think. Otherwise just some minor i915 fixes and a few other scattered around: scheduler: - two refcounting fixes cma-helper: - use correct free path for noncoherent efifb: - probing fix amdgpu: - Better debugging info for SMU msgs - Better error reporting when adding IP blocks - Fix UVD powergating regression on CZ - Clock reporting fix for navi1x - OLED panel backlight fix - Fix scaling on VGA/DVI for non-DC display code - Fix GLFCLK handling for RGP on some APUs - fix potential memory leak amdkfd: - GPU reset fix i915: - return error handling fix - ADL-P display fix - TGL DSI display clocks fix nouveau: - infoframe corruption fix sun4i: - Kconfig fix" * tag 'drm-fixes-2021-11-19' of git://anongit.freedesktop.org/drm/drm: drm/amd/amdgpu: fix potential memleak drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again drm/amd/pm: add GFXCLK/SCLK clocks level print support for APUs drm/amdgpu: fix set scaling mode Full/Full aspect/Center not works on vga and dvi connectors drm/amd/display: Fix OLED brightness control on eDP drm/amd/pm: Remove artificial freq level on Navi1x drm/amd/pm: avoid duplicate powergate/ungate setting drm/amdgpu: add error print when failing to add IP block(v2) drm/amd/pm: Enhanced reporting also for a stuck command drm/i915/guc: fix NULL vs IS_ERR() checking drm/i915/dsi/xelpd: Fix the bit mask for wakeup GB Revert "drm/i915/tgl/dsi: Gate the ddi clocks after pll mapping" fbdev: Prevent probing generic drivers if a FB is already registered drm/scheduler: fix drm_sched_job_add_implicit_dependencies harder drm/scheduler: fix drm_sched_job_add_implicit_dependencies drm/sun4i: fix unmet dependency on RESET_CONTROLLER for PHY_SUN6I_MIPI_DPHY drm/cma-helper: Release non-coherent memory with dma_free_noncoherent() drm/nouveau: hdmigv100.c: fix corrupted HDMI Vendor InfoFrame
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/efifb.c11
-rw-r--r--drivers/video/fbdev/simplefb.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index edca3703b964..ea42ba6445b2 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -351,6 +351,17 @@ static int efifb_probe(struct platform_device *dev)
char *option = NULL;
efi_memory_desc_t md;
+ /*
+ * Generic drivers must not be registered if a framebuffer exists.
+ * If a native driver was probed, the display hardware was already
+ * taken and attempting to use the system framebuffer is dangerous.
+ */
+ if (num_registered_fb > 0) {
+ dev_err(&dev->dev,
+ "efifb: a framebuffer is already registered\n");
+ return -EINVAL;
+ }
+
if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || pci_dev_disabled)
return -ENODEV;
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 62f0ded70681..b63074fd892e 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -407,6 +407,17 @@ static int simplefb_probe(struct platform_device *pdev)
struct simplefb_par *par;
struct resource *mem;
+ /*
+ * Generic drivers must not be registered if a framebuffer exists.
+ * If a native driver was probed, the display hardware was already
+ * taken and attempting to use the system framebuffer is dangerous.
+ */
+ if (num_registered_fb > 0) {
+ dev_err(&pdev->dev,
+ "simplefb: a framebuffer is already registered\n");
+ return -EINVAL;
+ }
+
if (fb_get_options("simplefb", NULL))
return -ENODEV;