From patchwork Wed Apr 12 15:55:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9677687 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 F283660383 for ; Wed, 12 Apr 2017 15:56:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5B7128592 for ; Wed, 12 Apr 2017 15:56:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA1112862B; Wed, 12 Apr 2017 15:56:41 +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 849AC28592 for ; Wed, 12 Apr 2017 15:56:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EEF016E759; Wed, 12 Apr 2017 15:56:38 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 91E506E759 for ; Wed, 12 Apr 2017 15:56:36 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id l28so4871643wre.0 for ; Wed, 12 Apr 2017 08:56: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=CBQP5dhzjHVdEHV96Whzqno3kYf91GEts/eVF0JzzcM=; b=AbgBdATeMoYkARiEP44NdKqFNjfTP6t/DH+vmVX+5reRXWFYCgkMXc9qD9BMhZ5LXd nMTTdZ1AfAaIWFmdvMNlKMfVNUUt2zc45e/cWFa7oH8KS57RbTRLLQR0fyeTLvc6uKQY nSj/BxjG2eFpzKy/KLRcvdwB6Q6d9aMY4YeiYEel69ivA8e6oGKSpO30ROoWCVcVpsT2 gvPgmridVZkO1vAFSuIvKFjpuzDD8QiVFMWsf9xMhVVk6Iir9cL/uXq2qZ5GJs1lfQGD IPskGcyps5WNilgl6Ortop2HIG1tepqmUcq06SZWMEz1DHarDQxKaHlKrWs6EFhoaJX+ OOQA== 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=CBQP5dhzjHVdEHV96Whzqno3kYf91GEts/eVF0JzzcM=; b=Xz2CbRbod6+upAnE+kSWR/dXcYLSbegdrQdp7F9FWWPG3KWsd3sqcgECW6KnGzqAv6 YpkMrIZlmj9CDsc6yRePmnnZal76S/BOR6ZxrgKlh0F+FoKkhPYrE2TcCF79usGBncWi QdY9d/U/ltNS0Tzqc53ul1QoxhT3PkVY5bCrzVX7S8hFX5dRcaSEPfWQNYjKBDCw9BM1 AGEByKMZjGLM2OmGePSA0p64FPTzx3D4Nn8ZZJJJ0i+4H8V8H0wxU90hvS80HcYDoSfn quH6ug3By/y4GcrMoF4QtzS9JJZeV5U1Gw/o8c4AFtD1GhyQaxFVbKmo11hBcmYE4Pty dtPQ== X-Gm-Message-State: AN3rC/7915M6LKWBPJ9rrqOU1E2QWN3Vaw9PHQoiNLJFsjymGzp9kFYNoInh/Hj1W9bn/g== X-Received: by 10.223.147.197 with SMTP id 63mr3647695wrp.135.1492012595265; Wed, 12 Apr 2017 08:56:35 -0700 (PDT) Received: from sixbynine.org (host-78-151-16-127.as13285.net. [78.151.16.127]) by smtp.gmail.com with ESMTPSA id t16sm26093838wra.44.2017.04.12.08.56.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Apr 2017 08:56:34 -0700 (PDT) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Wed, 12 Apr 2017 16:55:51 +0100 Message-Id: <20170412155556.6602-11-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 10/15] drm/i915: expose _SUBSLICE_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 Assuming a uniform mask across all slices, this enables userspace to determine the specific sub slices enabled. This information is required, for example, to be able to analyse some OA counter reports where the counter configuration depends on the HW sub 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 | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 76a724b7cc22..133ab46bf2f2 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -362,6 +362,11 @@ static int i915_getparam(struct drm_device *dev, void *data, if (!value) return -ENODEV; break; + case I915_PARAM_SUBSLICE_MASK: + value = INTEL_INFO(dev_priv)->sseu.subslice_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 99bfc3648454..689fd7a418a7 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -415,6 +415,11 @@ typedef struct drm_i915_irq_wait { /* Query the mask of slices available for this system */ #define I915_PARAM_SLICE_MASK 45 +/* Assuming it's uniform for each slice, this queries the mask of subslices + * per-slice for this system. + */ +#define I915_PARAM_SUBSLICE_MASK 46 + typedef struct drm_i915_getparam { __s32 param; /*