From patchwork Fri Apr 21 18:25:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 13220590 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 B2D94C7618E for ; Fri, 21 Apr 2023 18:26:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B5E610E333; Fri, 21 Apr 2023 18:26:21 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id CF0D510EEB5; Fri, 21 Apr 2023 18:26: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=1682101578; x=1713637578; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AXWGZZ6zBKOPvb7eg/A0U+T496YlNxQ5QoHD0SqsiZQ=; b=EHphwoqYE0j51HXfmBK+JAS2QuJ2PEzSe0JYCE5TcS4EjT0WKv7r6UmF LjvCWFbLBy6U1oEUyt8XjWS5Kgm+Dmznn5UN2RnpQFlCW1lwuETCWJ8In pafxZjJSef/X8K+jhZiO8vpND/M1duFH4W2j6mToynoESBLCwfdj0yB+m xrCsvbFBLmX3soHC+lgGADTxTyyAoYjDz0Lxo196m7pMb1XOAJyjSAkBk wKVrJl3B3crE1V1HC5hxu9vqgO776NFmIWL2MESKuYnAFla4pKDoYLrmj XU1/0GvbSyZN59GxbMwfaooFwsmCQs/Xw0ZtrW5/NjD2+uaztxGlGL3NG Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10687"; a="346072208" X-IronPort-AV: E=Sophos;i="5.99,216,1677571200"; d="scan'208";a="346072208" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 11:26:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10687"; a="756983851" X-IronPort-AV: E=Sophos;i="5.99,216,1677571200"; d="scan'208";a="756983851" Received: from ameghere-mobl2.ger.corp.intel.com (HELO intel.com) ([10.249.35.194]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 11:26:12 -0700 From: Andi Shyti To: Intel GFX , DRI Devel , Fei Yang Date: Fri, 21 Apr 2023 20:25:35 +0200 Message-Id: <20230421182535.292670-3-andi.shyti@linux.intel.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230421182535.292670-1-andi.shyti@linux.intel.com> References: <20230421182535.292670-1-andi.shyti@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 2/2] drm/i915/mtl: fix mocs selftest 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: , Cc: Andrzej Hajda , Lucas Martins De Marchi , Andi Shyti , Matt Roper , Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Fei Yang Media GT has a different base for MOCS register, need to apply gsi_offset to the mmio address if not using the intel_uncore_r/w functions for register access. Cc: Matt Roper Signed-off-by: Fei Yang Reviewed-by: Matt Roper Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gt/selftest_mocs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_mocs.c b/drivers/gpu/drm/i915/gt/selftest_mocs.c index ca009a6a13bdb..a8446ab825012 100644 --- a/drivers/gpu/drm/i915/gt/selftest_mocs.c +++ b/drivers/gpu/drm/i915/gt/selftest_mocs.c @@ -131,13 +131,14 @@ static int read_mocs_table(struct i915_request *rq, const struct drm_i915_mocs_table *table, u32 *offset) { + struct intel_gt *gt = rq->engine->gt; u32 addr; if (!table) return 0; if (HAS_GLOBAL_MOCS_REGISTERS(rq->engine->i915)) - addr = global_mocs_offset(); + addr = global_mocs_offset() + gt->uncore->gsi_offset; else addr = mocs_offset(rq->engine);