From patchwork Wed Apr 18 09:33:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10347693 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 D8A2D60244 for ; Wed, 18 Apr 2018 09:34:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2D9C28590 for ; Wed, 18 Apr 2018 09:34:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5908285CD; Wed, 18 Apr 2018 09:34:13 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 3096928590 for ; Wed, 18 Apr 2018 09:34:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B0FA6E54D; Wed, 18 Apr 2018 09:34:12 +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 C553C6E54D for ; Wed, 18 Apr 2018 09:34:10 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id u4-v6so2897019wrg.10 for ; Wed, 18 Apr 2018 02:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Ur5RB2H0vWn6ZIZQgHOOwD9fj7tXq9aDsH9oOMM+fe8=; b=ZqdGfrdlur24bAVg7H7oPd5gnELZxxGYP6mymjCfHB0kglSqF4WuCtTl/zD83R5XHl dzpn9Lrn5M/p7somJSj6E+B9hexV8wEdsNksHilde0mKlaAD+qzOgjnEyW9esnMlZAmy RLaBEL94W8Cw7IYcdjQxHNSqWz8/wLBdrtI2lEkvHmWyvnus4w7XDBZF88soGg3bUrgK BdWnnX9na0BhFRNJ+0sV4pMAG/DuzHAd6ahcOAMYJmLmNWxmKsEM8F6NEVBfL4U8IMa6 wnP5gQUXUHneDcFKUq3WHtZwWtvBtHCBFUOsrFNDur5Dk4sbAFX+1rS3ap0A3qKisLSU SgaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ur5RB2H0vWn6ZIZQgHOOwD9fj7tXq9aDsH9oOMM+fe8=; b=btrx4IxP7Wozj3BKn8lPw3tzLl9fZDkL5OoZyMw7MHCn4tIFpXZQDjbB3gEfN1Q6DQ m/MZHybo8n4q972bnCOeE1s/aWTgI6CTel3jgu2vYgza5HerPwtlwBETkq+IvOpF0uAw yv3zv9GLHPppJOC7+0g6n/hwBmHAhTN2XboU6fAwK3vEIgc4sEH9SIPRvWVhT5L3CwQt I+raj8xTJBqCqKPmaFT8rnAVXLrkNfJiAMgXd5KLKSy2SzazC6KAAFBX8rJHOwqHEO8u tK+b0dwPGPURDHsMiOmg/k7fCC3aldwoGtos6vTEJLPDnwEtJKralgRVSLS+o/FButaK CFOQ== X-Gm-Message-State: ALQs6tD1LQx1iEKBqVqR/UNqX6v9ntKISvMH38gIFndsGWrlIOjUQHqi 3Tg5Ko2V1bm8S/v9bAocWFMOBU+e X-Google-Smtp-Source: AIpwx499Od8OA+9T5algox0c+I1bHh5kttZObMTmQTFaCilAcv0X/Tza58Nm1R3qyYB806K46cQWhw== X-Received: by 2002:adf:a3dd:: with SMTP id m29-v6mr1136857wrb.4.1524044049222; Wed, 18 Apr 2018 02:34:09 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id x22-v6sm716946wrd.69.2018.04.18.02.34.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Apr 2018 02:34:08 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Wed, 18 Apr 2018 10:33:42 +0100 Message-Id: <20180418093342.449-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 Subject: [Intel-gfx] [PATCH] drm/i915/icl: Adjust BSD2 semantics to mean any second VCS instance X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 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 From: Tvrtko Ursulin Currently our driver assumes BSD2 means hardware engine instance number two. This does not work for Icelake parts with two VCS engines, but which are hardware instances 0 and 2, and not 0 and 1 as with previous parts. This makes the second engine not discoverable via HAS_BSD2 get param, nor it can be targetted by execbuf. While we are working on the next generation execbuf put in a hack which allows discovery and access to this second VCS engine using legacy ABI. Signed-off-by: Tvrtko Ursulin Cc: Chris Wilson Cc: Jon Bloomfield Cc: Tony Ye Reviewed-by: Jon Bloomfield --- Compile tested only. Also, one could argue if this is just a temporary hack or could actually make sense to have this permanently in. It feels like the ABI semantics of BSD2 are blurry, or at least could be re-blurred for Gen11. --- drivers/gpu/drm/i915/i915_drv.c | 8 +++++++- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index b7dbeba72dec..a185366d9beb 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -331,7 +331,13 @@ static int i915_getparam_ioctl(struct drm_device *dev, void *data, value = !!dev_priv->engine[VECS]; break; case I915_PARAM_HAS_BSD2: - value = !!dev_priv->engine[VCS2]; + /* + * FIXME: Temporary hack for Icelake. + * + * Make semantics of HAS_BSD2 "has second", or "has two" VDBOXes + * instead of "has VDBOX 2nd hardware instance". + */ + value = dev_priv->engine[VCS2] || dev_priv->engine[VCS3]; break; case I915_PARAM_HAS_LLC: value = HAS_LLC(dev_priv); diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index c74f5df3fb5a..80b32460567d 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -2052,7 +2052,9 @@ eb_select_engine(struct drm_i915_private *dev_priv, return NULL; } - if (user_ring_id == I915_EXEC_BSD && HAS_BSD2(dev_priv)) { + if (user_ring_id == I915_EXEC_BSD && + (INTEL_INFO(dev_priv)->ring_mask & + (ENGINE_MASK(_VCS(1)) | ENGINE_MASK(_VCS(2))))) { unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK; if (bsd_idx == I915_EXEC_BSD_DEFAULT) { @@ -2068,6 +2070,12 @@ eb_select_engine(struct drm_i915_private *dev_priv, } engine = dev_priv->engine[_VCS(bsd_idx)]; + + /* + * FIXME Temporarily map VCS2 to VCS1 on Icelake. + */ + if (!engine && bsd_idx) + engine = dev_priv->engine[_VCS(2)]; } else { engine = dev_priv->engine[user_ring_map[user_ring_id]]; }