All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/4] drm/i915: Throw away the BIOS fb if has the wrong depth/bpp
Date: Fri,  7 Jun 2019 19:26:11 +0300	[thread overview]
Message-ID: <20190607162611.23514-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190607162611.23514-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 0d3a6fa674e6..1a935dc74d23 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -199,6 +199,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
 		drm_framebuffer_put(&intel_fb->base);
 		intel_fb = ifbdev->fb = NULL;
 	}
+	if (intel_fb &&
+	    (sizes->surface_depth != intel_fb->base.format->depth ||
+	     sizes->surface_bpp != intel_fb->base.format->cpp[0] * 8)) {
+		DRM_DEBUG_KMS("BIOS fb using wrong depth/bpp (%d/%d), we require (%d/%d),"
+			      " releasing it\n",
+			      intel_fb->base.format->depth,
+			      intel_fb->base.format->cpp[0] * 8,
+			      sizes->surface_depth, sizes->surface_bpp);
+		drm_framebuffer_put(&intel_fb->base);
+		intel_fb = ifbdev->fb = NULL;
+	}
 	if (!intel_fb || WARN_ON(!intel_fb_obj(&intel_fb->base))) {
 		DRM_DEBUG_KMS("no BIOS fb, allocating a new one\n");
 		ret = intelfb_alloc(helper, sizes);
-- 
2.21.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-06-07 16:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07 16:26 [PATCH 1/4] drm/fb-helper: Do not assume drm_mode_create_from_cmdline_mode() can't fail Ville Syrjala
2019-06-07 16:26 ` [PATCH 2/4] drm: Refuse to create zero width/height cmdline modes Ville Syrjala
2019-06-07 18:27   ` Daniel Vetter
2019-06-07 16:26 ` [PATCH 3/4] drm/fb-helper: Set up gamma_lut during restore_fbdev_mode_atomic() Ville Syrjala
2019-06-07 18:40   ` Daniel Vetter
2019-06-11 17:50     ` [Intel-gfx] " Ville Syrjälä
2019-06-11 17:55       ` Daniel Vetter
2019-06-11 18:08         ` Ville Syrjälä
2019-06-07 16:26 ` Ville Syrjala [this message]
2019-06-07 18:43   ` [PATCH 4/4] drm/i915: Throw away the BIOS fb if has the wrong depth/bpp Daniel Vetter
2019-06-11 17:51     ` Ville Syrjälä
2019-06-07 16:49 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/fb-helper: Do not assume drm_mode_create_from_cmdline_mode() can't fail Patchwork
2019-06-07 17:53 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-06-07 18:21 ` [PATCH 1/4] " Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190607162611.23514-4-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.