From patchwork Thu Mar 19 04:33:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 6045811 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1F32ABF90F for ; Thu, 19 Mar 2015 04:34:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5443D204AF for ; Thu, 19 Mar 2015 04:34:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6F70320465 for ; Thu, 19 Mar 2015 04:33:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8001B8955D; Wed, 18 Mar 2015 21:33:54 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by gabe.freedesktop.org (Postfix) with ESMTP id 55FD86E950 for ; Wed, 18 Mar 2015 21:33:43 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id 4CF4A600621 From: Daniel Stone To: dri-devel@lists.freedesktop.org Subject: [RFC PATCH 05/37] drm: Exynos: Remove mode validation inside mode_fixup Date: Thu, 19 Mar 2015 04:33:04 +0000 Message-Id: <1426739616-10635-5-git-send-email-daniels@collabora.com> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1426739616-10635-1-git-send-email-daniels@collabora.com> References: <1426739556-10429-1-git-send-email-daniels@collabora.com> <1426739616-10635-1-git-send-email-daniels@collabora.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP mode_valid is the callback we already have to check whether or not a mode is valid. So there's no need to validate again inside mode_fixup, and there's really very definitely no need to select a totally different mode. Apparently the plan was to, if a 1366x768 mode was advertised but couldn't be expressed in the PHY, silently pick 1024x768 instead and never tell the user about it, resulting in a good chunk of the display going missing. Just remove the entire double-validation-and-find-new-mode code; if we need to fiddle around the margins to find an acceptable pixel clock, that should be done at the very least by not completely mangling [hv]display. Signed-off-by: Daniel Stone --- drivers/gpu/drm/exynos/exynos_hdmi.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 229b361..1593b89 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1155,37 +1155,9 @@ static void hdmi_mode_fixup(struct exynos_drm_display *display, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct drm_display_mode *m; - int mode_ok; - DRM_DEBUG_KMS("%s\n", __FILE__); drm_mode_set_crtcinfo(adjusted_mode, 0); - - mode_ok = hdmi_mode_valid(connector, adjusted_mode); - - /* just return if user desired mode exists. */ - if (mode_ok == MODE_OK) - return; - - /* - * otherwise, find the most suitable mode among modes and change it - * to adjusted_mode. - */ - list_for_each_entry(m, &connector->modes, head) { - mode_ok = hdmi_mode_valid(connector, m); - - if (mode_ok == MODE_OK) { - DRM_INFO("desired mode doesn't exist so\n"); - DRM_INFO("use the most suitable mode among modes.\n"); - - DRM_DEBUG_KMS("Adjusted Mode: [%d]x[%d] [%d]Hz\n", - m->hdisplay, m->vdisplay, m->vrefresh); - - drm_mode_copy(adjusted_mode, m); - break; - } - } } static void hdmi_set_acr(u32 freq, u8 *acr)