From mboxrd@z Thu Jan 1 00:00:00 1970 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 7FB48C52D1D for ; Wed, 31 Jul 2024 14:52:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4028110E640; Wed, 31 Jul 2024 14:52:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="VQcBpDxp"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD56510E640 for ; Wed, 31 Jul 2024 14:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722437536; x=1753973536; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QV8REiKd257sIP9OMC/hR4/dvkYLudBIz5cmj1WQCWs=; b=VQcBpDxp8HBWlT1m4IREtjDYX+h5t1ahbkH8l8qSkf4RJ6tKG6e8mzEE LiCR56JsI59CqCdlmjk9dufyc/aPn4rLOiKe+ua9syK6e/6KOjd/oLV+V C6YRqUZQZxGJcxW6JudHk659lDubk3ksvoQ0K/x2MPPOqTrypYC8qL2iq TTbhDj3m+31GXeUT87oX/KM+f7NcmACfhllI7ew+ZEH1BSSCIT66VCPtj TwJtnKOzl0qfM9qmlFJ0vZNaKmzpRUvOopwxY8EWwhu325IzKOBupBGVa Z1TrtQEdN7M0tPeaowNLdVRiALx7A/6XFiAx3Vf2duBoqGSyVz4t0hLqN w==; X-CSE-ConnectionGUID: jBNMIGXDRti3xJ69w5S8Yw== X-CSE-MsgGUID: Jeb7E/aWRQC0SuIOPKlKzg== X-IronPort-AV: E=McAfee;i="6700,10204,11150"; a="37838506" X-IronPort-AV: E=Sophos;i="6.09,251,1716274800"; d="scan'208";a="37838506" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2024 07:52:10 -0700 X-CSE-ConnectionGUID: DEfQ4ghMQrG94r6ad+8UgQ== X-CSE-MsgGUID: /37syRENRAOGO8hvYNV5xA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,251,1716274800"; d="scan'208";a="58845538" Received: from jeevanb-desk.iind.intel.com ([10.223.74.192]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2024 07:52:08 -0700 From: Jeevan B To: igt-dev@lists.freedesktop.org Cc: bhanuprakash.modem@intel.com, kunal1.joshi@intel.com, animesh.manna@intel.com, Jeevan B Subject: [PATCH i-g-t 2/3] lib/igt_kms: Added library functions for LOBF status Date: Wed, 31 Jul 2024 20:32:51 +0530 Message-Id: <20240731150252.2951870-3-jeevan.b@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240731150252.2951870-1-jeevan.b@intel.com> References: <20240731150252.2951870-1-jeevan.b@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" Added helper functions to check LOBF status to check weather it is enabled or disabled. v2: rename function name. Signed-off-by: Jeevan B Reviewed-by: Kunal Joshi --- lib/igt_kms.c | 23 +++++++++++++++++++++++ lib/igt_kms.h | 1 + 2 files changed, 24 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 64318ef7f..e030b35a6 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -6071,6 +6071,29 @@ void igt_dump_crtcs_fd(int drmfd) drmModeFreeResources(mode_resources); } +/** + * igt_get_i915_edp_lobf_status + * @drmfd: A drm file descriptor + * @connector_name: Name of the libdrm connector we're going to use + * + * Return: True if its enabled. + */ +bool igt_get_i915_edp_lobf_status(int drmfd, char *connector_name) +{ + char buf[24]; + int fd, res; + + fd = igt_debugfs_connector_dir(drmfd, connector_name, O_RDONLY); + igt_assert(fd >= 0); + + res = igt_debugfs_simple_read(fd, "i915_edp_lobf_info", buf, sizeof(buf)); + igt_require(res > 0); + + close(fd); + + return strstr(buf, "LOBF status: enabled"); +} + /** * igt_get_output_max_bpc: * @drmfd: A drm file descriptor diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 501d48763..e8582a45b 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -1195,6 +1195,7 @@ void igt_require_pipe(igt_display_t *display, void igt_dump_connectors_fd(int drmfd); void igt_dump_crtcs_fd(int drmfd); bool igt_override_all_active_output_modes_to_fit_bw(igt_display_t *display); +bool igt_get_i915_edp_lobf_status(int drmfd, char *connector_name); unsigned int igt_get_output_max_bpc(int drmfd, char *connector_name); unsigned int igt_get_pipe_current_bpc(int drmfd, enum pipe pipe); void igt_assert_output_bpc_equal(int drmfd, enum pipe pipe, -- 2.25.1