From patchwork Mon Jun 5 13:28:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "liviu.dudau@arm.com" X-Patchwork-Id: 9766267 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 B6B2660353 for ; Mon, 5 Jun 2017 13:48:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE16126E56 for ; Mon, 5 Jun 2017 13:48:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2C1F27F86; Mon, 5 Jun 2017 13:48:12 +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 6402426E56 for ; Mon, 5 Jun 2017 13:48:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E3AFD89C82; Mon, 5 Jun 2017 13:48:07 +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 AF21E89C21 for ; Mon, 5 Jun 2017 13:48:05 +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 v55DSe8T023558; Mon, 5 Jun 2017 14:28:40 +0100 From: Liviu Dudau To: Petri Latvala Date: Mon, 5 Jun 2017 14:28:38 +0100 Message-Id: <20170605132840.9125-3-liviu.dudau@arm.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170605132840.9125-1-liviu.dudau@arm.com> References: <20170605132840.9125-1-liviu.dudau@arm.com> Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 2/4] 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 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 --- lib/igt_kms.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5e2ef97b..6d60a14f 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -2821,7 +2821,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 +2842,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;