From patchwork Wed Apr 12 15:55:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9677685 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 CF65A60383 for ; Wed, 12 Apr 2017 15:56:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2BFA28592 for ; Wed, 12 Apr 2017 15:56:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7E7428627; Wed, 12 Apr 2017 15:56: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 5A5D228592 for ; Wed, 12 Apr 2017 15:56:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33B0E6E753; Wed, 12 Apr 2017 15:56:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id B847C6E747 for ; Wed, 12 Apr 2017 15:56:34 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id d79so7335028wmi.2 for ; Wed, 12 Apr 2017 08:56:34 -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=L3UoxnT+7bJwooLCEMVGqTr08cYnjrDt0h937QzGsq4=; b=Ncg5Iu0PQwLJ60YMkb6oPvY8j+oWY4KsLsgrgKs+dbEhc3B9leUYqJUVGPG5IbU+8T n1UoUqm60ZmHmIPmGEJp1bfHg3znxZHnMb+uKj6EXKCN8sWP/+ojb2dTh03u0TTBHEB3 le/EajlwJ73T7gYNmlJHsPYIUE2WAVpabvqIPs3nULUIJHMBpap7WVpHZXoGgO74jNIv +soHIaCSkNuSB+qtB2D9gDZ6WXVzlVdntvPwL5APWsGEU7vbASHArrfUgduITPhowngb rEttDACl5jUwp58mVsDwu/I85lNok+CVnafIRjyc8JCvYs4sDG6pUKkmzVMh9ac4mwNL n9Ag== 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=L3UoxnT+7bJwooLCEMVGqTr08cYnjrDt0h937QzGsq4=; b=AIEbf4aumAs3BvL4UGACKr4BwofIYhhpCt5SEIihi7hpq7s/CZIEgJC9eJBkPvPaD+ Su4ae5h75ytyZjpT5rXvFWYdSa/8mYEtTx0CK3H1tZuAKi81DmqFbjKbAnNTOSAgCFxg bJy0R5KKACkfZzuY6+drr9wdjTiMdKWBFNgGeEFUTOFaL5yG3aesSgPgnfgZ6EAiDvzx 4T36TPRJUyFL4UAPRGTEYu5Mgkj36tHkbL8end36skFk2Jachy73ntocYoakGxW4+bFZ F9+OOOZ3KLHZrdnL14daRz1RlkL6bKg0hZFlHMybaMJtcoIhlqSuQqS8fuU6T7qywSgQ hEzQ== X-Gm-Message-State: AN3rC/5RsFvTL5BL1UUJuj8JWUSq2YZKpG2xyVh+hvMVY3IJChMQojWM QVrdaxSClTsaow== X-Received: by 10.28.132.144 with SMTP id g138mr21004038wmd.51.1492012593452; Wed, 12 Apr 2017 08:56:33 -0700 (PDT) Received: from sixbynine.org (host-78-151-16-127.as13285.net. [78.151.16.127]) by smtp.gmail.com with ESMTPSA id d7sm26105256wrc.6.2017.04.12.08.56.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Apr 2017 08:56:32 -0700 (PDT) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Wed, 12 Apr 2017 16:55:50 +0100 Message-Id: <20170412155556.6602-10-robert@sixbynine.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170412155556.6602-1-robert@sixbynine.org> References: <20170412155556.6602-1-robert@sixbynine.org> Subject: [Intel-gfx] [PATCH v4 09/15] 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 Acked-by: Lionel Landwerlin --- drivers/gpu/drm/i915/i915_drv.c | 5 +++++ include/uapi/drm/i915_drm.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index bd85e3826b72..76a724b7cc22 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 9ee06ec8a2d6..99bfc3648454 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -412,6 +412,9 @@ typedef struct drm_i915_irq_wait { */ #define I915_PARAM_HAS_EXEC_FENCE 44 +/* Query the mask of slices available for this system */ +#define I915_PARAM_SLICE_MASK 45 + typedef struct drm_i915_getparam { __s32 param; /*