All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
@ 2022-01-07 12:35 Ashish Arora
  2022-01-07 12:47   ` [Intel-gfx] " Jani Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: Ashish Arora @ 2022-01-07 12:35 UTC (permalink / raw)
  To: jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: intel-gfx, Linux Kernel Mailing List

From: Ashish Arora <ashisharora.linux@outlook.com>

On certain 4k panels, the BIOS framebuffer is larger than what panel
requires causing display corruption. Introduce a check for the same.

Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index adc3a81be..f9952e1f8 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
 	struct drm_i915_gem_object *obj;
 	int ret;
 
+	if (intel_fb &&
+	    (sizes->fb_width < intel_fb->base.width ||
+	     sizes->fb_height < intel_fb->base.height)) {
+		drm_dbg_kms(&dev_priv->drm,
+			    "BIOS fb too large (%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_put(&intel_fb->base);
+		intel_fb = ifbdev->fb = NULL;
+	}
 	if (intel_fb &&
 	    (sizes->fb_width > intel_fb->base.width ||
 	     sizes->fb_height > intel_fb->base.height)) {
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
  2022-01-07 12:35 [Intel-gfx] [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption Ashish Arora
@ 2022-01-07 12:47   ` Jani Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2022-01-07 12:47 UTC (permalink / raw)
  To: Ashish Arora, joonas.lahtinen, rodrigo.vivi
  Cc: intel-gfx, Linux Kernel Mailing List

On Fri, 07 Jan 2022, Ashish Arora <ashisharora.linux@outlook.com> wrote:
> From: Ashish Arora <ashisharora.linux@outlook.com>
>
> On certain 4k panels, the BIOS framebuffer is larger than what panel
> requires causing display corruption. Introduce a check for the same.

This is quite thin on details. Is there a bug report?

Moreover, if this is what we want, this should be combined with the
conditions that follow resulting in a "!=" check instead of separate "<"
and ">".

BR,
Jani.



>
> Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
> ---
>  drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index adc3a81be..f9952e1f8 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
>  	struct drm_i915_gem_object *obj;
>  	int ret;
>  
> +	if (intel_fb &&
> +	    (sizes->fb_width < intel_fb->base.width ||
> +	     sizes->fb_height < intel_fb->base.height)) {
> +		drm_dbg_kms(&dev_priv->drm,
> +			    "BIOS fb too large (%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_put(&intel_fb->base);
> +		intel_fb = ifbdev->fb = NULL;
> +	}
>  	if (intel_fb &&
>  	    (sizes->fb_width > intel_fb->base.width ||
>  	     sizes->fb_height > intel_fb->base.height)) {

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
@ 2022-01-07 12:47   ` Jani Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2022-01-07 12:47 UTC (permalink / raw)
  To: Ashish Arora, joonas.lahtinen, rodrigo.vivi
  Cc: intel-gfx, Linux Kernel Mailing List

On Fri, 07 Jan 2022, Ashish Arora <ashisharora.linux@outlook.com> wrote:
> From: Ashish Arora <ashisharora.linux@outlook.com>
>
> On certain 4k panels, the BIOS framebuffer is larger than what panel
> requires causing display corruption. Introduce a check for the same.

This is quite thin on details. Is there a bug report?

Moreover, if this is what we want, this should be combined with the
conditions that follow resulting in a "!=" check instead of separate "<"
and ">".

BR,
Jani.



>
> Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
> ---
>  drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index adc3a81be..f9952e1f8 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
>  	struct drm_i915_gem_object *obj;
>  	int ret;
>  
> +	if (intel_fb &&
> +	    (sizes->fb_width < intel_fb->base.width ||
> +	     sizes->fb_height < intel_fb->base.height)) {
> +		drm_dbg_kms(&dev_priv->drm,
> +			    "BIOS fb too large (%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_put(&intel_fb->base);
> +		intel_fb = ifbdev->fb = NULL;
> +	}
>  	if (intel_fb &&
>  	    (sizes->fb_width > intel_fb->base.width ||
>  	     sizes->fb_height > intel_fb->base.height)) {

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
  2022-01-07 12:47   ` [Intel-gfx] " Jani Nikula
@ 2022-01-07 13:59     ` Aditya Garg
  -1 siblings, 0 replies; 8+ messages in thread
From: Aditya Garg @ 2022-01-07 13:59 UTC (permalink / raw)
  To: Jani Nikula
  Cc: joonas.lahtinen, rodrigo.vivi, intel-gfx, Linux Kernel Mailing List



> On 07-Jan-2022, at 6:17 PM, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> 
> On Fri, 07 Jan 2022, Ashish Arora <ashisharora.linux@outlook.com> wrote:
>> From: Ashish Arora <ashisharora.linux@outlook.com>
>> 
>> On certain 4k panels, the BIOS framebuffer is larger than what panel
>> requires causing display corruption. Introduce a check for the same.
> 
> This is quite thin on details. Is there a bug report?
No bug report, but an issue I am facing myself. This patch seems to fix it.
> 
> Moreover, if this is what we want, this should be combined with the
> conditions that follow resulting in a "!=" check instead of separate "<"
> and ">”.
Sending a version 2
> 
> BR,
> Jani.
> 
> 
> 
>> 
>> Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index adc3a81be..f9952e1f8 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
>> 	struct drm_i915_gem_object *obj;
>> 	int ret;
>> 
>> +	if (intel_fb &&
>> +	    (sizes->fb_width < intel_fb->base.width ||
>> +	     sizes->fb_height < intel_fb->base.height)) {
>> +		drm_dbg_kms(&dev_priv->drm,
>> +			    "BIOS fb too large (%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_put(&intel_fb->base);
>> +		intel_fb = ifbdev->fb = NULL;
>> +	}
>> 	if (intel_fb &&
>> 	    (sizes->fb_width > intel_fb->base.width ||
>> 	     sizes->fb_height > intel_fb->base.height)) {
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
@ 2022-01-07 13:59     ` Aditya Garg
  0 siblings, 0 replies; 8+ messages in thread
From: Aditya Garg @ 2022-01-07 13:59 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, Linux Kernel Mailing List



> On 07-Jan-2022, at 6:17 PM, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> 
> On Fri, 07 Jan 2022, Ashish Arora <ashisharora.linux@outlook.com> wrote:
>> From: Ashish Arora <ashisharora.linux@outlook.com>
>> 
>> On certain 4k panels, the BIOS framebuffer is larger than what panel
>> requires causing display corruption. Introduce a check for the same.
> 
> This is quite thin on details. Is there a bug report?
No bug report, but an issue I am facing myself. This patch seems to fix it.
> 
> Moreover, if this is what we want, this should be combined with the
> conditions that follow resulting in a "!=" check instead of separate "<"
> and ">”.
Sending a version 2
> 
> BR,
> Jani.
> 
> 
> 
>> 
>> Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index adc3a81be..f9952e1f8 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
>> 	struct drm_i915_gem_object *obj;
>> 	int ret;
>> 
>> +	if (intel_fb &&
>> +	    (sizes->fb_width < intel_fb->base.width ||
>> +	     sizes->fb_height < intel_fb->base.height)) {
>> +		drm_dbg_kms(&dev_priv->drm,
>> +			    "BIOS fb too large (%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_put(&intel_fb->base);
>> +		intel_fb = ifbdev->fb = NULL;
>> +	}
>> 	if (intel_fb &&
>> 	    (sizes->fb_width > intel_fb->base.width ||
>> 	     sizes->fb_height > intel_fb->base.height)) {
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
  2022-01-07 12:47   ` [Intel-gfx] " Jani Nikula
  (?)
  (?)
@ 2022-01-07 14:02   ` Aditya Garg
  -1 siblings, 0 replies; 8+ messages in thread
From: Aditya Garg @ 2022-01-07 14:02 UTC (permalink / raw)
  To: Jani Nikula, Ashish Arora; +Cc: intel-gfx, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]



On 07-Jan-2022, at 6:17 PM, Jani Nikula <jani.nikula@linux.intel.com<mailto:jani.nikula@linux.intel.com>> wrote:

On Fri, 07 Jan 2022, Ashish Arora <ashisharora.linux@outlook.com<mailto:ashisharora.linux@outlook.com>> wrote:
From: Ashish Arora <ashisharora.linux@outlook.com<mailto:ashisharora.linux@outlook.com>>

On certain 4k panels, the BIOS framebuffer is larger than what panel
requires causing display corruption. Introduce a check for the same.

This is quite thin on details. Is there a bug report?
I’d like to add on that T2 Macs also require this patch
Probably, Ashish better send a version 2

Moreover, if this is what we want, this should be combined with the
conditions that follow resulting in a "!=" check instead of separate "<"
and ">".

BR,
Jani.




Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com<mailto:ashisharora.linux@outlook.com>>
---
drivers/gpu/drm/i915/display/intel_fbdev.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index adc3a81be..f9952e1f8 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -193,6 +193,17 @@ static int intelfb_create(struct drm_fb_helper *helper,
struct drm_i915_gem_object *obj;
int ret;

+ if (intel_fb &&
+     (sizes->fb_width < intel_fb->base.width ||
+      sizes->fb_height < intel_fb->base.height)) {
+ drm_dbg_kms(&dev_priv->drm,
+     "BIOS fb too large (%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_put(&intel_fb->base);
+ intel_fb = ifbdev->fb = NULL;
+ }
if (intel_fb &&
    (sizes->fb_width > intel_fb->base.width ||
     sizes->fb_height > intel_fb->base.height)) {

--
Jani Nikula, Intel Open Source Graphics Center


[-- Attachment #2: Type: text/html, Size: 15375 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
  2022-01-08  9:59 ` [Intel-gfx] " Ashish Arora
@ 2022-01-08 10:26   ` Aun-Ali Zaidi
  0 siblings, 0 replies; 8+ messages in thread
From: Aun-Ali Zaidi @ 2022-01-08 10:26 UTC (permalink / raw)
  To: Ashish Arora
  Cc: Orlando Chamberlain, jani.nikula, intel-gfx, joonas.lahtinen,
	Linux Kernel Mailing List, rodrigo.vivi, Aditya Garg

LGTM

—
Aun-Ali Zaidi

> On Jan 8, 2022, at 3:59 AM, Ashish Arora <ashisharora.linux@outlook.com> wrote:
> 
> 
> I believe I forgot to add Aditya to the conversation. So, I am sending the patch as an attachment for those who want to test :)<0001-drm.patch>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption.
@ 2022-01-08  5:11 Orlando Chamberlain
  2022-01-08  9:59 ` [Intel-gfx] " Ashish Arora
  0 siblings, 1 reply; 8+ messages in thread
From: Orlando Chamberlain @ 2022-01-08  5:11 UTC (permalink / raw)
  To: jani.nikula
  Cc: ashisharora.linux, intel-gfx, joonas.lahtinen, linux-kernel,
	rodrigo.vivi, Aun-Ali Zaidi

I haven't observed "display corruption", but on my MacBookPro16,1 the bottom
and right edges of the TTY are not on the screen, so a few lines of text
cannot be seen.

This also occurs on the internal displays of all (as far as I know) other
2018-2020 Intel Macbooks when using the Intel GPU (The 15" and 16" ones
also have an AMDGPU, but this issue occurs when they have the Intel GPU
set as the boot gpu).

There's a similar patch that hasn't been sent upstream that people with these
Macbooks have been using:
https://github.com/aunali1/linux-mbp-arch/blob/master/7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch

Cc: Aun-Ali Zaidi <admin@kodeit.net>

--
Thanks,
Orlando


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-10 13:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 12:35 [Intel-gfx] [PATCH] drm/i915: Discard large BIOS framebuffers causing display corruption Ashish Arora
2022-01-07 12:47 ` Jani Nikula
2022-01-07 12:47   ` [Intel-gfx] " Jani Nikula
2022-01-07 13:59   ` Aditya Garg
2022-01-07 13:59     ` [Intel-gfx] " Aditya Garg
2022-01-07 14:02   ` Aditya Garg
2022-01-08  5:11 Orlando Chamberlain
2022-01-08  9:59 ` [Intel-gfx] " Ashish Arora
2022-01-08 10:26   ` Aun-Ali Zaidi

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.