From patchwork Tue Jun 23 19:58:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB9AFC433E0 for ; Tue, 23 Jun 2020 21:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 910BF20663 for ; Tue, 23 Jun 2020 21:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592946534; bh=YySmSrVLeNy4genNaIZGwum5q8gYdmuRjgWpMDygdmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P28XXE1Y4B9/Fj0IzhrvQV1AMsZ2ih9e7aLUdlqfXokVF7QM/muX4ecv7gi5M9kIq CSnucuoqIP8DCzHc2xyELAd99AcmBKZ0NrD2axnpsnamYUYudeZJW7ZYbwl0LyGEDM LhQRjgs6DXaAJJHOt82d1wcfOVTiqQnYAmpkC3vQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392408AbgFWVIs (ORCPT ); Tue, 23 Jun 2020 17:08:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:56580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403776AbgFWUed (ORCPT ); Tue, 23 Jun 2020 16:34:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 974F4206C3; Tue, 23 Jun 2020 20:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944473; bh=YySmSrVLeNy4genNaIZGwum5q8gYdmuRjgWpMDygdmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GS6mokeI00d5XWVdBrl0j6qPxt/FrQWfJZRXNRRpwzVmNXxa/jcUBzVzeS1ZioSYI ah0wOflPsuaCIs3rGAWcBEVthqQeRsJ7crEEHnkAv7Wu2xhfgNwp+1Aw9iXHHfiUmv 5J6fAnm9iUZXO58gWXh3ScAuCVcJy6k6qsHUsqUM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Wilson , Mika Kuoppala , Joonas Lahtinen Subject: [PATCH 5.4 300/314] drm/i915: Whitelist context-local timestamp in the gen9 cmdparser Date: Tue, 23 Jun 2020 21:58:15 +0200 Message-Id: <20200623195353.305420025@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195338.770401005@linuxfoundation.org> References: <20200623195338.770401005@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chris Wilson commit 273500ae71711c040d258a7b3f4b6f44c368fff2 upstream. Allow batch buffers to read their own _local_ cumulative HW runtime of their logical context. Fixes: 0f2f39758341 ("drm/i915: Add gen9 BCS cmdparsing") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: # v5.4+ Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200601161942.30854-1-chris@chris-wilson.co.uk (cherry picked from commit f9496520df11de00fbafc3cbd693b9570d600ab3) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/gpu/drm/i915/i915_cmd_parser.c +++ b/drivers/gpu/drm/i915/i915_cmd_parser.c @@ -572,6 +572,9 @@ struct drm_i915_reg_descriptor { #define REG32(_reg, ...) \ { .addr = (_reg), __VA_ARGS__ } +#define REG32_IDX(_reg, idx) \ + { .addr = _reg(idx) } + /* * Convenience macro for adding 64-bit registers. * @@ -669,6 +672,7 @@ static const struct drm_i915_reg_descrip REG64_IDX(RING_TIMESTAMP, BSD_RING_BASE), REG32(BCS_SWCTRL), REG64_IDX(RING_TIMESTAMP, BLT_RING_BASE), + REG32_IDX(RING_CTX_TIMESTAMP, BLT_RING_BASE), REG64_IDX(BCS_GPR, 0), REG64_IDX(BCS_GPR, 1), REG64_IDX(BCS_GPR, 2),