diff mbox series

[-,v3] drm/i915: Discard large BIOS framebuffers causing display corruption.

Message ID 31D69334-DEF9-41B7-968B-B847796926FF@outlook.com (mailing list archive)
State New, archived
Headers show
Series [-,v3] drm/i915: Discard large BIOS framebuffers causing display corruption. | expand

Commit Message

Ashish Arora Jan. 11, 2022, 7:55 a.m. UTC
From: Ashish Arora <ashisharora.linux@outlook.com>

On certain 4k panels and Macs, 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>
Reviewed-by: Aun-Ali Zaidi <admin@kodeit.net>
---
V2 :- Use != instead of < and >
V3 :- Mention Macs (Thanks to Orlando)
 drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ville Syrjälä Jan. 12, 2022, 1:37 p.m. UTC | #1
On Tue, Jan 11, 2022 at 07:55:22AM +0000, Ashish Arora wrote:
> From: Ashish Arora <ashisharora.linux@outlook.com>
> 
> On certain 4k panels and Macs, the BIOS framebuffer is larger than what
> panel requires causing display corruption. Introduce a check for the same.

If a larger fb causes corruption then there is a real bug somewhere.

> 
> 
> Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
> Reviewed-by: Aun-Ali Zaidi <admin@kodeit.net>
> ---
> V2 :- Use != instead of < and >
> V3 :- Mention Macs (Thanks to Orlando)
>  drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 842c04e63..16b1c82b2 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -181,10 +181,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
>  	int ret;
>  
>  	if (intel_fb &&
> -	    (sizes->fb_width > intel_fb->base.width ||
> -	     sizes->fb_height > intel_fb->base.height)) {
> +	    (sizes->fb_width != intel_fb->base.width ||
> +	     sizes->fb_height != intel_fb->base.height)) {
>  		drm_dbg_kms(&dev_priv->drm,
> -			    "BIOS fb too small (%dx%d), we require (%dx%d),"
> +			    "BIOS fb not valid (%dx%d), we require (%dx%d),"
>  			    " releasing it\n",
>  			    intel_fb->base.width, intel_fb->base.height,
>  			    sizes->fb_width, sizes->fb_height);
> -- 
> 2.25.1
>
Ashish Arora Jan. 12, 2022, 1:42 p.m. UTC | #2
> On 12-Jan-2022, at 7:07 PM, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 
> On Tue, Jan 11, 2022 at 07:55:22AM +0000, Ashish Arora wrote:
>> From: Ashish Arora <ashisharora.linux@outlook.com>
>> 
>> On certain 4k panels and Macs, the BIOS framebuffer is larger than what
>> panel requires causing display corruption. Introduce a check for the same.
> 
> If a larger fb causes corruption then there is a real bug somewhere.
I would like to clarify that what I meant by display corruption that some edges of screen are not seen.

Orlando described better in a mail as follows :- 

"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).”
> 
>> 
>> 
>> Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
>> Reviewed-by: Aun-Ali Zaidi <admin@kodeit.net>
>> ---
>> V2 :- Use != instead of < and >
>> V3 :- Mention Macs (Thanks to Orlando)
>> drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index 842c04e63..16b1c82b2 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -181,10 +181,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
>> 	int ret;
>> 
>> 	if (intel_fb &&
>> -	    (sizes->fb_width > intel_fb->base.width ||
>> -	     sizes->fb_height > intel_fb->base.height)) {
>> +	    (sizes->fb_width != intel_fb->base.width ||
>> +	     sizes->fb_height != intel_fb->base.height)) {
>> 		drm_dbg_kms(&dev_priv->drm,
>> -			    "BIOS fb too small (%dx%d), we require (%dx%d),"
>> +			    "BIOS fb not valid (%dx%d), we require (%dx%d),"
>> 			    " releasing it\n",
>> 			    intel_fb->base.width, intel_fb->base.height,
>> 			    sizes->fb_width, sizes->fb_height);
>> -- 
>> 2.25.1
>> 
> 
> -- 
> Ville Syrjälä
> Intel
Ashish Arora Jan. 30, 2022, 9:27 a.m. UTC | #3
> On 12-Jan-2022, at 7:07 PM, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 
> On Tue, Jan 11, 2022 at 07:55:22AM +0000, Ashish Arora wrote:
>> From: Ashish Arora <ashisharora.linux@outlook.com>
>> 
>> On certain 4k panels and Macs, the BIOS framebuffer is larger than what
>> panel requires causing display corruption. Introduce a check for the same.
> 
> If a larger fb causes corruption then there is a real bug somewhere.
Hi Ville

I and some members of the t2 linux group would like to have more details of this bug.
> 
>> 
>> 
>> Signed-off-by: Ashish Arora <ashisharora.linux@outlook.com>
>> Reviewed-by: Aun-Ali Zaidi <admin@kodeit.net>
>> ---
>> V2 :- Use != instead of < and >
>> V3 :- Mention Macs (Thanks to Orlando)
>> drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index 842c04e63..16b1c82b2 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -181,10 +181,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
>> 	int ret;
>> 
>> 	if (intel_fb &&
>> -	    (sizes->fb_width > intel_fb->base.width ||
>> -	     sizes->fb_height > intel_fb->base.height)) {
>> +	    (sizes->fb_width != intel_fb->base.width ||
>> +	     sizes->fb_height != intel_fb->base.height)) {
>> 		drm_dbg_kms(&dev_priv->drm,
>> -			    "BIOS fb too small (%dx%d), we require (%dx%d),"
>> +			    "BIOS fb not valid (%dx%d), we require (%dx%d),"
>> 			    " releasing it\n",
>> 			    intel_fb->base.width, intel_fb->base.height,
>> 			    sizes->fb_width, sizes->fb_height);
>> -- 
>> 2.25.1
>> 
> 
> -- 
> Ville Syrjälä
> Intel
Aditya Garg Jan. 3, 2025, 11:15 a.m. UTC | #4
Hello maintainers

This bug has been there for a long time, and hasn't been fixed yet. In case the Intel GPU is used as boot GPU on Apple T2 MacBooks, the bottom and right edges of the tty are no longer seen, thus making some text not visible.

It has been reported in almost all Apple T2 MacBooks with Intel GPU, which have the Retina display.

In case of a dual GPU MacBook, if the AMD dGPU is used to boot, the bug no longer exists.

This patch below was submitted 3 years ago, and it fixes this issue.

> On 11 Jan 2022, at 1:25 PM, Ashish Arora <ashisharora.linux@outlook.com> wrote:
> 
> From: Ashish Arora <ashisharora.linux@outlook.com>
> 
> On certain 4k panels and Macs, 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>
> Reviewed-by: Aun-Ali Zaidi <admin@kodeit.net>
> ---
> V2 :- Use != instead of < and >
> V3 :- Mention Macs (Thanks to Orlando)
> drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 842c04e63..16b1c82b2 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -181,10 +181,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
> int ret;
> 
> if (intel_fb &&
> -    (sizes->fb_width > intel_fb->base.width ||
> -     sizes->fb_height > intel_fb->base.height)) {
> +    (sizes->fb_width != intel_fb->base.width ||
> +     sizes->fb_height != intel_fb->base.height)) {
> drm_dbg_kms(&dev_priv->drm,
> -    "BIOS fb too small (%dx%d), we require (%dx%d),"
> +    "BIOS fb not valid (%dx%d), we require (%dx%d),"
>    " releasing it\n",
>    intel_fb->base.width, intel_fb->base.height,
>    sizes->fb_width, sizes->fb_height);
> -- 
> 2.25.1
> 
> 
>
Jani Nikula Jan. 3, 2025, 2:14 p.m. UTC | #5
On Fri, 03 Jan 2025, Aditya Garg <gargaditya08@live.com> wrote:
> Hello maintainers
>
> This bug has been there for a long time, and hasn't been fixed yet. In case the Intel GPU is used as boot GPU on Apple T2 MacBooks, the bottom and right edges of the tty are no longer seen, thus making some text not visible.
>
> It has been reported in almost all Apple T2 MacBooks with Intel GPU, which have the Retina display.
>
> In case of a dual GPU MacBook, if the AMD dGPU is used to boot, the bug no longer exists.
>
> This patch below was submitted 3 years ago, and it fixes this issue.

Please file a bug as described at [1], attaching dmesg from boot with
debugs enabled, etc.

As suggested by Ville in [2], the bug is likely elsewhere, and this just
hides it. A bigger fb shouldn't be a problem, and we shouldn't add this
limitation everywhere because of the issue you're seeing.

BR,
Jani.



[1] https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html

[2] https://lore.kernel.org/r/Yd7ZnBlU0sjP4qcG@intel.com

>
>> On 11 Jan 2022, at 1:25 PM, Ashish Arora <ashisharora.linux@outlook.com> wrote:
>> 
>> From: Ashish Arora <ashisharora.linux@outlook.com>
>> 
>> On certain 4k panels and Macs, 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>
>> Reviewed-by: Aun-Ali Zaidi <admin@kodeit.net>
>> ---
>> V2 :- Use != instead of < and >
>> V3 :- Mention Macs (Thanks to Orlando)
>> drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index 842c04e63..16b1c82b2 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -181,10 +181,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
>> int ret;
>> 
>> if (intel_fb &&
>> -    (sizes->fb_width > intel_fb->base.width ||
>> -     sizes->fb_height > intel_fb->base.height)) {
>> +    (sizes->fb_width != intel_fb->base.width ||
>> +     sizes->fb_height != intel_fb->base.height)) {
>> drm_dbg_kms(&dev_priv->drm,
>> -    "BIOS fb too small (%dx%d), we require (%dx%d),"
>> +    "BIOS fb not valid (%dx%d), we require (%dx%d),"
>>    " releasing it\n",
>>    intel_fb->base.width, intel_fb->base.height,
>>    sizes->fb_width, sizes->fb_height);
>> -- 
>> 2.25.1
>> 
>> 
>> 
>
Aditya Garg Jan. 7, 2025, 12:25 p.m. UTC | #6
Here are the logs requested as per the link you sent me:

1. uname -a:

Linux MacBook 6.12.8-1-t2-noble #1 SMP PREEMPT_DYNAMIC Fri Jan 3 15:43:23 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

2. lspci -vnn -d :*:0300:

00:02.0 VGA compatible controller [0300]: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630] [8086:3e9b] (prog-if 00 [VGA controller])
	Subsystem: Apple Inc. CoffeeLake-H GT2 [UHD Graphics 630] [106b:019c]
	Flags: bus master, fast devsel, latency 0, IRQ 93, IOMMU group 0
	Memory at 80000000 (64-bit, non-prefetchable) [size=16M]
	Memory at a0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at 4000 [size=64]
	Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
	Capabilities: [40] Vendor Specific Information: Len=0c <?>
	Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
	Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [d0] Power Management version 2
	Capabilities: [100] Process Address Space ID (PASID)
	Capabilities: [200] Address Translation Service (ATS)
	Capabilities: [300] Page Request Interface (PRI)
	Kernel driver in use: i915
	Kernel modules: i915

03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] [1002:7340] (rev 43) (prog-if 00 [VGA controller])
	Subsystem: Apple Inc. Navi 14 [Radeon RX 5500/5500M / Pro 5500M] [106b:0210]
	Flags: bus master, fast devsel, latency 0, IRQ 97, IOMMU group 2
	Memory at 4100000000 (64-bit, prefetchable) [size=4G]
	Memory at 4080000000 (64-bit, prefetchable) [size=2M]
	I/O ports at 3000 [size=256]
	Memory at 81500000 (32-bit, non-prefetchable) [size=512K]
	Expansion ROM at 81580000 [disabled] [size=128K]
	Capabilities: [48] Vendor Specific Information: Len=08 <?>
	Capabilities: [50] Power Management version 3
	Capabilities: [64] Express Legacy Endpoint, MSI 00
	Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
	Capabilities: [150] Advanced Error Reporting
	Capabilities: [200] Physical Resizable BAR
	Capabilities: [240] Power Budgeting <?>
	Capabilities: [270] Secondary PCI Express
	Capabilities: [2a0] Access Control Services
	Capabilities: [2b0] Address Translation Service (ATS)
	Capabilities: [2c0] Page Request Interface (PRI)
	Capabilities: [2d0] Process Address Space ID (PASID)
	Capabilities: [320] Latency Tolerance Reporting
	Capabilities: [400] Data Link Feature <?>
	Capabilities: [410] Physical Layer 16.0 GT/s <?>
	Capabilities: [440] Lane Margining at the Receiver <?>
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu

3. dmidecode:

https://pastebin.com/rNDittEZ

4. dmesg:

https://gist.github.com/AdityaGarg8/44cf973ac5cf5eac53246dce67e437ab

5. xrandr --verbose

https://pastebin.com/9ufbbBCc

> On 3 Jan 2025, at 7:44 PM, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> 
> On Fri, 03 Jan 2025, Aditya Garg <gargaditya08@live.com> wrote:
>> Hello maintainers
>> 
>> This bug has been there for a long time, and hasn't been fixed yet. In case the Intel GPU is used as boot GPU on Apple T2 MacBooks, the bottom and right edges of the tty are no longer seen, thus making some text not visible.
>> 
>> It has been reported in almost all Apple T2 MacBooks with Intel GPU, which have the Retina display.
>> 
>> In case of a dual GPU MacBook, if the AMD dGPU is used to boot, the bug no longer exists.
>> 
>> This patch below was submitted 3 years ago, and it fixes this issue.
> 
> Please file a bug as described at [1], attaching dmesg from boot with
> debugs enabled, etc.
> 
> As suggested by Ville in [2], the bug is likely elsewhere, and this just
> hides it. A bigger fb shouldn't be a problem, and we shouldn't add this
> limitation everywhere because of the issue you're seeing.
> 
> BR,
> Jani.
> 
> 
> 
> [1] https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html
> 
> [2] https://lore.kernel.org/r/Yd7ZnBlU0sjP4qcG@intel.com
> 
>> 
>>> On 11 Jan 2022, at 1:25 PM, Ashish Arora <ashisharora.linux@outlook.com> wrote:
>>> 
>>> From: Ashish Arora <ashisharora.linux@outlook.com>
>>> 
>>> On certain 4k panels and Macs, 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>
>>> Reviewed-by: Aun-Ali Zaidi <admin@kodeit.net>
>>> ---
>>> V2 :- Use != instead of < and >
>>> V3 :- Mention Macs (Thanks to Orlando)
>>> drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>>> index 842c04e63..16b1c82b2 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>>> @@ -181,10 +181,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
>>> int ret;
>>> 
>>> if (intel_fb &&
>>> -    (sizes->fb_width > intel_fb->base.width ||
>>> -     sizes->fb_height > intel_fb->base.height)) {
>>> +    (sizes->fb_width != intel_fb->base.width ||
>>> +     sizes->fb_height != intel_fb->base.height)) {
>>> drm_dbg_kms(&dev_priv->drm,
>>> -    "BIOS fb too small (%dx%d), we require (%dx%d),"
>>> +    "BIOS fb not valid (%dx%d), we require (%dx%d),"
>>>   " releasing it\n",
>>>   intel_fb->base.width, intel_fb->base.height,
>>>   sizes->fb_width, sizes->fb_height);
>>> -- 
>>> 2.25.1
>>> 
>>> 
>>> 
>> 
> 
> -- 
> Jani Nikula, Intel
Jani Nikula Jan. 7, 2025, 12:32 p.m. UTC | #7
On Tue, 07 Jan 2025, Aditya Garg <gargaditya08@live.com> wrote:
> Here are the logs requested as per the link you sent me:

It also says, "Please file issues in the drm/i915 issue tracker for i915
driver bugs"

I was looking to have that issue created with the logs attached there
instead of mailing lists and pastebins and whatnot.

https://gitlab.freedesktop.org/drm/i915/kernel/-/issues


BR,
Jani.
Aditya Garg Jan. 7, 2025, 2:32 p.m. UTC | #8
https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13466

I’ve filed it there.

> On 7 Jan 2025, at 6:02 PM, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> 
> On Tue, 07 Jan 2025, Aditya Garg <gargaditya08@live.com> wrote:
>> Here are the logs requested as per the link you sent me:
> 
> It also says, "Please file issues in the drm/i915 issue tracker for i915
> driver bugs"
> 
> I was looking to have that issue created with the logs attached there
> instead of mailing lists and pastebins and whatnot.
> 
> https://gitlab.freedesktop.org/drm/i915/kernel/-/issues
> 
> 
> BR,
> Jani.
> 
> 
> -- 
> Jani Nikula, Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 842c04e63..16b1c82b2 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -181,10 +181,10 @@  static int intelfb_create(struct drm_fb_helper *helper,
 	int ret;
 
 	if (intel_fb &&
-	    (sizes->fb_width > intel_fb->base.width ||
-	     sizes->fb_height > intel_fb->base.height)) {
+	    (sizes->fb_width != intel_fb->base.width ||
+	     sizes->fb_height != intel_fb->base.height)) {
 		drm_dbg_kms(&dev_priv->drm,
-			    "BIOS fb too small (%dx%d), we require (%dx%d),"
+			    "BIOS fb not valid (%dx%d), we require (%dx%d),"
 			    " releasing it\n",
 			    intel_fb->base.width, intel_fb->base.height,
 			    sizes->fb_width, sizes->fb_height);