mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 07:39:12 -04:00
drm/i915/fbdev: Extract bios_fb_ok()
Pull the "is the BIOS FB OK?" checks to a helper function. We'll add other relevant checks there later. 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-3-ville.syrjala@linux.intel.com Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
This commit is contained in:
committed by
Maarten Lankhorst
parent
466fa6902e
commit
b2a2c62040
@@ -262,6 +262,23 @@ __intel_fbdev_fb_alloc(struct intel_display *display,
|
||||
|
||||
}
|
||||
|
||||
static bool bios_fb_ok(const struct intel_framebuffer *fb,
|
||||
const struct drm_fb_helper_surface_size *sizes)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(fb->base.dev);
|
||||
int width = fb->base.width;
|
||||
int height = fb->base.height;
|
||||
|
||||
if (sizes->fb_width > width || sizes->fb_height > height) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"BIOS fb too small (%dx%d), we require (%dx%d), releasing it\n",
|
||||
width, height, sizes->fb_width, sizes->fb_height);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
|
||||
struct drm_fb_helper_surface_size *sizes)
|
||||
{
|
||||
@@ -279,14 +296,7 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
|
||||
|
||||
ifbdev->fb = NULL;
|
||||
|
||||
if (fb &&
|
||||
(sizes->fb_width > fb->base.width ||
|
||||
sizes->fb_height > fb->base.height)) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"BIOS fb too small (%dx%d), we require (%dx%d),"
|
||||
" releasing it\n",
|
||||
fb->base.width, fb->base.height,
|
||||
sizes->fb_width, sizes->fb_height);
|
||||
if (fb && !bios_fb_ok(fb, sizes)) {
|
||||
drm_framebuffer_put(&fb->base);
|
||||
fb = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user