Commit b6a36e5d authored by Dave Airlie's avatar Dave Airlie

drm/fb: avoid setting 0 depth.

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: f4bd542b ("drm/fb-helper: Scale back depth to supported maximum")
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190315014621.21816-2-airlied@gmail.com
parent 8c2ffd91
...@@ -1963,7 +1963,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, ...@@ -1963,7 +1963,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
best_depth = fmt->depth; 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", DRM_INFO("requested bpp %d, scaled depth down to %d",
sizes.surface_bpp, best_depth); sizes.surface_bpp, best_depth);
sizes.surface_depth = best_depth; sizes.surface_depth = best_depth;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment