From patchwork Mon Oct 3 12:45:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9360527 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D85DB607D8 for ; Mon, 3 Oct 2016 12:45:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE197205A8 for ; Mon, 3 Oct 2016 12:45:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2B2828417; Mon, 3 Oct 2016 12:45:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8EC79289D8 for ; Mon, 3 Oct 2016 12:45:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7E3B6E404; Mon, 3 Oct 2016 12:45:25 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 089416E404 for ; Mon, 3 Oct 2016 12:45:24 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id p138so14536669wmb.0 for ; Mon, 03 Oct 2016 05:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=agUw5wLWXLEjNjBGzOiSzPBBcvJuZQhaFzR73yidLVA=; b=EnKztncycvdVSEIqpN/h0I2Ib7QwSJtakKk+2k9XZ4yKG8Vu82q84VBHLlEPGee3cM ENL9uy3B3GdZ7GzbM+BgVRM1Id3y0DrGYE/7WPNvPtSn3ZnP5Vw4jJNCmuNkDIKfsHRC /gOlT4gaPb8ixVixKcYhzIAzMaV8J70uW5ZqYNd/hVQdYwnKwxIaKLSCNwjkma75ltsj fjSf47A8DjYCK0vF1KtoCkFcnlgYftfnbyEzQRUebQzZqB4Nlvm1kbyDREgHFMiMqHHm hdJbMjVqxBirAYpdD4U2hL0K1k6JeSRKF0gtDb8mbVqYCrv6NT9+VFOFVwglFNg7S/99 2RRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=agUw5wLWXLEjNjBGzOiSzPBBcvJuZQhaFzR73yidLVA=; b=ZahRymtI6t/cZ37vnBe38z6Gobp7mM0pbTAEL3MeSiDxDnKShEXsMMedocHOHgk5dJ xDiGSJAFFCH3CdCdiENoCkBxK/q8is6K2DPtBwWp+DVzm+4xEtnBnL8FcHzHl7M+R01c An+Wh/SMXkKBTlNCu4gCuNTiM2+JJXmOyVnjwwwMkW2uV/7RGy44JRio7IuA2ho7bDZx OdvuaXt8LfAD6pw3s3w77KGirDySIKZfnelTxkzvGmptm5Rc1B1I29NnHxqskC7rs0kS UBTs6tGv8aqYw0Ps1a7H8pULn+i1qEQni8qreh+z5FI2oX9Bmf1++8znYOKP1MqKDAv3 96bg== X-Gm-Message-State: AA6/9Rlgr4sEdqStBpnxX4nLLOjtuOD2lh/1YkIkUaf5jLjUyIez1gX/dq1AbOy22yEwgQ== X-Received: by 10.194.100.169 with SMTP id ez9mr8002425wjb.9.1475498722378; Mon, 03 Oct 2016 05:45:22 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id o2sm34174948wjo.3.2016.10.03.05.45.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2016 05:45:21 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 3 Oct 2016 13:45:15 +0100 Message-Id: <20161003124516.12388-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161003124516.12388-1-chris@chris-wilson.co.uk> References: <20161003124516.12388-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 2/3] drm/i915: Unalias obj->phys_handle and obj->userptr X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP We use obj->phys_handle to choose the pread/pwrite path, but as obj->phys_handle is a union with obj->userptr, we then mistakenly use the phys_handle path for userptr objects within pread/pwrite. Testcase: igt/gem_userptr_blits/forbidden-operations Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97519 Signed-off-by: Chris Wilson Cc: stable@vger.kernel.org Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_drv.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index e0cb71c9c52e..91ac283d733e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2282,21 +2282,19 @@ struct drm_i915_gem_object { /** Record of address bit 17 of each page at last unbind. */ unsigned long *bit_17; - union { - /** for phy allocated objects */ - struct drm_dma_handle *phys_handle; - - struct i915_gem_userptr { - uintptr_t ptr; - unsigned read_only :1; - unsigned workers :4; + struct i915_gem_userptr { + uintptr_t ptr; + unsigned read_only :1; + unsigned workers :4; #define I915_GEM_USERPTR_MAX_WORKERS 15 - struct i915_mm_struct *mm; - struct i915_mmu_object *mmu_object; - struct work_struct *work; - } userptr; - }; + struct i915_mm_struct *mm; + struct i915_mmu_object *mmu_object; + struct work_struct *work; + } userptr; + + /** for phys allocated objects */ + struct drm_dma_handle *phys_handle; }; static inline struct drm_i915_gem_object *