From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/i915: Throw away the BIOS fb if has the wrong depth/bpp
Date: Fri, 7 Jun 2019 20:43:56 +0200 [thread overview]
Message-ID: <20190607184356.GO21222@phenom.ffwll.local> (raw)
In-Reply-To: <20190607162611.23514-4-ville.syrjala@linux.intel.com>
On Fri, Jun 07, 2019 at 07:26:11PM +0300, Ville Syrjala wrote:
> 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>
I guess we're going boom right now, which is maybe a bit much? i.e.
Cc: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> 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)) {
Bikeshed: A little helper that does all these checks with debug output,
and just one "throw bios fb away" path would look a lot neater.
-Daniel
> + 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
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-06-07 18:44 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 ` [PATCH 4/4] drm/i915: Throw away the BIOS fb if has the wrong depth/bpp Ville Syrjala
2019-06-07 18:43 ` Daniel Vetter [this message]
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=20190607184356.GO21222@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox