Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3940858imw; Thu, 7 Jul 2022 09:58:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uxUrO+AdPW+OlUuyiXMGVDCR5ex/QGDhDntzlWYXfCwEXw/yyb8tlj6W+4LfZro0s3haqB X-Received: by 2002:a17:902:e94f:b0:16a:214e:46c1 with SMTP id b15-20020a170902e94f00b0016a214e46c1mr53532517pll.89.1657213112983; Thu, 07 Jul 2022 09:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657213112; cv=none; d=google.com; s=arc-20160816; b=tOjf7C4Sm/Dep8MMaM1GU2mAJol4c8G2eR4tt0SgYcR3UMrvbcetISDtCiAf+Noua0 PohW0EvPdbXER4N99SmXiDvmjzgA0L6jnzICS9xkuW2H60k86nQ8WNeUSGj4DGPaWrN/ n7AZ1UJMt8UEDWXkmBNaTWPykwxHxOGbt9djESmD0QwQ81tihAo/dhnP1YQUmKPvGTbU RAepFLssDM0OOfk4zHYxTL64PhMszcetQGToMFyXtLeEROmjOrpCf4a23uuMXe/MWqTw s4whVzKRyrcrG7rKZOQGFVQGArBKQ6PLp8kskQ8Emhn0tIeDcjPJ2o9xqRu+hzZGGmVw 0Gew== 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=x/9lAK8+CvMKqYrH/6IWAxQMPieF4DFJevGGNmjeys8=; b=E/YQIsPtBFQUwBg9l1lgtyrnJY5kqtpFpLv4unzveMlndY/K69u8kmZ6vKdskLcEwb 6c3VTOor98VIN2rkxO1a4+VqQoG+9bhEknlqgOUUjnBCd0G8Pmz0tbqM0ToeT8lFE/4f xLzz4KrZTv2QVVLCm7bL3+wcLKapVB2wdPxGedImgwpZ6TBilUWd1Dy+mcd1k077CmQ4 a4hYb/WW073/IhHX1RXsomnIm1TA6fQA9jKSr9u8PhhFIqk5LZLiCBfuLhUwP6FosIUP No1nSbY/UTDTZwa/HEHm2eioIaHdlp5EdfbzilkOQPncS+eNs1w7ZLEoK7qedOwf8c0j Zv/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KQceRyr8; 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 p1-20020a170902ebc100b0016bd1722ce5si21490099plg.319.2022.07.07.09.58.21; Thu, 07 Jul 2022 09:58:32 -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=KQceRyr8; 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 S236267AbiGGQg6 (ORCPT + 99 others); Thu, 7 Jul 2022 12:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235026AbiGGQgr (ORCPT ); Thu, 7 Jul 2022 12:36:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A97B9564C2 for ; Thu, 7 Jul 2022 09:36:46 -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 2996C66019CB; Thu, 7 Jul 2022 17:36:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657211805; bh=qy8+fGCHoC0k4JC8KL3MA8/A+stlKuCvaW0SY+DabgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQceRyr8HJTiByldyuhsZFJRYl7MX/X07QW4Lo6mbI8Itl7B9EQ1WtMYTQBvsmHsO i1hK3gE81mt27Y7DGyKztLQ9AZvsAVHa0pj8rw0IB+cEKPpe8Bf44SI4KfLyuY1pm/ Sz5fuNP+9Q/V5MKuxozHPw4yazMG5ri+rWshkly6a4PAOfYIfvoqzeECPrpnJ+/mey tB5TtnM0h3+fdCZnpgaDE35bKH4ldgyUJzHGLgjlyq3NgmoiyF1MuIRjGf4ANZ+Ism gLW7nIRgLiBvqsG1cF4PMXRJxbkecdHF7LOTkBidjLw7r7Hw6xgxa8Y667qaEHZwIV CTNLHA4K0lm1g== 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 v9 04/11] drm/i915/gem: selftest should not attempt mmap of private regions Date: Thu, 7 Jul 2022 16:35:59 +0000 Message-Id: <20220707163606.1474111-5-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707163606.1474111-1-bob.beckett@collabora.com> References: <20220707163606.1474111-1-bob.beckett@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Reviewed-by: Thomas Hellström --- 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