From patchwork Thu Jun 28 19:43:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10494995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B8EC60325 for ; Thu, 28 Jun 2018 19:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A3912A1B4 for ; Thu, 28 Jun 2018 19:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E7692A237; Thu, 28 Jun 2018 19:43:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 123B52A1B4 for ; Thu, 28 Jun 2018 19:43:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 128B06EE91; Thu, 28 Jun 2018 19:43:29 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2EA276EE8A; Thu, 28 Jun 2018 19:43:20 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 12:43:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,284,1526367600"; d="scan'208";a="70811370" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 28 Jun 2018 12:43:17 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 28 Jun 2018 22:43:16 +0300 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Date: Thu, 28 Jun 2018 22:43:01 +0300 Message-Id: <20180628194301.31694-6-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180628194301.31694-1-ville.syrjala@linux.intel.com> References: <20180628194301.31694-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 6/6] drm/i915: Filter out modes that don't match the fixed mode vrefresh X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä We only ever drive the panel with the fixed mode, hence we don't want to advertize any modes that have a different vertical refresh rate. We tried to allow a second lower clocked mode to used for eDP but that was reverted in commit d93fa1b47b8f ("Revert "drm/i915/edp: Allow alternate fixed mode for eDP if available.""). To do that properly I think we should probably just keep all (or just some?) of the probed modes around (presumably all of them actually work if the panel advertizes them), and we'd just pick the closest match based on the user mode. For now we don't have any of that so we shouldn't lie to the user that they can drive the panel at different refresh rate. Note that we still don't reject any user mode with bad refresh rate. That's going to be step two. TODO: Should we allow for a larger error margin? Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_dp.c | 3 +++ drivers/gpu/drm/i915/intel_dsi.c | 2 ++ drivers/gpu/drm/i915/intel_dvo.c | 2 ++ drivers/gpu/drm/i915/intel_lvds.c | 2 ++ drivers/gpu/drm/i915/intel_sdvo.c | 2 ++ 5 files changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 5be07e1d816d..22feb0b144f6 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -446,6 +446,9 @@ intel_dp_mode_valid(struct drm_connector *connector, if (mode->vdisplay > fixed_mode->vdisplay) return MODE_PANEL; + if (mode->vrefresh != fixed_mode->vrefresh) + return MODE_PANEL; + target_clock = fixed_mode->clock; } diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index 3b7acb5a70b3..3d0758cec85a 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c @@ -1277,6 +1277,8 @@ intel_dsi_mode_valid(struct drm_connector *connector, return MODE_PANEL; if (mode->vdisplay > fixed_mode->vdisplay) return MODE_PANEL; + if (mode->vrefresh != fixed_mode->vrefresh) + return MODE_PANEL; if (fixed_mode->clock > max_dotclk) return MODE_CLOCK_HIGH; } diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index 4e142ff49708..078bb848a49a 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c @@ -225,6 +225,8 @@ intel_dvo_mode_valid(struct drm_connector *connector, return MODE_PANEL; if (mode->vdisplay > fixed_mode->vdisplay) return MODE_PANEL; + if (mode->vrefresh != fixed_mode->vrefresh) + return MODE_PANEL; target_clock = fixed_mode->clock; } diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index bb06744d28a4..d312a8911b89 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -384,6 +384,8 @@ intel_lvds_mode_valid(struct drm_connector *connector, return MODE_PANEL; if (mode->vdisplay > fixed_mode->vdisplay) return MODE_PANEL; + if (mode->vrefresh != fixed_mode->vrefresh) + return MODE_PANEL; if (fixed_mode->clock > max_pixclk) return MODE_CLOCK_HIGH; diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index cd5d5e800486..4be4bae51652 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -1650,6 +1650,8 @@ intel_sdvo_mode_valid(struct drm_connector *connector, return MODE_PANEL; if (mode->vdisplay > fixed_mode->vdisplay) + + if (mode->vrefresh != fixed_mode->vrefresh) return MODE_PANEL; }