All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v4 5/6] drm/i915: CRT pixel clock check
Date: Tue,  2 Feb 2016 15:16:42 +0200	[thread overview]
Message-ID: <1454419003-6001-6-git-send-email-mika.kahola@intel.com> (raw)
In-Reply-To: <1454419003-6001-1-git-send-email-mika.kahola@intel.com>

It is possible the we request to have a mode that has
higher pixel clock than our HW can support. This patch
checks if requested pixel clock is lower than the one
supported by the HW. The requested mode is discarded
if we cannot support the requested pixel clock.

This patch applies to CRT.

V2:
- removed computation for max pixel clock

V3:
- cleanup by removing unnecessary lines

V4:
- max_pixclk variable renamed as max_dotclk

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/intel_crt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 9c89df1..ad5dfab 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -216,6 +216,7 @@ intel_crt_mode_valid(struct drm_connector *connector,
 		     struct drm_display_mode *mode)
 {
 	struct drm_device *dev = connector->dev;
+	int max_dotclk = to_i915(dev)->max_dotclk_freq;
 
 	int max_clock = 0;
 	if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
@@ -231,6 +232,9 @@ intel_crt_mode_valid(struct drm_connector *connector,
 	if (mode->clock > max_clock)
 		return MODE_CLOCK_HIGH;
 
+	if (mode->clock > max_dotclk)
+		return MODE_CLOCK_HIGH;
+
 	/* The FDI receiver on LPT only supports 8bpc and only has 2 lanes. */
 	if (HAS_PCH_LPT(dev) &&
 	    (ironlake_get_lanes_required(mode->clock, 270000, 24) > 2))
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-02-02 13:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 13:16 [PATCH v4 0/6] Check pixel clock when setting mode Mika Kahola
2016-02-02 13:16 ` [PATCH v4 1/6] drm/i915: DisplayPort pixel clock check Mika Kahola
2016-02-02 13:16 ` [PATCH v4 2/6] drm/i915: HDMI " Mika Kahola
2016-02-02 13:16 ` [PATCH v4 3/6] drm/i915: DisplayPort-MST " Mika Kahola
2016-02-02 13:16 ` [PATCH v4 4/6] drm/i915: SDVO " Mika Kahola
2016-02-02 13:16 ` Mika Kahola [this message]
2016-02-02 13:16 ` [PATCH v4 6/6] drm/i915: TV " Mika Kahola
2016-02-02 13:44 ` ✓ Fi.CI.BAT: success for Check pixel clock when setting mode Patchwork
2016-02-02 16:25 ` [PATCH v4 0/6] " Ville Syrjälä
2016-02-11  9:16   ` Daniel Vetter
2016-02-11  9:20 ` Daniel Vetter
2016-02-11 12:36   ` Kahola, Mika

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=1454419003-6001-6-git-send-email-mika.kahola@intel.com \
    --to=mika.kahola@intel.com \
    --cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.