From patchwork Fri Apr 1 11:09:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 12798152 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 B6D3FC433EF for ; Fri, 1 Apr 2022 11:10:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 275D210E037; Fri, 1 Apr 2022 11:10:02 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id D02FA10E036; Fri, 1 Apr 2022 11:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648811400; x=1680347400; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Sr7PZ0yF5AoPBPkHOTY/TmdDCFJOL0iMnwDWVBACMQU=; b=cCc8z+K/Odsl5rEGwl3Gl9mShdHEehsOOFzCUT6hn2rBrbEFgl5TpPlD OlQgmTbTcGEqKdP6df4qt5sR/x6KtgTvLfH8eCjgcaqqZDdmjW4n9/vUM xBpFlxHZKavEI1H98S+YgzyJxGv44AkoVkTSYeC5vPGYvQ3A34EBdnM5x DRT+pXyppVdhnMsxgD/HjdnToIT+GfdQsW0qIXN7rpN4FuYKrqi9c7Sqi 8ehCwtuapXt2oTvJwtj0mM8QBFj0+tzRAn1sTAma5W195YCtYygtuekKN At8EH95RAyIoHvFGDSdRxqCbBcRg+YDAoUduYl+bvP/4DEDyci3s9YLpU A==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="260286896" X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="260286896" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 04:09:11 -0700 X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="555433992" Received: from jasvinde-mobl.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.252.19.110]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 04:09:10 -0700 From: Matthew Auld To: igt-dev@lists.freedesktop.org Date: Fri, 1 Apr 2022 12:09:01 +0100 Message-Id: <20220401110902.446305-1-matthew.auld@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 1/2] tests/kms_pwrite_crc: handle missing get_caching 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: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" gem_get_caching is not supported on discrete. The object itself should already be coherent with the display engine as-is on such platforms, by virtue of the scanout happening via local-memory. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4903 Signed-off-by: Matthew Auld Cc: Nirmoy Das --- tests/i915/kms_pwrite_crc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/i915/kms_pwrite_crc.c b/tests/i915/kms_pwrite_crc.c index 44fcfadb..584e6a19 100644 --- a/tests/i915/kms_pwrite_crc.c +++ b/tests/i915/kms_pwrite_crc.c @@ -50,7 +50,6 @@ static void test(data_t *data) igt_output_t *output = data->output; struct igt_fb *fb = &data->fb[1]; drmModeModeInfo *mode; - uint32_t caching; void *buf; igt_crc_t crc; @@ -76,9 +75,14 @@ static void test(data_t *data) 0, 0, fb->width, fb->height, 0, 0, fb->width << 16, fb->height << 16); - /* make sure caching mode has become UC/WT */ - caching = gem_get_caching(data->drm_fd, fb->gem_handle); - igt_assert(caching == I915_CACHING_NONE || caching == I915_CACHING_DISPLAY); + if (!gem_has_lmem(data->drm_fd)) { + uint32_t caching; + + /* make sure caching mode has become UC/WT */ + caching = gem_get_caching(data->drm_fd, fb->gem_handle); + igt_assert(caching == I915_CACHING_NONE || + caching == I915_CACHING_DISPLAY); + } /* use pwrite to make the other fb all white too */ buf = malloc(fb->size); From patchwork Fri Apr 1 11:09:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 12798151 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 C31EAC433F5 for ; Fri, 1 Apr 2022 11:10:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C506B10E036; Fri, 1 Apr 2022 11:10:01 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0AAFC10E037; Fri, 1 Apr 2022 11:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648811401; x=1680347401; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NvNJ/rRFOCwq0Q8hyThto+w9VbPqZZF62YpX9J3vs6Q=; b=fR1gmdX8cS/DJkWYJoVlb3WydIyEb2FbQQYmeQif1g0/Zn0qXQHwsgh4 gjnJdlibkRcoKm2boKxJ6A84rTQNzaK2aRx4qDljuwVKgBJVLbNLGSnTO dpyK2pDe4a74j/1prwc+XS/Du3m60F11kNsieIM9GSOA0CizPz0JrLXJO HMz1Eqh999nI8B35L0rdcBEHqp8uSiS6CHwU/raOOnyPTADh+nLm7E3JY 5J4fpVSZgDT0yb1pocMhfmlrLnXSpJkQPILQFsdKa2cngRULPAXi0QPQ3 DaXWSHIK/EAvbUs5En0W3l+UkfTsG7sYY2JgcLEIycMs3m+0Y3I6xPR1Q Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="260286900" X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="260286900" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 04:09:12 -0700 X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="555433997" Received: from jasvinde-mobl.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.252.19.110]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 04:09:11 -0700 From: Matthew Auld To: igt-dev@lists.freedesktop.org Date: Fri, 1 Apr 2022 12:09:02 +0100 Message-Id: <20220401110902.446305-2-matthew.auld@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401110902.446305-1-matthew.auld@intel.com> References: <20220401110902.446305-1-matthew.auld@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 2/2] tests/gem_ctx_engines: handle missing set_caching 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: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Not supported on discrete. Here the object will already have the GTT caching bits enabled, and the mapping will be WB, which looks inline with what the test is expecting here. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4926 Signed-off-by: Matthew Auld Cc: Nirmoy Das --- tests/i915/gem_ctx_engines.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c index de4b822c..19cf9b05 100644 --- a/tests/i915/gem_ctx_engines.c +++ b/tests/i915/gem_ctx_engines.c @@ -492,7 +492,8 @@ static void independent(int i915, const intel_ctx_t *base_ctx, param.ctx_id = gem_context_create(i915); gem_context_set_param(i915, ¶m); - gem_set_caching(i915, results.handle, I915_CACHING_CACHED); + if (!gem_has_lmem(i915)) + gem_set_caching(i915, results.handle, I915_CACHING_CACHED); map = gem_mmap__cpu(i915, results.handle, 0, 4096, PROT_READ); gem_set_domain(i915, results.handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);