From patchwork Thu Jul 12 06:36:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nayan Deshmukh X-Patchwork-Id: 10521127 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 6F56F602C8 for ; Thu, 12 Jul 2018 06:37:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 480D9291F1 for ; Thu, 12 Jul 2018 06:37:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C113291FF; Thu, 12 Jul 2018 06:37:07 +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.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 F38B3291F1 for ; Thu, 12 Jul 2018 06:37:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61C3E6EE5B; Thu, 12 Jul 2018 06:37:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id BFAB96EE59; Thu, 12 Jul 2018 06:37:02 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id b17-v6so20002939pfi.0; Wed, 11 Jul 2018 23:37:02 -0700 (PDT) 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:in-reply-to :references; bh=T4aS18nWn5u32/+sis1a/1V5YuQGV16bG9Aqp+3beJc=; b=dS9ej0CwXgyPL2dk7jgFTkGDhlkEN/eICF9KT7w54R1646FbuyOTpSSeKFELsz5GWm uahCvizccdsQERgR2PjJ3IA/8INAXDmIW3jTh+yWqX2l1i4Pxfbk6SJtCYiJk6cW1Y8z EXeTB2mdhrjbbDge90Z3Sc4+bK2o2ssTFf9xQyt1rgdYIeDNT+x+Ok4kmFLRCzJ/wq02 +t9Fx9GQzR6ZwuTDk45EUgQcyo4EDENbQJjh9Vy1W/mv17h/81lJ8oOmvj85QMjnvE6R t01fC8mmHGd77dquwdAPBZaWhjYmJH0xMPh5ozPvMUwejHi6kvu1xRO05OYHYGG3qvFq ZlAA== X-Gm-Message-State: AOUpUlH5o03qjCusfNP5XE5xaUivPOI80NFh9k9YEzQA1TRUhAOt7WPn TH616si8NzHxuFIE8lZH4KxTW1ip X-Google-Smtp-Source: AAOMgpecSKS9d/obKV8QVlZeue7W5rqSzaZyQAmCivJdf42LHATuA000IdlYRz4tvt3GcWqIuy9AAg== X-Received: by 2002:a63:440a:: with SMTP id r10-v6mr918975pga.27.1531377422144; Wed, 11 Jul 2018 23:37:02 -0700 (PDT) Received: from localhost.localdomain ([157.34.9.220]) by smtp.gmail.com with ESMTPSA id 5-v6sm48247096pgc.86.2018.07.11.23.36.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 23:37:01 -0700 (PDT) From: Nayan Deshmukh To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/scheduler: add a pointer to scheduler in the rq Date: Thu, 12 Jul 2018 12:06:41 +0530 Message-Id: <20180712063643.8030-2-nayan26deshmukh@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180712063643.8030-1-nayan26deshmukh@gmail.com> References: <20180712063643.8030-1-nayan26deshmukh@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nayan Deshmukh , amd-gfx@lists.freedesktop.org, christian.koenig@amd.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nayan Deshmukh Acked-by: Eric Anholt --- drivers/gpu/drm/scheduler/gpu_scheduler.c | 6 ++++-- include/drm/gpu_scheduler.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c index 7d2560699b84..429b1328653a 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c @@ -69,11 +69,13 @@ static void drm_sched_process_job(struct dma_fence *f, struct dma_fence_cb *cb); * * Initializes a scheduler runqueue. */ -static void drm_sched_rq_init(struct drm_sched_rq *rq) +static void drm_sched_rq_init(struct drm_gpu_scheduler *sched, + struct drm_sched_rq *rq) { spin_lock_init(&rq->lock); INIT_LIST_HEAD(&rq->entities); rq->current_entity = NULL; + rq->sched = sched; } /** @@ -926,7 +928,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, sched->timeout = timeout; sched->hang_limit = hang_limit; for (i = DRM_SCHED_PRIORITY_MIN; i < DRM_SCHED_PRIORITY_MAX; i++) - drm_sched_rq_init(&sched->sched_rq[i]); + drm_sched_rq_init(sched, &sched->sched_rq[i]); init_waitqueue_head(&sched->wake_up_worker); init_waitqueue_head(&sched->job_scheduled); diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 4214ceb71c05..43e93d6077cf 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -93,6 +93,7 @@ struct drm_sched_entity { * struct drm_sched_rq - queue of entities to be scheduled. * * @lock: to modify the entities list. + * @sched: the scheduler to which this rq belongs to. * @entities: list of the entities to be scheduled. * @current_entity: the entity which is to be scheduled. * @@ -102,6 +103,7 @@ struct drm_sched_entity { */ struct drm_sched_rq { spinlock_t lock; + struct drm_gpu_scheduler *sched; struct list_head entities; struct drm_sched_entity *current_entity; };