diff options
author | Thomas Zimmermann <[email protected]> | 2024-09-24 10:41:03 +0200 |
---|---|---|
committer | Thomas Zimmermann <[email protected]> | 2024-09-26 08:22:20 +0200 |
commit | ad604f0a4c040dcb8faf44dc72db25e457c28076 (patch) | |
tree | a4d5ab56fe3e7a83bc14dd928825355462317b4f | |
parent | 8b0d2f61545545ab5eef923ed6e59fc3be2385e0 (diff) |
firmware/sysfb: Disable sysfb for firmware buffers with unknown parent
The sysfb framebuffer handling only operates on graphics devices
that provide the system's firmware framebuffer. If that device is
not known, assume that any graphics device has been initialized by
firmware.
Fixes a problem on i915 where sysfb does not release the firmware
framebuffer after the native graphics driver loaded.
Reported-by: Borah, Chaitanya Kumar <[email protected]>
Closes: https://lore.kernel.org/dri-devel/SJ1PR11MB6129EFB8CE63D1EF6D932F94B96F2@SJ1PR11MB6129.namprd11.prod.outlook.com/
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12160
Signed-off-by: Thomas Zimmermann <[email protected]>
Fixes: b49420d6a1ae ("video/aperture: optionally match the device in sysfb_disable()")
Cc: Javier Martinez Canillas <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: [email protected]
Cc: Linux regression tracking (Thorsten Leemhuis) <[email protected]>
Cc: <[email protected]> # v6.11+
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/firmware/sysfb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c index 02a07d3d0d40..a3df782fa687 100644 --- a/drivers/firmware/sysfb.c +++ b/drivers/firmware/sysfb.c @@ -67,9 +67,11 @@ static bool sysfb_unregister(void) void sysfb_disable(struct device *dev) { struct screen_info *si = &screen_info; + struct device *parent; mutex_lock(&disable_lock); - if (!dev || dev == sysfb_parent_dev(si)) { + parent = sysfb_parent_dev(si); + if (!dev || !parent || dev == parent) { sysfb_unregister(); disabled = true; } |