From: Alex Deucher <alexdeucher@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 5/7] drm/radeon: Limit hdmi deep color bit depth to 12 bpc.
Date: Mon, 2 Jun 2014 10:29:57 -0400 [thread overview]
Message-ID: <1401719399-6951-5-git-send-email-alexander.deucher@amd.com> (raw)
In-Reply-To: <1401719399-6951-1-git-send-email-alexander.deucher@amd.com>
From: Mario Kleiner <mario.kleiner.de@gmail.com>
DCE-4/5/6 can't support more than 12 bpc deep color over hdmi,
so clamp to 12 bpc when a hdmi deep color capable display is
connected. This even makes sense on DCE-8+, which could do up
to 16 bpc, as driving with more than 12 bpc would only waste
video bandwidth as long as we don't support framebuffers with
more than 12 bpc depth.
On pre-DCE4 we clamp hdmi bit depth to 8 bpc, as those asics
don't support hdmi deep color.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/radeon/radeon_connectors.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index bf73a04..0dc61dd 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -145,6 +145,31 @@ int radeon_get_monitor_bpc(struct drm_connector *connector)
}
break;
}
+
+ if (drm_detect_hdmi_monitor(radeon_connector->edid)) {
+ /* hdmi deep color only implemented on DCE4+ */
+ if ((bpc > 8) && !ASIC_IS_DCE4(rdev)) {
+ DRM_DEBUG("%s: HDMI deep color %d bpc unsupported. Using 8 bpc.\n",
+ drm_get_connector_name(connector), bpc);
+ bpc = 8;
+ }
+
+ /*
+ * Pre DCE-8 hw can't handle > 12 bpc, and more than 12 bpc doesn't make
+ * much sense without support for > 12 bpc framebuffers. RGB 4:4:4 at
+ * 12 bpc is always supported on hdmi deep color sinks, as this is
+ * required by the HDMI-1.3 spec. Clamp to a safe 12 bpc maximum.
+ */
+ if (bpc > 12) {
+ DRM_DEBUG("%s: HDMI deep color %d bpc unsupported. Using 12 bpc.\n",
+ drm_get_connector_name(connector), bpc);
+ bpc = 12;
+ }
+ }
+
+ DRM_DEBUG("%s: Display bpc=%d, returned bpc=%d\n",
+ drm_get_connector_name(connector), connector->display_info.bpc, bpc);
+
return bpc;
}
--
1.8.3.1
next prev parent reply other threads:[~2014-06-02 14:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-02 14:29 [PATCH 1/7] drm/radeon: only apply hdmi bpc pll flags when encoder mode is hdmi Alex Deucher
2014-06-02 14:29 ` [PATCH 2/7] drm/radeon: use hw cts/n values for deep color Alex Deucher
2014-06-02 14:29 ` [PATCH 3/7] drm/radeon: fix pll setup for hdmi deep color (v5) Alex Deucher
2014-06-02 14:29 ` [PATCH 4/7] drm/radeon: Setup HDMI_CONTROL for hdmi deep color gcp's (v2) Alex Deucher
2014-06-02 14:29 ` Alex Deucher [this message]
2014-06-02 14:29 ` [PATCH 6/7] drm/edid: Parse and handle HDMI deep color modes Alex Deucher
2014-06-02 14:29 ` [PATCH 7/7] drm/edid: Add quirk for Sony PVM-2541A to get 12 bpc hdmi deep color Alex Deucher
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=1401719399-6951-5-git-send-email-alexander.deucher@amd.com \
--to=alexdeucher@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/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