From patchwork Wed Jun 14 05:17:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Hogander, Jouni" X-Patchwork-Id: 13279538 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5232AEB64D8 for ; Wed, 14 Jun 2023 05:18:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF6AD10E0D5; Wed, 14 Jun 2023 05:18:19 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id A244B10E0D5 for ; Wed, 14 Jun 2023 05:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686719898; x=1718255898; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XZzHGnNKHOnnuadzPhCEzf7IILw4V7bCBPiK6NYA3uk=; b=LhioQt5AtX9UiRlEOnsB836gSJkodX+m+vO+T5bllmzBfG932lb6LllC Vyc4cgB7pRLRNifPODfkQ9CtRlAZydCRF2BlKfKJEgWRYzcfcmVCyNM/k +yvxJbVncSj+DY0pBhF0Ex9PUo7jLhZ80zCANUhJgRAftBRkycGxCdYRk 0oeNhRQ8xMi2Hvhwm2MseMAnK/3YHTjDPb8KUIr3FJE87/+HH7LfKon9o QM1lXGyR4eTclaRLVYxQxP6acXvWzWQKqhCnZRQn5Q+bJk9VJO/jI0aOw q4+a8TJ5o9QC+qHl1QYV5rjbDYuuXfabL9zb4jnigEwLAnXyrPUQAUC2E w==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="348184433" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="348184433" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 22:18:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="715059455" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="715059455" Received: from lcoutoda-mobl.ger.corp.intel.com (HELO jhogande-mobl1.ger.corp.intel.com) ([10.252.63.4]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 22:18:16 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Date: Wed, 14 Jun 2023 08:17:30 +0300 Message-Id: <20230614051731.745821-3-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230614051731.745821-1-jouni.hogander@intel.com> References: <20230614051731.745821-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH v2 2/3] drm/i915/fbc: Make FBC check stolen at use time X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" As a preparation for Xe change stolen memory initialization check to be done in use-time instead of during initialization. In case of xe, stolen memory is initialised much later so it can't be checked during init. There is no specific reason to check this in init for i915 either -> perform the check in use-time. This also gives us benefit fbc_no_reason reporting missing initialization being reason for disabled fbc. Signed-off-by: Jouni Högander Signed-off-by: Maarten Lankhorst Reviewed-by: Jeevan B --- drivers/gpu/drm/i915/display/intel_fbc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index a18e84efe911..da8166eedf93 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -1056,6 +1056,11 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state, if (!fbc) return 0; + if (!i915_gem_stolen_initialized(i915)) { + plane_state->no_fbc_reason = "stolen memory not initialised"; + return 0; + } + if (intel_vgpu_active(i915)) { plane_state->no_fbc_reason = "VGPU active"; return 0; @@ -1709,9 +1714,6 @@ void intel_fbc_init(struct drm_i915_private *i915) { enum intel_fbc_id fbc_id; - if (!i915_gem_stolen_initialized(i915)) - DISPLAY_RUNTIME_INFO(i915)->fbc_mask = 0; - if (need_fbc_vtd_wa(i915)) DISPLAY_RUNTIME_INFO(i915)->fbc_mask = 0;