Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3831858pxb; Mon, 4 Oct 2021 10:32:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHKIqIf+QLA7IlG9jQPkhSBU2Es122htRC3zD/gozzH49IbsVFdcDXZniOXqSFRrzk9P6b X-Received: by 2002:a17:90a:9403:: with SMTP id r3mr1732357pjo.220.1633368732942; Mon, 04 Oct 2021 10:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633368732; cv=none; d=google.com; s=arc-20160816; b=GBTfurvL4Q/UGyKJ3u6SgSGBpiEifk2nNA2X+tVQZ7MNsgF7njH5GSiok9zxT0MX9r 5/YtPkrokpvBqwqdeklKJw9+dFOYzHhc/VYSXHNKnklkGuINTtTSSxWYN0sAft/hquE+ Ie6miQdF/WWh9WnWK7RDFHYYgxEnaZ02Bj1dWuMlEg4dTdc/UyCamG7qdvyFY5h3Ztv9 YrFTrI7Ja1Kf4fcOSOlpU2yWRGsjC69PB/xeenzGcbulMumxe4uMg4amqypFzFRoYjkH XwaP0YeXgbD8IYNiqVs4ozO86C6fKeDFBZKNrMXl1A9l1G0E5C+JUX5ZNt2v3XQCZAJ0 e4eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Qdif5m3+Rz38qVt6JASd0nvrzWNeR2aKBVpXtRVA7pI=; b=DF6GiuzdWu2SoyyDLC/y+qQ3HBQ0cuIRxp87Tq5MgboWsOaZBa6oYTMPy22lM7RcmO WOS3vCOqk2p0pbT3vZPWcmgFV91T97R8m4Cs1ecLfIYNIgDKN7YESterZSLjY8YFPR4L Hu4nEdAeiStPzP+78DbkccXEyWI1FKanHywRi89PS05vPqB7xeHB8IDJam0QnNoF7I57 3cgW7ygWd/HRQacpbP22nhwGdgrDtY/oBBAL5kSqMAEFSpbF2SToMUdNikum1k5+ydF8 xPxsW/fOtQSxiHm+0w2AfqorJtIwHs5HVluGd8WNf5EQZ6PyRyMCWmQumzayUDpem620 QHHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 26si5551303pgk.191.2021.10.04.10.31.52; Mon, 04 Oct 2021 10:32:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235035AbhJDOrR (ORCPT + 99 others); Mon, 4 Oct 2021 10:47:17 -0400 Received: from mga01.intel.com ([192.55.52.88]:16806 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234938AbhJDOrK (ORCPT ); Mon, 4 Oct 2021 10:47:10 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="248714014" X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="248714014" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 07:37:23 -0700 X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="622303705" Received: from shearne-mobl.ger.corp.intel.com (HELO tursulin-mobl2.home) ([10.213.208.122]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 07:37:19 -0700 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tvrtko Ursulin , Matthew Brost , Daniele Ceraolo Spurio Subject: [RFC 6/8] drm/i915: Make some recently added vfuncs use full scheduling attribute Date: Mon, 4 Oct 2021 15:36:48 +0100 Message-Id: <20211004143650.699120-7-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004143650.699120-1-tvrtko.ursulin@linux.intel.com> References: <20211004143650.699120-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tvrtko Ursulin Code added in 71ed60112d5d ("drm/i915: Add kick_backend function to i915_sched_engine") and ee242ca704d3 ("drm/i915/guc: Implement GuC priority management") introduced some scheduling related vfuncs which take integer request priority as argument. Make them instead take struct i915_sched_attr, which is the type encapsulating this information, so it probably aligns with the design better. It definitely enables extending the set of scheduling attributes. Signed-off-by: Tvrtko Ursulin Cc: Matthew Brost Cc: Daniele Ceraolo Spurio --- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 4 +++- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 3 ++- drivers/gpu/drm/i915/i915_scheduler.c | 4 ++-- drivers/gpu/drm/i915/i915_scheduler_types.h | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c index 7147fe80919e..e91d803a6453 100644 --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -3216,11 +3216,13 @@ static bool can_preempt(struct intel_engine_cs *engine) return engine->class != RENDER_CLASS; } -static void kick_execlists(const struct i915_request *rq, int prio) +static void kick_execlists(const struct i915_request *rq, + const struct i915_sched_attr *attr) { struct intel_engine_cs *engine = rq->engine; struct i915_sched_engine *sched_engine = engine->sched_engine; const struct i915_request *inflight; + const int prio = attr->priority; /* * We only need to kick the tasklet once for the high priority diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index ba0de35f6323..b5883a4365ca 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -2414,9 +2414,10 @@ static void guc_init_breadcrumbs(struct intel_engine_cs *engine) } static void guc_bump_inflight_request_prio(struct i915_request *rq, - int prio) + const struct i915_sched_attr *attr) { struct intel_context *ce = rq->context; + const int prio = attr->priority; u8 new_guc_prio = map_i915_prio_to_guc_prio(prio); /* Short circuit function */ diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c index 762127dd56c5..534bab99fcdc 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.c +++ b/drivers/gpu/drm/i915/i915_scheduler.c @@ -255,7 +255,7 @@ static void __i915_schedule(struct i915_sched_node *node, /* Must be called before changing the nodes priority */ if (sched_engine->bump_inflight_request_prio) - sched_engine->bump_inflight_request_prio(from, prio); + sched_engine->bump_inflight_request_prio(from, attr); WRITE_ONCE(node->attr.priority, prio); @@ -280,7 +280,7 @@ static void __i915_schedule(struct i915_sched_node *node, /* Defer (tasklet) submission until after all of our updates. */ if (sched_engine->kick_backend) - sched_engine->kick_backend(node_to_request(node), prio); + sched_engine->kick_backend(node_to_request(node), attr); } spin_unlock(&sched_engine->lock); diff --git a/drivers/gpu/drm/i915/i915_scheduler_types.h b/drivers/gpu/drm/i915/i915_scheduler_types.h index b0a1b58c7893..24b9ac1c2ce2 100644 --- a/drivers/gpu/drm/i915/i915_scheduler_types.h +++ b/drivers/gpu/drm/i915/i915_scheduler_types.h @@ -177,13 +177,13 @@ struct i915_sched_engine { * @kick_backend: kick backend after a request's priority has changed */ void (*kick_backend)(const struct i915_request *rq, - int prio); + const struct i915_sched_attr *attr); /** * @bump_inflight_request_prio: update priority of an inflight request */ void (*bump_inflight_request_prio)(struct i915_request *rq, - int prio); + const struct i915_sched_attr *attr); /** * @retire_inflight_request_prio: indicate request is retired to -- 2.30.2