From patchwork Wed Apr 5 16:23:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9664649 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 BE3CA602B8 for ; Wed, 5 Apr 2017 16:23:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0E4F28159 for ; Wed, 5 Apr 2017 16:23:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A533D28395; Wed, 5 Apr 2017 16:23:38 +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_SIGNED, 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]) (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 3D55D28159 for ; Wed, 5 Apr 2017 16:23:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC4E66E83A; Wed, 5 Apr 2017 16:23:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40D9C6E83A for ; Wed, 5 Apr 2017 16:23:36 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id t20so4122672wra.2 for ; Wed, 05 Apr 2017 09:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Pj5Ojpid16lyRroHFJmw8/T536qFvr5k0w/SGtLVxzM=; b=DxVpTC3vobruuQILJt4IDj7+WLliagOnn6SOz/o4e9AX5iOccHGRoVqIK22N/TC7KN eB0XglgOuPvyhywpo4ZWBTf2/E8lx5WRzzuoIOZ/LSxA5v51BbND0OfWDG5nFCQhoBKj ng/ptWfDxLpmLBz6R5oFeQW7X9KTX25BU49A2lDZ7XeiwAGuGJ9XR5l5yoRmU/F4ZgeF jUUiAQt20XoVxlxkSUxwSrgVn91b5z8vHCRkvO8Bvn/QZs1p6V68cIIu3VeqsvxXqBLb q8TrLtN2wlNUcJ+HqWx370vZ1uTQbqKI+iZ1I1PX45R2pzjv25P6LN/TdtR3vVTsjJS9 kuaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Pj5Ojpid16lyRroHFJmw8/T536qFvr5k0w/SGtLVxzM=; b=VuZAUEVCPzT/cmg64604INuxuHzY7dxAeufhRDvNyR2m+oFltQ1W21WmhPHotl4gjD VmaQ5JAURhUIyuaThZog+uCBIJilxpPUSnLItP4YaMGim2tUittdVJUe1REOZtuWsXps Nl6IaKf04FjQfP3JcfVlMbmS/Y7fxTGXXpX+6qI3ThjlZ+gUG7XhZoEAjVQBXpOIFtWp Rf1EksYA3oJlALT0FsIiQz1WODVSsumNZw1orzK46O9AbnHNcxhy0qq047RL9pdr00Uz vVMrObRccxVFREZL2/UqcqxnzWI9Covq3mFo8x7zLnVJ3SQvMC5WKn/SaYvJbp9WxOJP yW6A== X-Gm-Message-State: AFeK/H07YrIEhOQt5jyRwCZRxRjFkfD3cf73EqbqZOh19VaRznfagiadpgyOl8ixwrtG8Q== X-Received: by 10.223.172.129 with SMTP id o1mr23961229wrc.121.1491409414759; Wed, 05 Apr 2017 09:23:34 -0700 (PDT) Received: from sixbynine.org (host-78-151-19-25.as13285.net. [78.151.19.25]) by smtp.gmail.com with ESMTPSA id p38sm26848790wrb.31.2017.04.05.09.23.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Apr 2017 09:23:34 -0700 (PDT) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Wed, 5 Apr 2017 17:23:14 +0100 Message-Id: <20170405162320.30094-2-robert@sixbynine.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170405162320.30094-1-robert@sixbynine.org> References: <20170405162320.30094-1-robert@sixbynine.org> Subject: [Intel-gfx] [PATCH v3 1/7] drm/i915: expose _SLICE_MASK GETPARM X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Enables userspace to determine the number of slices enabled and also know what specific slices are enabled. This information is required, for example, to be able to analyse some OA counter reports where the counter configuration depends on the HW slice configuration. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_drv.c | 5 +++++ include/uapi/drm/i915_drm.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 5852eed2a867..337acf034d36 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -357,6 +357,11 @@ static int i915_getparam(struct drm_device *dev, void *data, */ value = 1; break; + case I915_PARAM_SLICE_MASK: + value = INTEL_INFO(dev_priv)->sseu.slice_mask; + if (!value) + return -ENODEV; + break; default: DRM_DEBUG("Unknown parameter %d\n", param->param); return -EINVAL; diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 3554495bef13..f47fb7f26f36 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -392,6 +392,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_POOLED_EU 38 #define I915_PARAM_MIN_EU_IN_POOL 39 #define I915_PARAM_MMAP_GTT_VERSION 40 +#define I915_PARAM_SLICE_MASK 45 /* XXX: rebase before landing */ /* Query whether DRM_I915_GEM_EXECBUFFER2 supports user defined execution * priorities and the driver will attempt to execute batches in priority order.