From patchwork Tue Oct 9 04:27:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeykumar Sankaran X-Patchwork-Id: 10631897 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B797F16B1 for ; Tue, 9 Oct 2018 04:29:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA28729A4D for ; Tue, 9 Oct 2018 04:29:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E4AB29A52; Tue, 9 Oct 2018 04:29:17 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 397C729A4D for ; Tue, 9 Oct 2018 04:29:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726548AbeJILoN (ORCPT ); Tue, 9 Oct 2018 07:44:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34092 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbeJILoN (ORCPT ); Tue, 9 Oct 2018 07:44:13 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B0BA460C8D; Tue, 9 Oct 2018 04:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059353; bh=JEkOzTFHU9Zufq5JxQfKULsyuZQrxBhHLA5BnkDw184=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NaUqN3U5lnhcv4/5DohiiVajJM8c9ZRIqx8XyVB6TYDCVQw9CrvBfiqHaT6moaS3b JueZxzX4xfUGoES2wPgPkMFIOrbXs2QCK36clLIroLBXEmB/X/csaZMVs0RyEV1afO sNxY6mLsPkpPZ10M937gx+cracEQJmFLOPa4cTrY= Received: from jeykumar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jsanka@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 127E260E72; Tue, 9 Oct 2018 04:28:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059303; bh=JEkOzTFHU9Zufq5JxQfKULsyuZQrxBhHLA5BnkDw184=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WiuqfCK4shaLwtYtc3fjFOLIbr5IlRzv1TOhyAGFx9M0FxTdGuyVFixWcGJKbftmd OXFljhRO6xqiWLupdCe4ZQGXxi+fHxp5obTxckoBM2KygosOLZuz5aFLUdnEoClzZs w1RxrlGRZEGsYBjOZ9XHS4FP5k3Pw4QJ8AJomwI8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 127E260E72 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jsanka@codeaurora.org From: Jeykumar Sankaran To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: Jeykumar Sankaran , seanpaul@chromium.org, robdclark@gmail.com, hoegsberg@google.com, jcrouse@codeaurora.org Subject: [PATCH 24/25] drm/msm/dpu: remove mutex locking for RM interfaces Date: Mon, 8 Oct 2018 21:27:41 -0700 Message-Id: <1539059262-8326-25-git-send-email-jsanka@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539059262-8326-1-git-send-email-jsanka@codeaurora.org> References: <1539059262-8326-1-git-send-email-jsanka@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since HW reservations are happening through atomic_check and all the display commits are catered by a single commit thread, it is not necessary to protect the interfaces by a separate mutex. Signed-off-by: Jeykumar Sankaran --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 24 ------------------------ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 2 -- 2 files changed, 26 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index 34e09aa..9a63128 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -74,8 +74,6 @@ int dpu_rm_destroy(struct dpu_rm *rm) } } - mutex_destroy(&rm->rm_lock); - return 0; } @@ -146,8 +144,6 @@ int dpu_rm_init(struct dpu_rm *rm, /* Clear, setup lists */ memset(rm, 0, sizeof(*rm)); - mutex_init(&rm->rm_lock); - for (type = 0; type < DPU_HW_BLK_MAX; type++) INIT_LIST_HEAD(&rm->hw_blks[type]); @@ -473,11 +469,7 @@ void dpu_rm_crtc_release(struct dpu_rm *rm, struct drm_crtc_state *crtc_state) { struct dpu_crtc_state *dpu_cstate = to_dpu_crtc_state(crtc_state); - mutex_lock(&rm->rm_lock); - _dpu_rm_crtc_release_reservation(rm, dpu_cstate); - - mutex_unlock(&rm->rm_lock); } void dpu_rm_encoder_release(struct dpu_rm *rm, @@ -485,11 +477,7 @@ void dpu_rm_encoder_release(struct dpu_rm *rm, { struct dpu_crtc_state *dpu_cstate = to_dpu_crtc_state(crtc_state); - mutex_lock(&rm->rm_lock); - _dpu_rm_encoder_release_reservation(rm, dpu_cstate); - - mutex_unlock(&rm->rm_lock); } int dpu_rm_crtc_reserve( @@ -506,8 +494,6 @@ int dpu_rm_crtc_reserve( DRM_DEBUG_KMS("reserving hw for crtc %d\n", crtc_state->crtc->base.id); - mutex_lock(&rm->rm_lock); - ret = _dpu_rm_reserve_lms(rm, dpu_cstate); if (ret) { DPU_ERROR("unable to find appropriate mixers\n"); @@ -520,15 +506,11 @@ int dpu_rm_crtc_reserve( goto cleanup_on_fail; } - mutex_unlock(&rm->rm_lock); - return ret; cleanup_on_fail: _dpu_rm_crtc_release_reservation(rm, dpu_cstate); - mutex_unlock(&rm->rm_lock); - return ret; } @@ -547,8 +529,6 @@ int dpu_rm_encoder_reserve( DRM_DEBUG_KMS("reserving hw for enc %d\n", enc->base.id); - mutex_lock(&rm->rm_lock); - dpu_encoder_get_hw_resources(enc, &hw_res); ret = _dpu_rm_reserve_intfs(rm, dpu_cstate, &hw_res); @@ -557,14 +537,10 @@ int dpu_rm_encoder_reserve( goto cleanup_on_fail; } - mutex_unlock(&rm->rm_lock); - return ret; cleanup_on_fail: _dpu_rm_encoder_release_reservation(rm, dpu_cstate); - mutex_unlock(&rm->rm_lock); - return ret; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h index 8676fa5..9acbeba 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h @@ -24,11 +24,9 @@ * struct dpu_rm - DPU dynamic hardware resource manager * @hw_blks: array of lists of hardware resources present in the system, one * list per type of hardware block - * @rm_lock: resource manager mutex */ struct dpu_rm { struct list_head hw_blks[DPU_HW_BLK_MAX]; - struct mutex rm_lock; }; /**