Skip to contentSkip to conversation

drm/udl: use drm_gem_object_put_unlocked.

PATCH In review Dave Airlie 3 participants 4 messages Mar 15, 2019

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/2 drm/udl: use drm_gem_object_put_unlocked.

From: Dave Airlie <[email protected]>

When Daniel removed struct_mutex he didn't fix this call to the unlocked variant which is required since we no longer use struct mutex.

This fixes a bunch of:

WARNING: CPU: 4 PID: 1370 at drivers/gpu/drm/drm_gem.c:931 drm_gem_object_put+0x2b/0x30 [drm]
Modules linked in: udl xt_CHECKSUM ipt_MASQUERADE tun bridge stp llc nf_conntrack_netbios_ns nf_conntrack_broadcast xt_CT ip6t>
CPU: 4 PID: 1370 Comm: Xorg Not tainted 5.0.0+ #2

backtraces when you plug in a udl device.

Fixes ae358dacd217 (drm/udl: Get rid of dev->struct_mutex usage)
Cc Daniel Vetter <[email protected]>
Cc Sean Paul <[email protected]>
---
 drivers/gpu/drm/udl/udl_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/udl/udl_gem.c +1 -1
index d5a23295dd80..bb7b58407039 100644
@@ -224,7 +224,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev,
 	*offset = drm_vma_node_offset_addr(&gobj->base.vma_node);
 
 out:
-	drm_gem_object_put(&gobj->base);
+	drm_gem_object_put_unlocked(&gobj->base);
 unlock:
 	mutex_unlock(&udl->gem_lock);
 	return ret;
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#1 lore raw

PATCH 2/2 drm/fb: avoid setting 0 depth.

From: Dave Airlie <[email protected]>

If the downscaling fails and we end up with a best_depth of 0, then ignore it.

This actually works around a cascade of failure, but it the simplest fix for now.

The scaling patch broke the udl driver, as the udl driver doesn't expose planes at all, so gets the two default 32-bit formats, but the udl driver then ask for 16bpp fbdev, and the scaling code falls over.

This fixes the udl driver since the scaled depth support was added.

Fixes f4bd542bcaee (drm/fb-helper: Scale back depth to supported maximum)
Cc Daniel Vetter <[email protected]>
Cc Linus Walleij <[email protected]>
---
 drivers/gpu/drm/drm_fb_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 0e9349ff2d16..af2ab640cadb 100644
@@ -1963,7 +1963,7 @@ 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 (sizes.surface_depth != best_depth && best_depth) {
 		DRM_INFO("requested bpp %d, scaled depth down to %d",
 			 sizes.surface_bpp, best_depth);
 		sizes.surface_depth = best_depth;
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/fb: avoid setting 0 depth.

Quoted 13 lines · Dave Airlie

From: Dave Airlie <[email protected]>

If the downscaling fails and we end up with a best_depth of 0, then ignore it.

This actually works around a cascade of failure, but it the simplest fix for now.

The scaling patch broke the udl driver, as the udl driver doesn't expose planes at all, so gets the two default 32-bit formats, but the udl driver then ask for 16bpp fbdev, and the scaling code falls over.

Quoted 6 lines

This fixes the udl driver since the scaled depth support was added.

Fixes f4bd542bcaee (drm/fb-helper: Scale back depth to supported maximum)
Cc Daniel Vetter <[email protected]>
Cc Linus Walleij <[email protected]>

Good catch! Sorry for not seeing this risk...

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/2
#3 lore raw
In reply to Dave Airlie
Quoted 10 lines · Dave Airlie

From: Dave Airlie <[email protected]>

When Daniel removed struct_mutex he didn't fix this call to the unlocked variant which is required since we no longer use struct mutex.

This fixes a bunch of:

WARNING: CPU: 4 PID: 1370 at drivers/gpu/drm/drm_gem.c:931 drm_gem_object_put+0x2b/0x30 [drm]
Modules linked in: udl xt_CHECKSUM ipt_MASQUERADE tun bridge stp llc nf_conntrack_netbios_ns nf_conntrack_broadcast xt_CT ip6t>
CPU: 4 PID: 1370 Comm: Xorg Not tainted 5.0.0+ #2
Quoted 6 lines

backtraces when you plug in a udl device.

Fixes ae358dacd217 (drm/udl: Get rid of dev->struct_mutex usage)
Cc Daniel Vetter <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 20 lines
---
 drivers/gpu/drm/udl/udl_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/udl/udl_gem.c +1 -1
index d5a23295dd80..bb7b58407039 100644
@@ -224,7 +224,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev,
 	*offset = drm_vma_node_offset_addr(&gobj->base.vma_node);
 
 out:
-	drm_gem_object_put(&gobj->base);
+	drm_gem_object_put_unlocked(&gobj->base);
 unlock:
 	mutex_unlock(&udl->gem_lock);
 	return ret;
Signature · 1 line
2.20.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel