mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
drm/i915: Throw away the BIOS fb if has the wrong depth/bpp
Respect the user's choice of depth/bpp for the fbdev framebuffer and throw out the fb we inherited from the BIOS if it doesn't match. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://patch.msgid.link/20260511214122.8468-4-ville.syrjala@linux.intel.com Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
This commit is contained in:
parent
b2a2c62040
commit
d6a1bc7c9b
|
|
@ -268,6 +268,8 @@ static bool bios_fb_ok(const struct intel_framebuffer *fb,
|
|||
struct intel_display *display = to_intel_display(fb->base.dev);
|
||||
int width = fb->base.width;
|
||||
int height = fb->base.height;
|
||||
int depth = fb->base.format->depth;
|
||||
int bpp = fb->base.format->cpp[0] * 8;
|
||||
|
||||
if (sizes->fb_width > width || sizes->fb_height > height) {
|
||||
drm_dbg_kms(display->drm,
|
||||
|
|
@ -276,6 +278,13 @@ static bool bios_fb_ok(const struct intel_framebuffer *fb,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (sizes->surface_depth != depth || sizes->surface_bpp != bpp) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"BIOS fb using wrong depth/bpp (%d/%d), we require (%d/%d), releasing it\n",
|
||||
depth, bpp, sizes->surface_depth, sizes->surface_bpp);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user