Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1131963ybi; Tue, 16 Jul 2019 10:05:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9t6mgBSOSa9l5iUigOVnmCBW1WDjyqrAepRBh0/9/vhGskAb/k5oopeVJl6sUWShqPImh X-Received: by 2002:a63:3203:: with SMTP id y3mr35732776pgy.191.1563296715647; Tue, 16 Jul 2019 10:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563296715; cv=none; d=google.com; s=arc-20160816; b=a/HGZ0UParVsbT288expaQm6EqHELRRLyCDfegE424EmYzi96hv77+IbAkADgXin/S mfSvoLWaHBrWX4Z3XQw0nHePArbrLWgbIGjDlf3EpM6Wl0xAjP8sGTj/lFg3n9+2sYaF jauq0jx4qs36BngBsVkca/BeLYiFtzclcAYIN3GYbpvzyPjNx2n17L1m0jYTRxBavjzD r/2Q1pVFXXsZzVn0LqQZTuyVlnvUyJn/J9q61nriC8BMexdO47fIiuAtk1PGmImjunZ+ Qf6qvp/aEu4QIJJZMzT5YM6uAHYg8NTnu+m4a0n9VX70vp60xomiy71LsHeeJDkETmJq zemA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=M5J1jCpDGLRMbPaFuVIDuJAsDJ3kZo81VHBUg/8gudo=; b=ELSATUy0JyTu5p0i+IdTysmzO+8OtC7v3NrawTpAjcLvNcngFewbOOwzKCLr2VS69Y +MxQPfLKkRtDk/S+ChwBKW0mnHJThn+qQ92XM06iNXLva8xU9aYrGFReZ3zWmw9vVPik j7nD/331pUaDHc3xoC5DHngT8jfandMuERdxl5vZh+c5Vse9Ij0w71cJ4gDU/2iwYYzs vSNsCh/3N3yvaDEgMdN5klw0qstWcSvJ+3ad2s9yek337AT/VxgI7nxntRLNfIqtkXzw CDVZiDZx6p5RfjX83ztOcyyke9PYXRAMf2UneFfwPJyNxy5yHImndoQu9Vk7y1QOew0Z ymhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oPPQSb4p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21si20975163pfe.204.2019.07.16.10.04.56; Tue, 16 Jul 2019 10:05:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oPPQSb4p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730499AbfGPREN (ORCPT + 99 others); Tue, 16 Jul 2019 13:04:13 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:34922 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbfGPREM (ORCPT ); Tue, 16 Jul 2019 13:04:12 -0400 Received: by mail-ed1-f67.google.com with SMTP id w20so21024172edd.2 for ; Tue, 16 Jul 2019 10:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M5J1jCpDGLRMbPaFuVIDuJAsDJ3kZo81VHBUg/8gudo=; b=oPPQSb4pew/H/AtnEeU9cvH+8yyLl7hIKuxjqBwPDdjpW2eAVrEw3390F/xtJMwRtJ RpBYPM0v9wuUUXECyCsUkJSJq546FB8TgqsnCH6I+QuV4GYCQEtVN1egdPSiecJdyh7/ 3Bs4ShQdGinhQuH1gbc2YPJtB5cL/BLOSnD09qFYByK1BWI3JEdz764l6+RE4Ru9kDKq eh84SWBp1R50G4AJ9P2xi++KlnacTvz+JAjPxgHevjzjV3JzBlcOok7qEeDsB1MPA1Ql LtrTIOAw0RjrSSEcFsp1dIneQ/EBst0GqDR/zXBV4TKOlK9t8g+/XUVkHevX9UCHIw0w DnVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M5J1jCpDGLRMbPaFuVIDuJAsDJ3kZo81VHBUg/8gudo=; b=qwdIzLTxmYYvDZqfJ+L/TAQlgRcBj1xQoME2Q19oam7b2bLA3YFi7ojeYTzNDBmZx/ 7KdcoyCl8PhOxJVCSayaSEICFyJULC7kjr0Agqny8FRWlBT3EjMX6Mdyc9R5XJUPYnyU 04DX3qJHHYUeGQia7Xz8B+iA+8yzCPn9+WADm4lV3ugj4ZF5rgQrbOW7FFmKiv7be6zl 8SlLYUTYL1U9kp5dX2XixD1vYEjBxYOmOgp48S3YwMSnQAaqsyfl0Y0LcDskupaBKqM9 /DyrrxcY6SE0Q9Y9B4P1fK2RQPeVu6s+WV1fpX+sqFvl/m4Utvjb5lAaBY8v0ovZiZPL zQBg== X-Gm-Message-State: APjAAAUiPaWNZJkSmBgZCQ81Jb4Wk7QkDAkKueNEt0c72nhmpSL8nI+L K1Gqzn14PX+U5pY50HUVK2EEhKevNufv5ZdiUWc= X-Received: by 2002:a17:906:3f87:: with SMTP id b7mr26288651ejj.164.1563296651085; Tue, 16 Jul 2019 10:04:11 -0700 (PDT) MIME-Version: 1.0 References: <20190716164221.15436-1-robdclark@gmail.com> <20190716164221.15436-2-robdclark@gmail.com> <156329635647.9436.7142001798245279241@skylake-alporthouse-com> In-Reply-To: <156329635647.9436.7142001798245279241@skylake-alporthouse-com> From: Rob Clark Date: Tue, 16 Jul 2019 10:03:59 -0700 Message-ID: Subject: Re: [PATCH 2/2] drm/vgem: use normal cached mmap'ings To: Chris Wilson Cc: dri-devel , Rob Clark , Deepak Sharma , Rodrigo Siqueira , Eric Biggers , David Airlie , Linux Kernel Mailing List , Thomas Zimmermann , Emil Velikov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 16, 2019 at 10:01 AM Chris Wilson wrote: > > Quoting Rob Clark (2019-07-16 17:42:15) > > From: Rob Clark > > > > Since there is no real device associated with vgem, it is impossible to > > end up with appropriate dev->dma_ops, meaning that we have no way to > > invalidate the shmem pages allocated by vgem. So, at least on platforms > > without drm_cflush_pages(), we end up with corruption when cache lines > > from previous usage of vgem bo pages get evicted to memory. > > > > The only sane option is to use cached mappings. > > > > Signed-off-by: Rob Clark > > --- > > Possibly we could dma_sync_*_for_{device,cpu}() on dmabuf attach/detach, > > although the ->gem_prime_{pin,unpin}() API isn't quite ideal for that as > > it is. And that doesn't really help for drivers that don't attach/ > > detach for each use. > > > > But AFAICT vgem is mainly used for dmabuf testing, so maybe we don't > > need to care too much about use of cached mmap'ings. > > Sadly this regresses with i915 interop. > > Starting subtest: 4KiB-tiny-vgem-blt-early-read-child > (gem_concurrent_blit:8309) CRITICAL: Test assertion failure function dmabuf_cmp_bo, file ../tests/i915/gem_concurrent_all.c:408: > (gem_concurrent_blit:8309) CRITICAL: Failed assertion: v[((y)*(b->width) + (((y) + pass)%(b->width)))] == val > (gem_concurrent_blit:8309) CRITICAL: error: 0 != 0xdeadbeef > > and igt/prime_vgem > > Can you please cc intel-gfx so CI can pick up these changes? > -Chris I suppose CI is actually reading the imported VGEM bo from GPU? I can try to wire up the attach/detach dma_sync, which might help.. BR, -R