All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: Knut Petersen <Knut_Petersen@t-online.de>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH] drm/i915: Discard BIOS framebuffers too small to accommodate chosen mode
Date: Wed, 23 Apr 2014 08:54:31 +0100	[thread overview]
Message-ID: <1398239671-4135-1-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20140423071125.GS10722@phenom.ffwll.local>

If the inherited BIOS framebuffer is smaller than the mode selected for
fbdev, then if we continue to use it then we cause display corruption as
we do not setup the panel fitter to upscale.

Regression from commit d978ef14456a38034f6c0e94a794129501f89200
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Fri Mar 7 08:57:51 2014 -0800

    drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12

v2: Add a debug message to track the discard of the BIOS fb.
v3: Ville pointed out the difference between ref/unref

Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77767
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index b16116db6c37..fbe7941f88c8 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -133,6 +133,16 @@ static int intelfb_create(struct drm_fb_helper *helper,
 
 	mutex_lock(&dev->struct_mutex);
 
+	if (intel_fb &&
+	    (sizes->fb_width > intel_fb->base.width ||
+	     sizes->fb_height > intel_fb->base.height)) {
+		DRM_DEBUG_KMS("BIOS fb too small (%dx%d), we require (%dx%d),"
+			      " releasing it\n",
+			      intel_fb->base.width, intel_fb->base.height,
+			      sizes->fb_width, sizes->fb_height);
+		drm_framebuffer_unreference(&intel_fb->base);
+		intel_fb = ifbdev->fb = NULL;
+	}
 	if (!intel_fb || WARN_ON(!intel_fb->obj)) {
 		DRM_DEBUG_KMS("no BIOS fb, allocating a new one\n");
 		ret = intelfb_alloc(helper, sizes);
-- 
1.9.2


WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH] drm/i915: Discard BIOS framebuffers too small to accommodate chosen mode
Date: Wed, 23 Apr 2014 08:54:31 +0100	[thread overview]
Message-ID: <1398239671-4135-1-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20140423071125.GS10722@phenom.ffwll.local>

If the inherited BIOS framebuffer is smaller than the mode selected for
fbdev, then if we continue to use it then we cause display corruption as
we do not setup the panel fitter to upscale.

Regression from commit d978ef14456a38034f6c0e94a794129501f89200
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Fri Mar 7 08:57:51 2014 -0800

    drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12

v2: Add a debug message to track the discard of the BIOS fb.
v3: Ville pointed out the difference between ref/unref

Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77767
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index b16116db6c37..fbe7941f88c8 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -133,6 +133,16 @@ static int intelfb_create(struct drm_fb_helper *helper,
 
 	mutex_lock(&dev->struct_mutex);
 
+	if (intel_fb &&
+	    (sizes->fb_width > intel_fb->base.width ||
+	     sizes->fb_height > intel_fb->base.height)) {
+		DRM_DEBUG_KMS("BIOS fb too small (%dx%d), we require (%dx%d),"
+			      " releasing it\n",
+			      intel_fb->base.width, intel_fb->base.height,
+			      sizes->fb_width, sizes->fb_height);
+		drm_framebuffer_unreference(&intel_fb->base);
+		intel_fb = ifbdev->fb = NULL;
+	}
 	if (!intel_fb || WARN_ON(!intel_fb->obj)) {
 		DRM_DEBUG_KMS("no BIOS fb, allocating a new one\n");
 		ret = intelfb_alloc(helper, sizes);
-- 
1.9.2

  parent reply	other threads:[~2014-04-23  7:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21 16:46 [Bug 3.15-rc2] intel framebuffer broken Knut Petersen
2014-04-22 11:54 ` [Intel-gfx] " Jani Nikula
2014-04-22 11:54   ` Jani Nikula
2014-04-22 13:59   ` [Intel-gfx] [Bug 3.15-rc2] [bisected] " Knut Petersen
2014-04-22 13:59     ` Knut Petersen
2014-04-22 15:10     ` [Intel-gfx] " Jani Nikula
2014-04-22 15:10       ` Jani Nikula
2014-04-22 16:20       ` [Intel-gfx] " Knut Petersen
2014-04-22 16:20         ` Knut Petersen
2014-04-22 21:05         ` [PATCH] drm/i915: Discard BIOS framebuffers too small to accommodate chosen mode Chris Wilson
2014-04-22 21:05           ` Chris Wilson
2014-04-23  7:11           ` Daniel Vetter
2014-04-23  7:11             ` Daniel Vetter
2014-04-23  7:39             ` Chris Wilson
2014-04-23  7:39               ` Chris Wilson
2014-04-23  7:54             ` Chris Wilson [this message]
2014-04-23  7:54               ` Chris Wilson
2014-04-23  8:24               ` [Intel-gfx] " Ville Syrjälä
2014-04-23  8:24                 ` Ville Syrjälä
2014-04-23 11:03                 ` [Intel-gfx] " Jani Nikula
2014-04-23 11:03                   ` Jani Nikula
2014-04-23  7:50           ` [Intel-gfx] " Ville Syrjälä
2014-04-23  7:50             ` Ville Syrjälä
2014-04-22 16:22       ` [Intel-gfx] [Bug 3.15-rc2] [bisected] intel framebuffer broken Imre Deak
2014-04-22 16:22         ` Imre Deak
2014-04-22 17:33         ` [Intel-gfx] " Daniel Vetter
2014-04-22 17:33           ` 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=1398239671-4135-1-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=Knut_Petersen@t-online.de \
    --cc=daniel.vetter@ffwll.ch \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.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.