Skip to contentSkip to conversation

drm: Fix for invalid pruning of modes in dual display cases

PATCH In review Vidya Srinivas 5 participants 7 messages Dec 13, 2016 – Jan 16, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Fix for invalid pruning of modes in dual display cases

Currently in dual display connected boot scenarios, minimum of the resolutions is taken for fb width and height as reference. Based on this resolution, other modes are pruned.

Example Scenario: If DSI mode is 2560x1440 and HDMI is 1920x1080, during the probing the fb width and height is set to max 1920x1080 and the DSI mode gets pruned as it is more than the reference. As a result, there is no DSI display.
Patch fixes this issue by taking the max of the resolutions and creating the fb based on the same.

---
 drivers/gpu/drm/drm_fb_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +4 -4
index e934b54..6afc06f 100644
@@ -1482,8 +1482,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 	memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size));
 	sizes.surface_depth = 24;
 	sizes.surface_bpp = 32;
-	sizes.fb_width = (unsigned)-1;
-	sizes.fb_height = (unsigned)-1;
+	sizes.fb_width = 0;
+	sizes.fb_height = 0;
 
 	/* if driver picks 8 or 16 by default use that
 	   for both depth/bpp */
@@ -1560,9 +1560,9 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 		}
 
 		if (lasth)
-			sizes.fb_width  = min_t(u32, desired_mode->hdisplay + x, sizes.fb_width);
+			sizes.fb_width  = max_t(u32, desired_mode->hdisplay + x, sizes.fb_width);
 		if (lastv)
-			sizes.fb_height = min_t(u32, desired_mode->vdisplay + y, sizes.fb_height);
+			sizes.fb_height = max_t(u32, desired_mode->vdisplay + y, sizes.fb_height);
 	}
 
 	if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) {
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 33 lines · Vidya Srinivas

Currently in dual display connected boot scenarios, minimum of the resolutions is taken for fb width and height as reference. Based on this resolution, other modes are pruned.

Example Scenario: If DSI mode is 2560x1440 and HDMI is 1920x1080, during the probing the fb width and height is set to max 1920x1080 and the DSI mode gets pruned as it is more than the reference. As a result, there is no DSI display.
Patch fixes this issue by taking the max of the resolutions and creating the fb based on the same.

---
 drivers/gpu/drm/drm_fb_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +2 -2
index e934b54..6afc06f 100644
@@ -1482,8 +1482,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 	memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size));
 	sizes.surface_depth = 24;
 	sizes.surface_bpp = 32;
-	sizes.fb_width = (unsigned)-1;
-	sizes.fb_height = (unsigned)-1;
+	sizes.fb_width = 0;
+	sizes.fb_height = 0;
 
 	/* if driver picks 8 or 16 by default use that
 	   for both depth/bpp */
@@ -1560,9 +1560,9 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 		}

drivers/gpu/drm/drm_fb_helper.c static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, · line 1568

Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +2 -2
 
 		if (lasth)
-			sizes.fb_width  = min_t(u32, desired_mode->hdisplay + x, sizes.fb_width);
+			sizes.fb_width  = max_t(u32, desired_mode->hdisplay + x, sizes.fb_width);
 		if (lastv)
-			sizes.fb_height = min_t(u32, desired_mode->vdisplay + y, sizes.fb_height);
+			sizes.fb_height = max_t(u32, desired_mode->vdisplay + y, sizes.fb_height);
 	}
 
 	if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) {

Not commenting on the main change itself, but just as a reminder, these checks will need updating too.

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

✓ Fi.CI.BAT: success for drm: Fix for invalid pruning of modes in dual display cases

In reply to Vidya Srinivas
== Series Details ==

== Series Details ==

Series: drm: Fix for invalid pruning of modes in dual display cases
URL : https://patchwork.freedesktop.org/series/16735/
State : success

== Summary ==

Series 16735v1 drm: Fix for invalid pruning of modes in dual display cases
https://patchwork.freedesktop.org/api/1.0/series/16735/revisions/1/mbox/

fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-t5700     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52 
fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:247  pass:227  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20 
fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32 

8b67c0219d118c761a3fa549894ac23e004a5baa drm-tip: 2016y-12m-13d-09h-19m-23s UTC integration manifest a8f0e05 drm: Fix for invalid pruning of modes in dual display cases

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3272/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to Vidya Srinivas
Quoted 9 lines · Vidya Srinivas

Currently in dual display connected boot scenarios, minimum of the resolutions is taken for fb width and height as reference. Based on this resolution, other modes are pruned.

Example Scenario: If DSI mode is 2560x1440 and HDMI is 1920x1080, during the probing the fb width and height is set to max 1920x1080 and the DSI mode gets pruned as it is more than the reference. As a result, there is no DSI display.
Patch fixes this issue by taking the max of the resolutions and creating the fb based on the same.

On the other hand, the viewable content is defined by the smaller mode. If that is the only output visible at panic time, you don't want that information lost due to it being invisible.

This is only used for fbcon, which has to be the lowest common denominator. Any actual application can set their own modes and fb. -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 11 lines · Chris Wilson
Quoted 9 lines · Vidya Srinivas

Currently in dual display connected boot scenarios, minimum of the resolutions is taken for fb width and height as reference. Based on this resolution, other modes are pruned.

Example Scenario: If DSI mode is 2560x1440 and HDMI is 1920x1080, during the probing the fb width and height is set to max 1920x1080 and the DSI mode gets pruned as it is more than the reference. As a result, there is no DSI display.
Patch fixes this issue by taking the max of the resolutions and creating the fb based on the same.

Quoted 6 lines

On the other hand, the viewable content is defined by the smaller mode. If that is the only output visible at panic time, you don't want that information lost due to it being invisible.

This is only used for fbcon, which has to be the lowest common denominator. Any actual application can set their own modes and fb.

Do we fail to take over non-native modes with scaling on DSI then? Ville?

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 16 lines · Jani Nikula
Quoted 15 lines · Chris Wilson
Quoted 9 lines · Vidya Srinivas

Currently in dual display connected boot scenarios, minimum of the resolutions is taken for fb width and height as reference. Based on this resolution, other modes are pruned.

Example Scenario: If DSI mode is 2560x1440 and HDMI is 1920x1080, during the probing the fb width and height is set to max 1920x1080 and the DSI mode gets pruned as it is more than the reference. As a result, there is no DSI display.
Patch fixes this issue by taking the max of the resolutions and creating the fb based on the same.

On the other hand, the viewable content is defined by the smaller mode. If that is the only output visible at panic time, you don't want that information lost due to it being invisible.

Quoted 5 lines
Quoted 2 lines

This is only used for fbcon, which has to be the lowest common denominator. Any actual application can set their own modes and fb.

Do we fail to take over non-native modes with scaling on DSI then? Ville?

I believe we are taking the panel fitter into account when we reconstruct the BIOS fb. So in case the BIOS is upscaling we'll come up with some less than screen size framebuffer. The fb helper will want to use the native mode of the panel however, so at some point we'll drop the BIOS fb (as it's too small) and allocate a new one.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
Quoted 33 lines

-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Tuesday, December 13, 2016 9:17 PM
To: Jani Nikula <[email protected]>
Cc: Chris Wilson <[email protected]>; Srinivas, Vidya <[email protected]>; [email protected]; Syrjala, Ville <[email protected]>; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm: Fix for invalid pruning of modes in dual display cases

Quoted 9 lines · Jani Nikula
Quoted 8 lines · Chris Wilson
Quoted 7 lines · Vidya Srinivas

Currently in dual display connected boot scenarios, minimum of the resolutions is taken for fb width and height as reference. Based on this resolution, other modes are pruned.

Example Scenario: If DSI mode is 2560x1440 and HDMI is 1920x1080, during the probing the fb width and height is set to max 1920x1080 and the DSI mode gets pruned as it is more than the reference. As a

result, there is no DSI display.

Quoted 10 lines
Quoted 9 lines
Quoted 2 lines

Patch fixes this issue by taking the max of the resolutions and creating the fb based on the same.

On the other hand, the viewable content is defined by the smaller mode. If that is the only output visible at panic time, you don't want that information lost due to it being invisible.

This is only used for fbcon, which has to be the lowest common denominator. Any actual application can set their own modes and fb.

Quoted 8 lines
Quoted 2 lines

Do we fail to take over non-native modes with scaling on DSI then? Ville?

I believe we are taking the panel fitter into account when we reconstruct the BIOS fb. So in case the BIOS is upscaling we'll come up with some less than screen size framebuffer. The fb helper will want to use the native mode of the panel however, so at some point we'll drop the BIOS fb (as it's too small) and allocate a new one.

We are not sure how to take this further. Can you please provide some inputs for next steps on this? We will try to make the changes and test as per your inputs/feedback.

Quoted 4 lines

--
Ville Syrjälä
Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx