From patchwork Tue Jan 12 21:23:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= X-Patchwork-Id: 8021031 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA8729F859 for ; Tue, 12 Jan 2016 21:24:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7F5620412 for ; Tue, 12 Jan 2016 21:24:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 13B652041B for ; Tue, 12 Jan 2016 21:24:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5793F72137; Tue, 12 Jan 2016 13:24:11 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B64E72063 for ; Tue, 12 Jan 2016 13:24:06 -0800 (PST) Received: by mail-wm0-f68.google.com with SMTP id l65so33433275wmf.3 for ; Tue, 12 Jan 2016 13:24:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=ibwzSrU3IXIJ2hgxa528eh4uwmqbPYccA2tPAEhx9nE=; b=HroK+5/oR96uUwvelv3KmNYPr+M7l2q60ZvXaJ+APnGj2bMs8Rh+gv4cfkEUwLOxO9 eYgpWKPZnuItfQsdSQj5n/AdqtRwMouzZVwIytDLE8LyLWkIsYSS/JOO+OZSiUSKEBOE JsmOcgOKYFJYXD5NL+rcCW3+4GgXGRKyCPc63WJ/9xKPZevDVzv1ltdQ/bYM/K9aZiNQ jd4Wxm2D29R783GS1RfLgEC62wHnOSELCnKGwJTncpyJdIoxKmfEjgPZfCO69X5YKlKO t6DCxMQ5kYRBW+/K7MGv+kZyn7UuYLXGYnaO+0Drjof5N09YoO0B2+Mt0hC2YD3HeXmp n11A== X-Received: by 10.28.211.141 with SMTP id k135mr20625052wmg.51.1452633844650; Tue, 12 Jan 2016 13:24:04 -0800 (PST) Received: from heaven.amd.com (ip-89-103-110-3.net.upcbroadband.cz. [89.103.110.3]) by smtp.gmail.com with ESMTPSA id n5sm19291001wmf.3.2016.01.12.13.24.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 13:24:03 -0800 (PST) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 03/10] amdgpu: drop address patching logics Date: Tue, 12 Jan 2016 22:23:49 +0100 Message-Id: <1452633836-26855-4-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452633836-26855-1-git-send-email-maraeo@gmail.com> References: <1452633836-26855-1-git-send-email-maraeo@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "monk.liu" we don't support non-page-aligned cpu pointer anymore Signed-off-by: monk.liu Reviewed-by: Christian König --- amdgpu/amdgpu_bo.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index 1a5a401..61db58c 100644 --- a/amdgpu/amdgpu_bo.c +++ b/amdgpu/amdgpu_bo.c @@ -537,17 +537,8 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev, int r; struct amdgpu_bo *bo; struct drm_amdgpu_gem_userptr args; - uintptr_t cpu0; - uint32_t ps, off; - memset(&args, 0, sizeof(args)); - ps = getpagesize(); - - cpu0 = ROUND_DOWN((uintptr_t)cpu, ps); - off = (uintptr_t)cpu - cpu0; - size = ROUND_UP(size + off, ps); - - args.addr = cpu0; + args.addr = cpu; args.flags = AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_REGISTER; args.size = size; r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_GEM_USERPTR,