From patchwork Thu Jun 9 14:04:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9167123 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 368286048F for ; Thu, 9 Jun 2016 14:05:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2797628347 for ; Thu, 9 Jun 2016 14:05:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C84224B44; Thu, 9 Jun 2016 14:05:10 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B4AA24B44 for ; Thu, 9 Jun 2016 14:05:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0469B6EBD4; Thu, 9 Jun 2016 14:05:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-x244.google.com (mail-qg0-x244.google.com [IPv6:2607:f8b0:400d:c04::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 851306EBD4 for ; Thu, 9 Jun 2016 14:05:04 +0000 (UTC) Received: by mail-qg0-x244.google.com with SMTP id z67so2977319qgz.1 for ; Thu, 09 Jun 2016 07:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1JI2otLTutxi7UdegnY4drH9Y5JzUk/sTPFoPKD39Lw=; b=Bi4D02kPVxaUb4wMQPQTiHFd4+S6bDHXLEkDyGz22WbamH65FmShtFWcbZjk7Duzaa R3sC4+g0MtjtjIqsgFykJCVvsnXhDIPMYQhcdGr1EAZ/pWelAzfeccx4G6TSVnH1t4o2 fUoIM5g3J+UH11cgVexXXzZkKouepnZXnS9nvmWyyHb/euYBzXE6M9ij5rULXEP6GsBg oJYnGuK7CrAzK70VdTUtCuWTTv+aoIQP3EbwJLMcbsdEWlFrcL9J+m10YHpS8oNVvd9C YSFSDyDOCps3Kp76tp2pJUWtP5MJAogEVHHG5e5tzPVITdGWsvj/gaZP65fFGC8vVpgo Rxdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1JI2otLTutxi7UdegnY4drH9Y5JzUk/sTPFoPKD39Lw=; b=NyhkUjjf69MOjQdyT5dIHKfrjRBHnZzM8CPKSHFlNq211SzdKFni/3PwvYMCtJHkAk v/hTwrV3yqQyji7OYpvtuMAJ83Or4HTwO8gkYULnBT2FoSmSu0PhIbvdW09kK545KWt6 UJxfbe9wzQjo1IzecabnBl2fenHHU4fpErpomo/fn5Q5HRBmFEkkPaLLl/wHpmgeNy+g pZe30KYjzKCzlbrIAeWMT6sNQEZZveFVF4lVHBKX2xQmMnOsIUP6jRd1y8GJAazhZBlQ f0PNjpiTQ/eQE1gkzLRsiQIo/FwM7xwcYkAy7/FhkcSzBpeUyOMk1qOVi9kpTPTbXe0L yAoQ== X-Gm-Message-State: ALyK8tKGs6Rt98O1YAI8uw2/lQyZAwYthC6nhNn+XJxjytdzQ4qAiVAm6K/nUTmVXi+jhg== X-Received: by 10.140.98.174 with SMTP id o43mr9607805qge.73.1465481103072; Thu, 09 Jun 2016 07:05:03 -0700 (PDT) Received: from cm.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id y55sm1755250qtc.0.2016.06.09.07.05.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2016 07:05:02 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/amdgpu: Change some variable names to make code easier understood Date: Thu, 9 Jun 2016 10:04:54 -0400 Message-Id: <1465481096-17395-1-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Cc: Alex Deucher , Alex Xie 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 From: Alex Xie Add comment to describe some variables otherwise. Signed-off-by: Alex Xie Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 48d5ad18..22fa4f8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -748,7 +748,7 @@ static void amdgpu_vm_frag_ptes(struct amdgpu_device *adev, * @vm: requested vm * @start: start of GPU address range * @end: end of GPU address range - * @dst: destination address to map to + * @dst: destination address to map to, the next dst inside the function * @flags: mapping flags * * Update the page tables in the range @start - @end. @@ -762,43 +762,43 @@ static void amdgpu_vm_update_ptes(struct amdgpu_device *adev, { const uint64_t mask = AMDGPU_VM_PTE_COUNT - 1; - uint64_t last_pe_start = ~0, last_pe_end = ~0, last_dst = ~0; - uint64_t addr; + uint64_t cur_pe_start = ~0, cur_pe_end = ~0, cur_dst = ~0; + uint64_t addr; /* next GPU address to be updated */ /* walk over the address space and update the page tables */ for (addr = start; addr < end; ) { uint64_t pt_idx = addr >> amdgpu_vm_block_size; struct amdgpu_bo *pt = vm->page_tables[pt_idx].entry.robj; - unsigned nptes; - uint64_t pe_start; + unsigned nptes; /* next number of ptes to be updated */ + uint64_t next_pe_start; if ((addr & ~mask) == (end & ~mask)) nptes = end - addr; else nptes = AMDGPU_VM_PTE_COUNT - (addr & mask); - pe_start = amdgpu_bo_gpu_offset(pt); - pe_start += (addr & mask) * 8; + next_pe_start = amdgpu_bo_gpu_offset(pt); + next_pe_start += (addr & mask) * 8; - if (last_pe_end != pe_start) { + if (cur_pe_end != next_pe_start) { amdgpu_vm_frag_ptes(adev, vm_update_params, - last_pe_start, last_pe_end, - last_dst, flags); + cur_pe_start, cur_pe_end, + cur_dst, flags); - last_pe_start = pe_start; - last_pe_end = pe_start + 8 * nptes; - last_dst = dst; + cur_pe_start = next_pe_start; + cur_pe_end = next_pe_start + 8 * nptes; + cur_dst = dst; } else { - last_pe_end += 8 * nptes; + cur_pe_end += 8 * nptes; } addr += nptes; dst += nptes * AMDGPU_GPU_PAGE_SIZE; } - amdgpu_vm_frag_ptes(adev, vm_update_params, last_pe_start, - last_pe_end, last_dst, flags); + amdgpu_vm_frag_ptes(adev, vm_update_params, cur_pe_start, + cur_pe_end, cur_dst, flags); } /**