drm: udl fixes
Subsystems (3)
cover drm: udl fixes
These fixes were needed to bring my udl devices to life on v5.1-rc1.
Reza Arbab (2):
drm/udl: Fix off-by-one error in udl_get_edid()
drm/fb-helper: Do not scale depth down to 0
drivers/gpu/drm/drm_fb_helper.c | 6 +++++- drivers/gpu/drm/udl/udl_connector.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 drm/udl: Fix off-by-one error in udl_get_edid()
The loop which reads EDID extension blocks is off by one. Fix it.
--- drivers/gpu/drm/udl/udl_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/udl/udl_connector.c +1 -1
@@ -71,7 +71,7 @@ static bool udl_get_edid(struct udl_device *udl, u8 **result_buff,memcpy (buff_ptr, block_buff,EDID_LENGTH );kfree (block_buff); buff_ptr +=EDID_LENGTH ; -for (i =1 ; i < extensions; ++i) { +for (i =1 ; i <= extensions; ++i) {if (udl_get_edid_block (udl, i, buff_ptr)) { buff_ptr +=EDID_LENGTH ; }else {
Signature · 1 line
1.8.3.1
PATCH 2/2 drm/fb-helper: Do not scale depth down to 0
In reply to Reza ArbabIf the scaling loop in drm_fb_helper_single_fb_probe() only finds supported depths greater than what it's looking for, it will set sizes.surface_depth = 0. This broke my udl device:
[drm] test CRTC 0 primary plane
udl 3-9.1:1.0: drm_fb_helper_single_fb_probe: test CRTC 0 format 0, depth=24 udl 3-9.1:1.0: drm_fb_helper_single_fb_probe: 24 > 16, skipping udl 3-9.1:1.0: drm_fb_helper_single_fb_probe: test CRTC 0 format 1, depth=32 udl 3-9.1:1.0: drm_fb_helper_single_fb_probe: 32 > 16, skipping [drm] requested bpp 16, scaled depth down to 0
Instead of setting zero depth, print that scaling was not possible and do nothing.
--- drivers/gpu/drm/drm_fb_helper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_fb_helper.c +5 -1
@@ -1963,7 +1963,11 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, best_depth = fmt->depth; } } -if (sizes.surface_depth != best_depth) { + +if (!best_depth) { +DRM_INFO ("Could not scale depth to requested bpp %d" , + sizes.surface_bpp); + }else if (sizes.surface_depth != best_depth) {DRM_INFO ("requested bpp %d, scaled depth down to %d" , sizes.surface_bpp, best_depth); sizes.surface_depth = best_depth;
Signature · 1 line
1.8.3.1
Re: [PATCH 2/2] drm/fb-helper: Do not scale depth down to 0
Quoted 11 lines · Reza Arbab
If the scaling loop in
drm_fb_helper_single_fb_probe()only finds supported depths greater than what it's looking for, it will set sizes.surface_depth = 0. This broke my udl device:[drm] test CRTC 0 primary plane
udl 3-9.1:1.0:drm_fb_helper_single_fb_probe: test CRTC 0 format 0, depth=24 udl 3-9.1:1.0:drm_fb_helper_single_fb_probe: 24 > 16, skipping udl 3-9.1:1.0:drm_fb_helper_single_fb_probe: test CRTC 0 format 1, depth=32 udl 3-9.1:1.0:drm_fb_helper_single_fb_probe: 32 > 16, skipping [drm] requested bpp 16, scaled depth down to 0
Quoted 5 lines
Instead of setting zero depth, print that scaling was not possible and do nothing.
Fixes f4bd542bcaee ("drm/fb-helper: Scale back depth to supported maximum")Signed-off-by Reza Arbab <[email protected]>
This makes perfect sense, but Dave Airlie already sent a similar patch some two weeks ago, I wonder what happened with it? Subject "avoid setting 0 depth".
Yours,
Linus Walleij
Re: [PATCH 2/2] drm/fb-helper: Do not scale depth down to 0
Quoted 3 lines · Linus Walleij
This makes perfect sense, but Dave Airlie already sent a similar patch some two weeks ago, I wonder what happened with it? Subject "avoid setting 0 depth".
Argh, that he did! I'm not subscribed to dri-devel so I didn't see that.
Did this get lost? The other patch from that series has been applied; 8f3b487685b2 ("drm/udl: use drm_gem_object_put_unlocked.")
Signature · 1 line
Reza Arbab
Re: [PATCH 2/2] drm/fb-helper: Do not scale depth down to 0
Quoted 8 lines · Reza Arbab
Quoted 3 lines · Linus Walleij
This makes perfect sense, but Dave Airlie already sent a similar patch some two weeks ago, I wonder what happened with it? Subject "avoid setting 0 depth".
Argh, that he did! I'm not subscribed to dri-devel so I didn't see that.
Did this get lost? The other patch from that series has been applied;
8f3b487685b2("drm/udl: usedrm_gem_object_put_unlocked.")
Never mind. It's in the drm-fixes tree. Looks like both of my patches got beaten to the punch there:
a51143001d9e ("drm/udl: Refactor edid retrieving in UDL driver (v2)") b6a36e5ddf84 ("drm/fb: avoid setting 0 depth.")
Signature · 1 line
Reza Arbab