From patchwork Fri Jun 26 13:51:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 6681191 Return-Path: X-Original-To: patchwork-intel-gfx@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 7C64DC05AC for ; Fri, 26 Jun 2015 14:00:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9AA7F204A7 for ; Fri, 26 Jun 2015 14:00:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A83392049C for ; Fri, 26 Jun 2015 14:00:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 302376EDCA; Fri, 26 Jun 2015 07:00:17 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 0138B6EDCA for ; Fri, 26 Jun 2015 07:00:15 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 26 Jun 2015 07:00:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,685,1427785200"; d="scan'208";a="750978415" Received: from ramaling-desktop.iind.intel.com ([10.223.26.95]) by fmsmga002.fm.intel.com with ESMTP; 26 Jun 2015 07:00:12 -0700 From: Ramalingam C To: intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, chris@chris-wilson.co.uk, rodrigo.vivi@intel.com Date: Fri, 26 Jun 2015 19:21:53 +0530 Message-Id: <1435326722-24633-10-git-send-email-ramalingam.c@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1435326722-24633-1-git-send-email-ramalingam.c@intel.com> References: <1435326722-24633-1-git-send-email-ramalingam.c@intel.com> Cc: paulo.r.zanoni@intel.com Subject: [Intel-gfx] [RFC PATCH 09/18] drm/i915: Cloned mode check 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-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 If crtc is in clone mode, DRRS will be disabled. Because if the both the displays are not sharing the same vrefresh, then userspace activities based on vsync will go for toss. Clone mode will be rechecked on every restarting Idleness DRRS events. Signed-off-by: Ramalingam C --- drivers/gpu/drm/i915/intel_drrs.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_drrs.c b/drivers/gpu/drm/i915/intel_drrs.c index e5d8bcd..42b420d 100644 --- a/drivers/gpu/drm/i915/intel_drrs.c +++ b/drivers/gpu/drm/i915/intel_drrs.c @@ -16,6 +16,7 @@ #include #include +#include #include "i915_drv.h" #include "intel_drv.h" @@ -85,6 +86,31 @@ int get_free_drrs_struct_index(struct drm_i915_private *dev_priv) return -EBUSY; } +/* + * TODO: This is identifying the multiple active crtcs at a time. + * Here we assume that this is clone state and disable DRRS. + * But need to implement a proper method to find the real cloned mode + * state. DRRS need not be disabled incase of multiple crtcs with + * different content. + */ + +bool is_cloned_mode_active(struct drm_device *dev) +{ + struct drm_crtc *crtc = NULL, *tmp_crtc; + + list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) { + if (crtc && intel_crtc_active(tmp_crtc)) { + DRM_DEBUG_KMS( + "more than one crtc active. Declared as clonec mode\n"); + return true; + } + + if (intel_crtc_active(tmp_crtc)) + crtc = tmp_crtc; + } + return false; +} + void intel_set_drrs_state(struct i915_drrs *drrs) { struct drrs_info *drrs_state; @@ -158,7 +184,10 @@ static void intel_idleness_drrs_work_fn(struct work_struct *__work) panel = &drrs->connector->panel; - /* TODO: If DRRS is not supported on clone mode act here */ + /* Double check if the dual-display mode is active. */ + if (drrs->is_clone) + return; + mutex_lock(&drrs->drrs_mutex); if (panel->target_mode != NULL) DRM_ERROR("FIXME: We shouldn't be here\n"); @@ -192,6 +221,11 @@ static void intel_enable_idleness_drrs(struct i915_drrs *drrs) mutex_lock(&drrs->drrs_mutex); + drrs->is_clone = is_cloned_mode_active(drrs->connector->base.dev); + + if (drrs->is_clone) + return; + /* Capturing the deferred request for disable_drrs */ if (drrs->drrs_state.type == SEAMLESS_DRRS_SUPPORT_SW && drrs->encoder_ops->is_drrs_hr_state_pending) {