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
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);