From: Reza Arbab <arbab@linux.ibm.com>
To: Dave Airlie <airlied@redhat.com>, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Robert Tarasov <tutankhamen@chromium.org>,
Linus Walleij <linus.walleij@linaro.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: wzabolot@elektron.elka.pw.edu.pl, "Pavel Machek" <pavel@ucw.cz>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Noralf Trønnes" <noralf@tronnes.org>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: [PATCH 2/2] drm/fb-helper: Do not scale depth down to 0
Date: Fri, 22 Mar 2019 15:56:13 -0500 [thread overview]
Message-ID: <1553288173-10845-3-git-send-email-arbab@linux.ibm.com> (raw)
In-Reply-To: <1553288173-10845-1-git-send-email-arbab@linux.ibm.com>
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
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 <arbab@linux.ibm.com>
---
drivers/gpu/drm/drm_fb_helper.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 0e9349ff2d16..a7028655a065 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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;
--
1.8.3.1
next prev parent reply other threads:[~2019-03-22 20:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-22 20:56 [PATCH 0/2] drm: udl fixes Reza Arbab
2019-03-22 20:56 ` [PATCH 1/2] drm/udl: Fix off-by-one error in udl_get_edid() Reza Arbab
2019-03-22 20:56 ` Reza Arbab [this message]
2019-03-28 16:33 ` [PATCH 2/2] drm/fb-helper: Do not scale depth down to 0 Linus Walleij
2019-03-28 16:52 ` Reza Arbab
2019-03-28 17:05 ` Reza Arbab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1553288173-10845-3-git-send-email-arbab@linux.ibm.com \
--to=arbab@linux.ibm.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=alexander.deucher@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noralf@tronnes.org \
--cc=pavel@ucw.cz \
--cc=sean@poorly.run \
--cc=tutankhamen@chromium.org \
--cc=ville.syrjala@linux.intel.com \
--cc=wzabolot@elektron.elka.pw.edu.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox