From patchwork Tue Apr 25 16:45:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Starkey X-Patchwork-Id: 9698767 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 6B1C06020A for ; Tue, 25 Apr 2017 16:45:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59D2E28636 for ; Tue, 25 Apr 2017 16:45:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EDAC28662; Tue, 25 Apr 2017 16:45:25 +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 1072228636 for ; Tue, 25 Apr 2017 16:45:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 063136E5B6; Tue, 25 Apr 2017 16:45:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by gabe.freedesktop.org (Postfix) with ESMTP id A5DA46E5A7 for ; Tue, 25 Apr 2017 16:45:21 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8D0B11684; Tue, 25 Apr 2017 09:45:21 -0700 (PDT) Received: from e106950-lin.cambridge.arm.com (e106950-lin.cambridge.arm.com [10.2.139.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EFA543F4FF; Tue, 25 Apr 2017 09:45:20 -0700 (PDT) From: Brian Starkey To: intel-gfx@lists.freedesktop.org Date: Tue, 25 Apr 2017 17:45:08 +0100 Message-Id: <1493138713-2319-3-git-send-email-brian.starkey@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1493138713-2319-1-git-send-email-brian.starkey@arm.com> References: <1493138713-2319-1-git-send-email-brian.starkey@arm.com> Cc: liviu.dudau@arm.com Subject: [Intel-gfx] [PATCH i-g-t 2/7] 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 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 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5837a9f112a6..474aa005b9fa 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1575,9 +1575,6 @@ static void igt_output_refresh(igt_output_t *output) igt_atomic_fill_connector_props(display, output, IGT_NUM_CONNECTOR_PROPS, igt_connector_prop_names); - if (output->use_override_mode) - output->config.default_mode = output->override_mode; - if (output->config.pipe == PIPE_NONE) return; @@ -2816,7 +2813,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; } /** @@ -2834,10 +2834,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;