From patchwork Tue Aug 13 12:19:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 2843583 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1F6E59F294 for ; Tue, 13 Aug 2013 12:20:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0479F20498 for ; Tue, 13 Aug 2013 12:20:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4F27120490 for ; Tue, 13 Aug 2013 12:20:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FFD8E6249 for ; Tue, 13 Aug 2013 05:20:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 945C8E6249 for ; Tue, 13 Aug 2013 05:20:23 -0700 (PDT) Received: by mail-ee0-f41.google.com with SMTP id d17so4130534eek.14 for ; Tue, 13 Aug 2013 05:20:22 -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-type :content-transfer-encoding; bh=reaO8GEidDVswH9ZMGMj6SJm14Q/oK5/MyCJvWx4M6c=; b=jXW4X50JU6jgRsCGrun502pzlwDoybhoKb/BRm7KKx3lAB+wWSpBK2bpNWjEARg3Tj 0HNuHfYg3+L3Vz1xn8iQ81iHAN79rMKQtmRW/38KHamb/fev/gTBXffKvCR3CNGPaGRf QgMoOS+zkNWoG1HDJPljCc5VvfWCfQK9fPGZ4wB1fSudgH1Qpf7r6z4Rbr9WPpx2XoMg S/AkJPhczUIPVnTh1RqWw0YnQBtMXcaCLJKaMwyxyV+GY1r5CoqOLZoQ3UDGGac4dNZc KCsBvY4SnrBx8Pqa74l4I2qzKp9tmYJ9vZQvBwjt5FgFxCo8QLeT2GbuKCFyxg+8E/5t fTGA== X-Received: by 10.14.110.9 with SMTP id t9mr602372eeg.115.1376396422478; Tue, 13 Aug 2013 05:20:22 -0700 (PDT) Received: from localhost.localdomain (stgt-5f71b8eb.pool.mediaWays.net. [95.113.184.235]) by mx.google.com with ESMTPSA id d8sm52715782eeh.8.2013.08.13.05.20.20 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 05:20:21 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/host1x: stop casting VMA offsets to 32bit Date: Tue, 13 Aug 2013 14:19:58 +0200 Message-Id: <1376396398-13515-1-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, =?UTF-8?q?Terje=20Bergstr=C3=B6m?= , Arto Merilainen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.9 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 VMA offsets are 64bit so do not cast them to "unsigned int". Also remove the (now useless) offset-retrieval helper. The VMA manager provides simple enough helpers. Cc: Thierry Reding Cc: "Terje Bergström" Cc: Arto Merilainen Signed-off-by: David Herrmann --- drivers/gpu/host1x/drm/drm.c | 2 +- drivers/gpu/host1x/drm/gem.c | 7 +------ drivers/gpu/host1x/drm/gem.h | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/host1x/drm/drm.c b/drivers/gpu/host1x/drm/drm.c index 1371a2b..397ed3f 100644 --- a/drivers/gpu/host1x/drm/drm.c +++ b/drivers/gpu/host1x/drm/drm.c @@ -356,7 +356,7 @@ static int tegra_gem_mmap(struct drm_device *drm, void *data, bo = to_tegra_bo(gem); - args->offset = tegra_bo_get_mmap_offset(bo); + args->offset = drm_vma_node_offset_addr(&bo->gem.vma_node); drm_gem_object_unreference(gem); diff --git a/drivers/gpu/host1x/drm/gem.c b/drivers/gpu/host1x/drm/gem.c index 3c35622..59623de 100644 --- a/drivers/gpu/host1x/drm/gem.c +++ b/drivers/gpu/host1x/drm/gem.c @@ -106,11 +106,6 @@ static void tegra_bo_destroy(struct drm_device *drm, struct tegra_bo *bo) dma_free_writecombine(drm->dev, bo->gem.size, bo->vaddr, bo->paddr); } -unsigned int tegra_bo_get_mmap_offset(struct tegra_bo *bo) -{ - return (unsigned int)drm_vma_node_offset_addr(&bo->gem.vma_node); -} - struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size) { struct tegra_bo *bo; @@ -227,7 +222,7 @@ int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm, bo = to_tegra_bo(gem); - *offset = tegra_bo_get_mmap_offset(bo); + *offset = drm_vma_node_offset_addr(&bo->gem.vma_node); drm_gem_object_unreference(gem); diff --git a/drivers/gpu/host1x/drm/gem.h b/drivers/gpu/host1x/drm/gem.h index 2e93b03..492533a 100644 --- a/drivers/gpu/host1x/drm/gem.h +++ b/drivers/gpu/host1x/drm/gem.h @@ -44,7 +44,6 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, unsigned int size, unsigned int *handle); void tegra_bo_free_object(struct drm_gem_object *gem); -unsigned int tegra_bo_get_mmap_offset(struct tegra_bo *bo); int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, struct drm_mode_create_dumb *args); int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,