From patchwork Wed Oct 19 21:46:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 9385475 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 F3766600CA for ; Wed, 19 Oct 2016 21:46:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2A5F28DBC for ; Wed, 19 Oct 2016 21:46:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7B9728DE4; Wed, 19 Oct 2016 21:46:20 +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 9866628DBC for ; Wed, 19 Oct 2016 21:46:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 005896E9F1; Wed, 19 Oct 2016 21:46:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1771A6E9F3; Wed, 19 Oct 2016 21:45:25 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 19 Oct 2016 14:45:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,516,1473145200"; d="scan'208";a="21832198" Received: from manasi-otcmedia.jf.intel.com ([10.7.199.175]) by orsmga004.jf.intel.com with ESMTP; 19 Oct 2016 14:45:23 -0700 From: Manasi Navare To: intel-gfx@lists.freedesktop.org Date: Wed, 19 Oct 2016 14:46:19 -0700 Message-Id: <1476913584-16948-4-git-send-email-manasi.d.navare@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476913584-16948-1-git-send-email-manasi.d.navare@intel.com> References: <1476913584-16948-1-git-send-email-manasi.d.navare@intel.com> Cc: dri-devel@lists.freedesktop.org, daniel.vetter@intel.com Subject: [Intel-gfx] [PATCH RFC 3/8] drm: Trigger a complete modeset if link_train_retry is set 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 The link_train_retry property of the connector needs to be checked to see if a full modeset is required. If this is set, then link train retry is requested possibly due to linktrain failure in the previous modeset. Hence we need to indicate connector status changed in order to trigger a full modeset. Cc: dri-devel@lists.freedesktop.org Cc: Jani Nikula Cc: Daniel Vetter Cc: Ville Syrjala Signed-off-by: Manasi Navare --- drivers/gpu/drm/drm_atomic_helper.c | 9 +++++++++ drivers/gpu/drm/drm_fb_helper.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 07b432f..aeb2215 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -517,6 +517,15 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, */ ret = update_connector_routing(state, connector, connector_state); + /* Set crtc->mode_changed and crtc->connectors_changed if + * link_train_retry flag is set in the connector. + */ + if (connector->link_train_retry) { + crtc_state = drm_atomic_get_existing_crtc_state(state, + connector->state->crtc); + crtc_state->connectors_changed = true; + crtc_state->mode_changed = true; + } if (ret) return ret; } diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 8fffac8..b408e62 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2152,7 +2152,8 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) fb_crtc->desired_mode = mode; fb_crtc->x = offset->x; fb_crtc->y = offset->y; - if (modeset->mode) + if (modeset->mode && + !(fb_helper->connector_info[i]->connector->link_train_retry)) drm_mode_destroy(dev, modeset->mode); modeset->mode = drm_mode_duplicate(dev, fb_crtc->desired_mode);