From patchwork Thu Jul 10 21:50:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 809C7BEEAA for ; Thu, 10 Jul 2014 23:34:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C28EC201F7 for ; Thu, 10 Jul 2014 23:34:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F0D65201D5 for ; Thu, 10 Jul 2014 23:34:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A60FC6E7C5; Thu, 10 Jul 2014 16:33:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by gabe.freedesktop.org (Postfix) with ESMTP id EB1946E163 for ; Thu, 10 Jul 2014 14:50:50 -0700 (PDT) Received: by mail-we0-f174.google.com with SMTP id u57so204605wes.5 for ; Thu, 10 Jul 2014 14:50:50 -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:in-reply-to:references; bh=t+Uov2AMKOZHAq/iNmgjJHE8BhbqAHdNu7qgFtXt2tY=; b=VnhE/poiX0Ssj0hui5k4FcdBWjTA6UZCK7E+C7E9++y/bvH+VeQkP+1hdXikbeb32y Itc2BWt1XFrQ/X1+m3hPScUvyuTgGtAYkZFmngtg+jxPaBAYyetSPn0citt83lnrC1Jq pqpoBPTOO1B9H9Zjt81N+PbrkOw5XHh/P5/bG5asFytSaF/2tafKA1+k5gzxm7aRS5yb vF+2sjQ9A6mWyRFA0ipCHPuG7Vgp2lyblMTHpODFoBsDFI3qf8N7grZpLFh0J9SF+MSQ mr4GoFtqAJAfaVnyIO3vuqP/kYE+lEY8cMWCopAH4zD8xcWVnEyjVxpuKO/BmeeVo4Lh 4+lQ== X-Received: by 10.180.74.82 with SMTP id r18mr287676wiv.62.1405029050070; Thu, 10 Jul 2014 14:50:50 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id n2sm805353wjf.40.2014.07.10.14.50.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:50:49 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 05/83] drm/radeon: Add kfd-->kgd interface to get virtual ram size Date: Fri, 11 Jul 2014 00:50:05 +0300 Message-Id: <1405029027-6085-4-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029027-6085-1-git-send-email-oded.gabbay@amd.com> References: <1405029027-6085-1-git-send-email-oded.gabbay@amd.com> X-Mailman-Approved-At: Thu, 10 Jul 2014 16:33:12 -0700 Cc: Andrew Lewycky , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?UTF-8?q?Christian=20K=C3=B6nig?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 This patch adds a new interface to kfd2kgd_calls structure so that the kfd driver could get the virtual ram size of a specific radeon device. Signed-off-by: Oded Gabbay --- drivers/gpu/drm/radeon/radeon_kfd.c | 12 ++++++++++++ include/linux/radeon_kfd.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c index 7c7f808..1b859b5 100644 --- a/drivers/gpu/drm/radeon/radeon_kfd.c +++ b/drivers/gpu/drm/radeon/radeon_kfd.c @@ -25,7 +25,10 @@ #include #include "radeon.h" +static uint64_t get_vmem_size(struct kgd_dev *kgd); + static const struct kfd2kgd_calls kfd2kgd = { + .get_vmem_size = get_vmem_size, }; static const struct kgd2kfd_calls *kgd2kfd; @@ -92,3 +95,12 @@ void radeon_kfd_device_fini(struct radeon_device *rdev) rdev->kfd = NULL; } } + +static uint64_t get_vmem_size(struct kgd_dev *kgd) +{ + struct radeon_device *rdev = (struct radeon_device *)kgd; + + BUG_ON(kgd == NULL); + + return rdev->mc.real_vram_size; +} diff --git a/include/linux/radeon_kfd.h b/include/linux/radeon_kfd.h index 59785e9..28cddf5 100644 --- a/include/linux/radeon_kfd.h +++ b/include/linux/radeon_kfd.h @@ -57,6 +57,7 @@ struct kgd2kfd_calls { }; struct kfd2kgd_calls { + uint64_t (*get_vmem_size)(struct kgd_dev *kgd); }; bool kgd2kfd_init(unsigned interface_version,