From patchwork Tue Apr 9 12:44:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 2415261 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 83D3A3FC71 for ; Tue, 9 Apr 2013 12:45:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A045E602C for ; Tue, 9 Apr 2013 05:45:18 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from outgoing.email.vodafone.de (outgoing.email.vodafone.de [139.7.28.128]) by gabe.freedesktop.org (Postfix) with ESMTP id D7055E5BF0 for ; Tue, 9 Apr 2013 05:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=vodafone.de; h=from:to:subject:date:message-id:mime-version:content-type:content-transfer-encoding; s=out; bh=A4ljOWZXE3+usrKMj2c89kEnvLtG94h66c10Yxjnpao=; b=KYO1WzEkjj56ITMToczw/c5xN6bEHMTr0nDF7gP3xM9djyshriKOSRNW0vcyc+UP4k64yn+AMR7OyWo4+ih0n8FSGwo2YCMoQqxq1lw+DjiRmi59oyha1e/89vRq32rhbxhqC7kT951NUMDTu/7yAQiEQBjmSPMAyWb0Yq03ohc= X-Authentication-Info: Sender authenticated as deathsimple@vodafone.de (using DIGEST-MD5) Received: from dslb-084-060-226-038.pools.arcor-ip.net ([84.60.226.38] helo=localhost.localdomain envelope-sender=) by SMTPIN-03.smtp.email.vodafone.de with ESMTPA id 51640D4C.19350.260708; Tue, 09 Apr 2013 14:45:00 +0200 From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: add ring working query Date: Tue, 9 Apr 2013 14:44:59 +0200 Message-Id: <1365511499-14685-1-git-send-email-deathsimple@vodafone.de> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 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 From: Christian König Add new ioctl option and bumb minor version number. Signed-off-by: Christian König Reviewed-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_kms.c | 17 +++++++++++++++++ include/uapi/drm/radeon_drm.h | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 66a7f0f..31b193b 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -73,7 +73,7 @@ * 2.30.0 - fix for FMASK texturing */ #define KMS_DRIVER_MAJOR 2 -#define KMS_DRIVER_MINOR 30 +#define KMS_DRIVER_MINOR 31 #define KMS_DRIVER_PATCHLEVEL 0 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); int radeon_driver_unload_kms(struct drm_device *dev); diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 3019759..8cb9d12 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) else return -EINVAL; break; + case RADEON_INFO_RING_WORKING: + switch (value) { + case RADEON_CS_RING_GFX: + case RADEON_CS_RING_COMPUTE: + value = rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready; + break; + case RADEON_CS_RING_DMA: + value = rdev->ring[R600_RING_TYPE_DMA_INDEX].ready; + value |= rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready; + break; + case RADEON_CS_RING_UVD: + value = rdev->ring[R600_RING_TYPE_UVD_INDEX].ready; + break; + default: + return -EINVAL; + } + break; default: DRM_DEBUG_KMS("Invalid request %d\n", info->request); return -EINVAL; diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h index cd085d1..8459415 100644 --- a/include/uapi/drm/radeon_drm.h +++ b/include/uapi/drm/radeon_drm.h @@ -973,6 +973,8 @@ struct drm_radeon_cs { #define RADEON_INFO_MAX_SE 0x12 /* max SH per SE */ #define RADEON_INFO_MAX_SH_PER_SE 0x13 +/* query if a RADEON_CS_RING_* submission is supported */ +#define RADEON_INFO_RING_WORKING 0x14 struct drm_radeon_info { uint32_t request;