mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/vc4: Reject HDMI modes with too high of clocks.
@ 2017-09-20 22:59 Eric Anholt
  2017-09-20 22:59 ` [PATCH 2/2] drm/vc4: Update kerneldoc about CEC and power management Eric Anholt
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Anholt @ 2017-09-20 22:59 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel, Eric Anholt, Peter Robinson

Peter Robinson reported issues on Fedora with 4k monitors not having
their modes filtered down to 1920x1080 on Raspberry Pi.  Hopefully
this resolves that.

Cc: Peter Robinson <pbrobinson@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
---

Note: This is an untested patch, since I'm away from hardware
currently.

 drivers/gpu/drm/vc4/vc4_hdmi.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index fa37a1c07cf6..65826a4f208e 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -694,7 +694,22 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder)
 	}
 }
 
+static enum drm_mode_status
+vc5_hdmi_encoder_mode_valid(struct drm_encoder *crtc,
+			    const struct drm_display_mode *mode)
+{
+	/* HSM clock must be 108% of the pixel clock.  Additionally,
+	 * the AXI clock needs to be at least 25% of pixel clock, but
+	 * HSM ends up being the limiting factor.
+	 */
+	if (mode->clock > HSM_CLOCK_FREQ / (1000 * 108 / 100))
+		return MODE_CLOCK_HIGH;
+
+	return MODE_OK;
+}
+
 static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = {
+	.mode_valid = vc5_hdmi_encoder_mode_valid,
 	.disable = vc4_hdmi_encoder_disable,
 	.enable = vc4_hdmi_encoder_enable,
 };
-- 
2.14.1

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

* [PATCH 2/2] drm/vc4: Update kerneldoc about CEC and power management
  2017-09-20 22:59 [PATCH 1/2] drm/vc4: Reject HDMI modes with too high of clocks Eric Anholt
@ 2017-09-20 22:59 ` Eric Anholt
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Anholt @ 2017-09-20 22:59 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel, Eric Anholt, Boris Brezillon, Hans Verkuil

Boris had added full power management, and then Hans partially removed
it to enable CEC, so update the docs about both.

Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 65826a4f208e..ce18384c6be3 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -33,13 +33,9 @@
  * interconnect) bus to the encoder side for insertion into the video
  * blank regions.
  *
- * The driver's HDMI encoder does not yet support power management.
- * The HDMI encoder's power domain and the HSM/pixel clocks are kept
- * continuously running, and only the HDMI logic and packet ram are
- * powered off/on at disable/enable time.
- *
- * The driver does not yet support CEC control, though the HDMI
- * encoder block has CEC support.
+ * Note that HDMI CEC requires that the HSM clock be running even when
+ * not scanning out, so that input can be processed.  The PHY is still
+ * powered down when not scanning out, though.
  */
 
 #include <drm/drm_atomic_helper.h>
-- 
2.14.1

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

end of thread, other threads:[~2017-09-20 22:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20 22:59 [PATCH 1/2] drm/vc4: Reject HDMI modes with too high of clocks Eric Anholt
2017-09-20 22:59 ` [PATCH 2/2] drm/vc4: Update kerneldoc about CEC and power management Eric Anholt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®