Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3234340iog; Mon, 20 Jun 2022 14:49:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u/X3nNkOrXN0I/WqnhUIvc3+WJmUL+z+hULMPEW7BoADGZ3ywh8sM8dkU+lZ9oOp0RK0GB X-Received: by 2002:a05:6402:270a:b0:431:43f6:1e02 with SMTP id y10-20020a056402270a00b0043143f61e02mr32171397edd.317.1655761782269; Mon, 20 Jun 2022 14:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655761782; cv=none; d=google.com; s=arc-20160816; b=EyB7XxRA1434FZ4162fJJBKRmhcGFSQPVbcZKT+2466Z43iSvV8AmCHw/5N7fYzjj1 mZ2hT4e93gr/XeStMog2bszWnei5EnjAe/n4/iN+z5InzILxE5F66ipmytg4GgONDPe4 HBRu9Dt202xSSLb/SLTSDmzbMWmG6gAVkOTLHg69D/1tXxAvZuRJg+ZsCCmEuoJmXXKR AF6XuYOzufdLp48ye0o9CBOE8xbZfBY86n5lp5gG4KIypoLQjPcDKS2vyYxRlaPfQ2mY 7kFEDahax4Snavv5doxBc9ZuGnDk7wlz7wP6/UTJSbFmdojgIUzYLkoiQoFvS2syHdUn V9KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ruuoe24qWSMX4f3mxXMtChvDgoNdDLZ7+F6+4zkjwog=; b=e4wHarEKFFWFGg7tTdJULzyePJkKvf1ousKGOz4zamW/hZ4Cg/YwvKIrjG6pxaFTRX Baytbw60T04bqXcZc7ZiNWq9yaVoWV4p4/X2hm1iVYRQTPf7sKldp/FTX5sZPkgq+MI2 JjymwwGU45eYfnTqEa0gEjo5FvzY6zrBmK+0k7P33kYYUTmXWUCcnVjJ1wP3qOVkUm1s ZHwCZ/9ia0XCz1QZ3SSq8LaXc/0seWVi3+7UwbEXS8zyR1OH8JBNHknIUZK0qqkzcszA Zcjc9ojdGk0FATPnvGbs1AP5pn+odD2VxeqpHgmyKdGIyMm+pVvudubyCcqy/xh0fiP1 6Wrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SdpyMe6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x3-20020a05640226c300b00430328fe4a1si11881926edd.402.2022.06.20.14.49.17; Mon, 20 Jun 2022 14:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SdpyMe6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242219AbiFTVej (ORCPT + 99 others); Mon, 20 Jun 2022 17:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242364AbiFTVeR (ORCPT ); Mon, 20 Jun 2022 17:34:17 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 891D115717 for ; Mon, 20 Jun 2022 14:34:14 -0700 (PDT) Received: from hermes-devbox.fritz.box (82-71-8-225.dsl.in-addr.zen.co.uk [82.71.8.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbeckett) by madras.collabora.co.uk (Postfix) with ESMTPSA id C34E56601811; Mon, 20 Jun 2022 22:34:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655760853; bh=NNjcoDidsEevqXEiV8GzBg83apsOHvIp6XGvRc7cnZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SdpyMe6NbEP/JcXmI8YhZA4XuIK/GyIOjVRA7nAqN3bSHTw2LruHxJwVmkZqCv5jn SU6oOywWA9y4Gyf6g10+ywX5eEW8mEQe2CoUIj/fWbmv2nrYvSGF3La6XjJ7CM3ScK SI18stCtWuEMfCz+Vdc5F7v4FxvnKteTEa66QCwD/1HKcGrJJ4hfWbdaisMovCLMc2 rQZo35/6uT393rcBwW7cRJU0ZcOojQ/wSdKLW2zgme+jTJ3cb3nb54epjWpDeK7Hl/ PwpyoAVQlMD7VxSl0NDR56KN0HFofCp4++JESD7hG4AZxbcbMldZnvcHNo+9sFV2fB qozLNS6SIua4g== From: Robert Beckett To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: kernel@collabora.com, Robert Beckett , Matthew Auld , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , linux-kernel@vger.kernel.org Subject: [PATCH v7 04/10] drm/i915/gem: selftest should not attempt mmap of private regions Date: Mon, 20 Jun 2022 21:33:34 +0000 Message-Id: <20220620213340.3199605-5-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620213340.3199605-1-bob.beckett@collabora.com> References: <20220620213340.3199605-1-bob.beckett@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During testing make can_mmap consider whether the region is private. Signed-off-by: Robert Beckett --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index 5bc93a1ce3e3..76181e28c75e 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -869,6 +869,9 @@ static bool can_mmap(struct drm_i915_gem_object *obj, enum i915_mmap_type type) struct drm_i915_private *i915 = to_i915(obj->base.dev); bool no_map; + if (obj->mm.region && obj->mm.region->private) + return false; + if (obj->ops->mmap_offset) return type == I915_MMAP_TYPE_FIXED; else if (type == I915_MMAP_TYPE_FIXED) -- 2.25.1