dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked.
@ 2019-03-15  1:46 Dave Airlie
  2019-03-15  1:46 ` [PATCH 2/2] drm/fb: avoid setting 0 depth Dave Airlie
  2019-03-15 11:22 ` [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked Daniel Vetter
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Airlie @ 2019-03-15  1:46 UTC (permalink / raw)
  To: dri-devel; +Cc: Dave Airlie, Sean Paul, Daniel Vetter

From: Dave Airlie <airlied@redhat.com>

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 <daniel.vetter@ffwll.ch>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/udl/udl_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
index d5a23295dd80..bb7b58407039 100644
--- a/drivers/gpu/drm/udl/udl_gem.c
+++ b/drivers/gpu/drm/udl/udl_gem.c
@@ -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;
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/fb: avoid setting 0 depth.
  2019-03-15  1:46 [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked Dave Airlie
@ 2019-03-15  1:46 ` Dave Airlie
  2019-03-15  9:52   ` Linus Walleij
  2019-03-15 11:22 ` [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Airlie @ 2019-03-15  1:46 UTC (permalink / raw)
  To: dri-devel; +Cc: Dave Airlie, Daniel Vetter

From: Dave Airlie <airlied@redhat.com>

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 <daniel.vetter@ffwll.ch>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 0e9349ff2d16..af2ab640cadb 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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;
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] drm/fb: avoid setting 0 depth.
  2019-03-15  1:46 ` [PATCH 2/2] drm/fb: avoid setting 0 depth Dave Airlie
@ 2019-03-15  9:52   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2019-03-15  9:52 UTC (permalink / raw)
  To: Dave Airlie; +Cc: Dave Airlie, open list:DRM PANEL DRIVERS, Daniel Vetter

On Fri, Mar 15, 2019 at 2:46 AM Dave Airlie <airlied@gmail.com> wrote:

> From: Dave Airlie <airlied@redhat.com>
>
> 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 <daniel.vetter@ffwll.ch>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Good catch! Sorry for not seeing this risk...
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked.
  2019-03-15  1:46 [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked Dave Airlie
  2019-03-15  1:46 ` [PATCH 2/2] drm/fb: avoid setting 0 depth Dave Airlie
@ 2019-03-15 11:22 ` Daniel Vetter
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2019-03-15 11:22 UTC (permalink / raw)
  To: Dave Airlie; +Cc: Dave Airlie, Sean Paul, dri-devel, Daniel Vetter

On Fri, Mar 15, 2019 at 11:46:20AM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> 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 <daniel.vetter@ffwll.ch>
> Cc: Sean Paul <seanpaul@chromium.org>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/udl/udl_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
> index d5a23295dd80..bb7b58407039 100644
> --- a/drivers/gpu/drm/udl/udl_gem.c
> +++ b/drivers/gpu/drm/udl/udl_gem.c
> @@ -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;
> -- 
> 2.20.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-15 11:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-15  1:46 [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked Dave Airlie
2019-03-15  1:46 ` [PATCH 2/2] drm/fb: avoid setting 0 depth Dave Airlie
2019-03-15  9:52   ` Linus Walleij
2019-03-15 11:22 ` [PATCH 1/2] drm/udl: use drm_gem_object_put_unlocked Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).