From patchwork Fri Jun 16 14:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 9791735 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 A4A3D60326 for ; Fri, 16 Jun 2017 14:00:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACA1827FB7 for ; Fri, 16 Jun 2017 14:00:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F721283FD; Fri, 16 Jun 2017 14:00:13 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham 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 4856527FB7 for ; Fri, 16 Jun 2017 14:00:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39A7E6E8F2; Fri, 16 Jun 2017 14:00:12 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8075C6E8F2 for ; Fri, 16 Jun 2017 14:00:11 +0000 (UTC) Received: from e110455-lin.cambridge.arm.com (e110455-lin.cambridge.arm.com [10.2.131.9]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v5GE06sE005088; Fri, 16 Jun 2017 15:00:06 +0100 From: Liviu Dudau To: Petri Latvala Date: Fri, 16 Jun 2017 15:00:06 +0100 Message-Id: <20170616140006.27985-1-liviu.dudau@arm.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170606103028.GA3475@ahiler-desk1.ger.corp.intel.com> References: <20170606103028.GA3475@ahiler-desk1.ger.corp.intel.com> Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v2] lib/igt_kms: Fix override_mode handling X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Brian Starkey Changelog: - v2: removed the forced overwrite of output->config.default_mode - v1: original submission by Brian igt_display_commit isn't refreshing all outputs anymore, which means that an override mode may never get picked up. Instead of forcing a reprobe to handle copying the override_mode into default_mode, just change igt_output_get_mode() to return the override_mode if it's been set, and remove the old code which would directly overwrite default_mode. This should be more robust, as igt_output_get_mode() will always return the correct mode, without needing the output to be reprobed. This change means that output->config.default_mode always contains the "non-overridden" default mode. Signed-off-by: Brian Starkey Signed-off-by: Liviu Dudau Reviewed-by: Arkadiusz Hiler --- lib/igt_kms.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5e2ef97b..2abb6b4e 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1580,9 +1580,6 @@ static void igt_output_refresh(igt_output_t *output) BROADCAST_RGB_FULL); } - if (output->use_override_mode) - output->config.default_mode = output->override_mode; - if (output->config.pipe == PIPE_NONE) return; @@ -2821,7 +2818,10 @@ const char *igt_output_name(igt_output_t *output) drmModeModeInfo *igt_output_get_mode(igt_output_t *output) { - return &output->config.default_mode; + if (output->use_override_mode) + return &output->override_mode; + else + return &output->config.default_mode; } /** @@ -2839,10 +2839,6 @@ void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode) if (mode) output->override_mode = *mode; - else /* restore default_mode, may have been overwritten in igt_output_refresh */ - kmstest_get_connector_default_mode(output->display->drm_fd, - output->config.connector, - &output->config.default_mode); output->use_override_mode = !!mode;