From patchwork Thu Jul 13 21:08:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felix Kuehling X-Patchwork-Id: 9839553 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 36DDF602BD for ; Thu, 13 Jul 2017 18:06:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2DA528704 for ; Thu, 13 Jul 2017 21:08:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 978622877F; Thu, 13 Jul 2017 21:08:31 +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=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 6EEC828780 for ; Thu, 13 Jul 2017 21:08:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B30B6E702; Thu, 13 Jul 2017 21:08:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0059.outbound.protection.outlook.com [104.47.38.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id E41C36E116; Thu, 13 Jul 2017 21:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1hIahYVunErVfcegw7mr3kpXUBJDB/+FkOJQhvotkcc=; b=tIZsiUCPcGTl/8uWWvOTXV4+XtTe4LwGgiN2DepL586Aw6E5WmnPfT8zZUBTc3tDpCjsfyBMZX2ua4fTLqr+D2dP6EEMl1ncxl6/pc6z394Diq7s7xvBkAZWT7nIH3JowdxCedA8pRPfu9MpUPTpfRnAarTlOgYlfSaHcFnDorc= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from Harpoon.amd.com (165.204.55.251) by DM5PR1201MB0234.namprd12.prod.outlook.com (10.174.107.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Thu, 13 Jul 2017 21:08:25 +0000 From: Felix Kuehling To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH 2/2] drm/amdgpu: Implement ttm_bo_driver.access_vram callback Date: Thu, 13 Jul 2017 17:08:25 -0400 Message-Id: <1499980105-7721-2-git-send-email-Felix.Kuehling@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499980105-7721-1-git-send-email-Felix.Kuehling@amd.com> References: <1499980105-7721-1-git-send-email-Felix.Kuehling@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: BN6PR19CA0056.namprd19.prod.outlook.com (10.172.203.146) To DM5PR1201MB0234.namprd12.prod.outlook.com (10.174.107.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87a4517f-1ca6-4262-6be4-08d4ca334dc5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR1201MB0234; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0234; 3:F1Uq6hOYQHDJTRsGaAi3e90kmriVkM3CB6b977Dpo00xemiABmCuDMBju1AdDaecrl7WiwP2brHFuvNM3WiHw/pZn5+ADGFGLSMZKvjMGF73DaYQO6TqMAXRucp3Z2sAl4yqJNAszyVtYHBVZySmR6C4XkwXLXKKic1jtxK+0AP6I12L6AG8i7JtppFFJK1Ii7NjojCcyFi4ulxRDniqjVTpSjCQ2o0HJbBn0JyOpIbxxd32ikJd6Bk/ek6PPZiCvmRBMe0F0Is65u0jrrOhwL/gbUU8Anxe3651ax0VUZ6mED9ZsB1gtqlXQ/sdyAHbo9ERxrGmtyxNnxK/2MnDKlB0gXUr8wLKGnnGlXN9WF+AU3FLvdXHc03cjpMTS2B8FNke9j1seEDLOKl5L7VbXclo9GIdAs7LFklG1LwknGrDx34pLZy/taFT9iyFbHvXcCCtaHfNvZ+QVucsEYgCiBdbKFgqamf4yl8s5KfB/iLR0EOPyr2I7MaYyJJtNpVkz+WjyuRqMNXHV8ugts1NJCIvs56+9bNkjJGSaBJvXRZ1yWA8C8d65ppBwYg5hZJC6ZrUY3vH2AN/OTjPW0DaS1FKGw27EiIjizvMe10OWdLTeOcgOZ4HYtDRda82qhKdwNS/duCb8kU9d3vKwvF5VtO2YZQ9ntN0OoAKbD97HxytD+hDPI5sZMArZWlTFsmc3gXj220aMECjoYVxF8cPWn0cOTROiTTkykK8LBtkUhUaYc+ry39oIRFDVLg8oy2pJ4ZgDLEMquHUrye6WkscpA== X-MS-TrafficTypeDiagnostic: DM5PR1201MB0234: X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0234; 25:ZhlI3Q5RkOficWmROPV1Yd76FdP3lEMZBah5gcxff9U5tn4M5ajIhqSHsX9/VCemRuCi7Fmq/xgX5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wSY7EL+J66wuTwiIlbcPO9b8J5BG81Wo23IN1buWu3//xfVbnAIiiVQgrYSSFcBcCiwIG4Bk9XKqWZoOBc8WRr5WhllIaBMwIs4Bwhc+wb7EGmaby/+0i/ahH8zTW93yykTyKORk9f4p3fWi2WyU+8uQ02WVmd47kXn3+N36Xt9XY7pfH76YFufI8fN5CMr7xhBBvQBHYt+SaWRzGXUNSXeNMkTBJfvJtCOimDQ/eP4TuANPqLW3w3IHse/9izVRMYgTxAEChnsv6Ca0TyvXR1lk/fKqSP+5mOr2zZlPxPFt6QlZghwDIBazYdR3XLbTn/IdXpEOesQrcmyG02rlIoy47IgJp4mkytnXdWj5Q8NB29B3/bR2Nejh33AV+jrUNKxU94BohQvHsITLGsaBa7zOboCvet7/rteYekV13ZeCQcyc0g0GOWsqBAmLgiIfJ/sQBU9KdNZq5/E7RkUQSV2wvOtaA9bzIo/CLX4GoLYcad0jb+E77FSsNjC9fRFD512kooI= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0234; 20:D5MFFXhOj6h+Y1U7jPk9jxuFRuUMqNOE4VQ8f8fB4t+78nmJTDrmHox7XtSE4jIp7PT1J9n8NrYH7Qez5H709ecaYksESlnnkg9udk8RRXZPj1zapwSZYW/NapUmdS/EAopBbmfownFzzemEUgwOtYcQblMbj/30OA/JJvUkqZqJrgP49xbHg3N/noXVSLanzAfLKReXEL38ralSScu5ckym3QCFX9+e3e9rRaoGkAl6bxMJ6VyyxBtQ10j4cNI7QfglyzRyQkAcuqVpGL3ImUqddnjOWlwIKZbPzjqIzK588Dz3TSlRGJqJN5XY130sbvYClUCGgvBEm1jlZigyTazCgSnjm385hayBMEao3RlJcSffJgz3lv4VushXljVGHv7A3mA+QMqPwLhbRUZVOElnVrjTF7QW0EuStZtVm4FmZhGgC+UeS8Vi0MGRAb4HF3rLLpfc1f47ImdLMU3sfPeGkx8L/g8eTHuRNyo722dy5jDG6SwNL3kusiyfao3R X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR1201MB0234; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR1201MB0234; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0234; 4:8t+XeJU5GPJV/yJM777Ufv3LsiORyqYQeE4POK+R?= =?us-ascii?Q?+4r4R/+ySowEeBddlRtMTkq0S80Q6GwcRNxlgbkIkzTGMy5E8y8mdk4Z4RBQ?= =?us-ascii?Q?pdC6as1nNPcmLOwWf7ux4NFF6lSS8gWSmt6IFzVHmHVwYM6z5iD7bBE5Xj+n?= =?us-ascii?Q?h4+/f4IMD6Qadp+HfDjdJU8Y3Riirm5OLTjQwV3q4Knw3hSnutvbWYnUoyql?= =?us-ascii?Q?zUidK+ojIYBwnw0lvs5nnwS7nXEKymbCZ/bz0SUn2VqbdbjsUsZPTXiCnxvJ?= =?us-ascii?Q?d/BYxqOgIvhH1ht+lrcnq+FOSSpG4uEg1OHzZUsN/f8FVA+CGJ/FIOTA61+9?= =?us-ascii?Q?Udv0EeuxK7NMbYrYLUmzAEcUbLC4PKdEiFRTQNK11khcd2JRhTO6Dt8eQE4v?= =?us-ascii?Q?oGvjF5kxfujO+K6QJS+eENwVhFNIsEKRhFAoFvZoe2ZqCaw/SQ0QA2TTpDru?= =?us-ascii?Q?WHFeR6qFKwJsqdDc/763BWD1aXSsQ3oDPkaxS/5h+KTMBRcsTiZ3JFCDc+xs?= =?us-ascii?Q?wBc/PfsKTJ72D9fg6AlPDdK4vqRjsixXd3GXn+/TnzE3XLZiKUeL/qVcDzdv?= =?us-ascii?Q?DeIE5NtnRI77arxEqaN2oJwEqhLr3RVtc2S5Q6nVb4tWYEsLnD0VKpIPsrb6?= =?us-ascii?Q?slm85x5Hc1FfTh8aaZPaldw0tz8Ga7lri8goSqAa1OSteqNbi5iwhuUip3dm?= =?us-ascii?Q?9ir/SBXgFIA0FYtvy4BSkhhT6DhGbf/oYADglhQND9cPEHz9I714wBioOyOf?= =?us-ascii?Q?rMd39sOj2FgzVZuZdTNqaVFY3N2kK3oP2tdgEhdVVxdqOmJoW+EDG85oXbqQ?= =?us-ascii?Q?Tj6i2BC6iefvvEFSONjtdIHWCwcYaiBCJLicckNVPuzj4FSMunmEF1EW9S3p?= =?us-ascii?Q?zgV3c5Qg2CVQrahEHsWa6SglzWF9M45f9MkKF0vkpEwhbcsb8AIscH2DOF/c?= =?us-ascii?Q?5VmBiBHo8qaxzrsFpMtsDyTeBKcHBVcHsPOk/KRknX58t6sHvMReGAoROnNi?= =?us-ascii?Q?jen2+W/9sY6jX7TWrYaDnvg9OB+DZ9Q1tTLC/1+d2QCynaTP3ATV10aDUUo/?= =?us-ascii?Q?d3ZPyiVNv3TIiOR9MX0axWBTWAGy1W8RJcdDEW/OnzohvuwtLCgQz2FxAJz2?= =?us-ascii?Q?nntwS71GprlE7ZAuToGMiOzLnDSTQmkFTEYqjuME9Lw0QnWXQGgMJj53gC5+?= =?us-ascii?Q?OmMANHN5OrCR02gixKjGKLaueL5sFMHZFOJa?= X-Forefront-PRVS: 0367A50BB1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39840400002)(39860400002)(39400400002)(39450400003)(39410400002)(39850400002)(50226002)(2906002)(42186005)(53416004)(81166006)(50986999)(47776003)(76176999)(66066001)(36756003)(8676002)(7736002)(6486002)(48376002)(72206003)(38730400002)(110136004)(2950100002)(5003940100001)(5660300001)(25786009)(6116002)(305945005)(7350300001)(50466002)(4326008)(189998001)(86362001)(450100002)(478600001)(3846002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0234; H:Harpoon.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0234; 23:1pvTUUCpizMxsqS/hgyCm9k2MwqvIGkGhy2zdqn?= =?us-ascii?Q?P+28y/c/fx3fC82Q1m78Oe+t9TTl0G6dTdT316B0sSlboWaPIpNAPVn1kukf?= =?us-ascii?Q?pBUg3j/dywu5WOs3VHPcSNqNnwBDWVrYTZAK3q3yjYmUrxGXYrrqvzSKfOUF?= =?us-ascii?Q?KtaVmadAHdrirbQ5pc/3921z1SsNtUblo2NYSH0nGwe65KJ+I5jwgMONdrmQ?= =?us-ascii?Q?+sMkTJDeGLugjpA/ZKoUxm3ShDKIbnBkgqIJHmBz5bbPQWvBPFABb1Lt19+c?= =?us-ascii?Q?35F0g/br3lHbX7hfdheOf4dLApOQfe1agVXiymClrkpKG7g/eeQKk0pnR+d0?= =?us-ascii?Q?pUIbofsgz6ZppelYdVe/1eDvPcDRjHL9whS5MjMkLw2X+eU0K27pFCZk3wEl?= =?us-ascii?Q?A2Q4u4bbtFy5oexiu9IsO1m4o5qaiE3cIHMbNDKb5R4ZNz3xvfHiVIrJQKn6?= =?us-ascii?Q?fAo25t8rxHlwcxMrgvQRBR2459ASLOYrZJoR4hSR4yORJrC9oP2qCBKx4VCw?= =?us-ascii?Q?djw0XEyEAWbCnNPuqZ3CCawWhM3e1gZNsiKpGYB73ZmdgInOf1oKd/K9Shxx?= =?us-ascii?Q?Is2xtxE4IewMFZHVV83PpF54Kw/Jzb16k8McEZtNLeMbRCJDEQy4fDQRi1BF?= =?us-ascii?Q?HR767UvlZWyayRYDB26YFvYRe76dTBZgC91VKWOlh56OTZtKDqDBliWYP+0G?= =?us-ascii?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0MVBJhmx0Hbrx0Mv04/5u2sWdLD6YWZyvHEX2zvvJLWQKb9aTgvyv5iYJyxOgQj2f+kWZmq9aY5GD3FI32MCb0fjAddaaY= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0234; 20:D8eru5onX/vqm0PO5OnXSRYkirlib5oqyHjBEHX6wPhXXjofruaRFHH6dB/J/Y70rleWncLNewtxKSoWAJ/bZLpPye12fbHsWBi7c9MB2mOoKTsVGMihWkcoX0sFjxKZN4vulvhx0ixxjjaxo9VIj0zhQ4D9VkIq0lnFKB37szVqbUk3ncFaO6mUbsbE5Bft/QWnKhb7Hw70l1mbB09PD71mt8iWeeKHc+sShZfAwcIiJD/tOE4PnfEYnlYD/EMN X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 21:08:25.9259 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0234 Cc: Felix Kuehling 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-Virus-Scanned: ClamAV using ClamSMTP Allows gdb to access contents of user mode mapped VRAM BOs. Signed-off-by: Felix Kuehling Reviewed-by: Michel Dänzer Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 ++ 2 files changed, 61 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index ff5614b..d65551d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1115,6 +1115,64 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo, return ttm_bo_eviction_valuable(bo, place); } +static int amdgpu_ttm_access_vram(struct ttm_buffer_object *bo, + unsigned long offset, + void *buf, int len, int write) +{ + struct amdgpu_bo *abo = container_of(bo, struct amdgpu_bo, tbo); + struct amdgpu_device *adev = amdgpu_ttm_adev(abo->tbo.bdev); + struct drm_mm_node *nodes = abo->tbo.mem.mm_node; + uint32_t value = 0; + int result = 0; + uint64_t pos; + unsigned long flags; + + while (offset >= (nodes->size << PAGE_SHIFT)) { + offset -= nodes->size << PAGE_SHIFT; + ++nodes; + } + pos = (nodes->start << PAGE_SHIFT) + offset; + + while (len && pos < adev->mc.mc_vram_size) { + uint64_t aligned_pos = pos & ~(uint64_t)3; + uint32_t bytes = 4 - (pos & 3); + uint32_t shift = (pos & 3) * 8; + uint32_t mask = 0xffffffff << shift; + + if (len < bytes) { + mask &= 0xffffffff >> (bytes - len) * 8; + bytes = len; + } + + spin_lock_irqsave(&adev->mmio_idx_lock, flags); + WREG32(mmMM_INDEX, ((uint32_t)aligned_pos) | 0x80000000); + WREG32(mmMM_INDEX_HI, aligned_pos >> 31); + if (!write || mask != 0xffffffff) + value = RREG32(mmMM_DATA); + if (write) { + value &= ~mask; + value |= (*(uint32_t *)buf << shift) & mask; + WREG32(mmMM_DATA, value); + } + spin_unlock_irqrestore(&adev->mmio_idx_lock, flags); + if (!write) { + value = (value & mask) >> shift; + memcpy(buf, &value, bytes); + } + + result += bytes; + buf = (uint8_t *)buf + bytes; + pos += bytes; + len -= bytes; + if (pos >= (nodes->start + nodes->size) << PAGE_SHIFT) { + ++nodes; + pos = (nodes->start << PAGE_SHIFT); + } + } + + return result; +} + static struct ttm_bo_driver amdgpu_bo_driver = { .ttm_tt_create = &amdgpu_ttm_tt_create, .ttm_tt_populate = &amdgpu_ttm_tt_populate, @@ -1130,6 +1188,7 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo, .io_mem_reserve = &amdgpu_ttm_io_mem_reserve, .io_mem_free = &amdgpu_ttm_io_mem_free, .io_mem_pfn = amdgpu_ttm_io_mem_pfn, + .access_vram = &amdgpu_ttm_access_vram }; int amdgpu_ttm_init(struct amdgpu_device *adev) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index f137c24..a22e430 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -78,6 +78,8 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo, struct dma_fence **fence); int amdgpu_mmap(struct file *filp, struct vm_area_struct *vma); +int amdgpu_bo_mmap(struct file *filp, struct vm_area_struct *vma, + struct ttm_bo_device *bdev); bool amdgpu_ttm_is_bound(struct ttm_tt *ttm); int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem); int amdgpu_ttm_recover_gart(struct amdgpu_device *adev);