From patchwork Fri Nov 16 18:42:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10686867 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 0285517EE for ; Fri, 16 Nov 2018 18:44:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E968C2895F for ; Fri, 16 Nov 2018 18:44:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDFF828E12; Fri, 16 Nov 2018 18:44:23 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 653EC28A31 for ; Fri, 16 Nov 2018 18:44:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390222AbeKQE5y (ORCPT ); Fri, 16 Nov 2018 23:57:54 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:36940 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729497AbeKQE5y (ORCPT ); Fri, 16 Nov 2018 23:57:54 -0500 Received: by mail-yb1-f194.google.com with SMTP id d18-v6so10155027yba.4 for ; Fri, 16 Nov 2018 10:44:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aL33aBBb5EQqyCjBoq1JuCNk7QTJNBXCNaQlqfeIlKM=; b=EPgtqoCsVmRq1GZLeDMw9xJm6ScMbG3sayFzRzXdfxhHI4DqCF6SDZEHC7n41VwSAF +MRp0jGHIKIqkNEM/XlNnspERSqnykma55XmyIYXUF1ORZ/kUM5nL1i5sJJc442M7x5P aSuomvFaj5IuUOWc+HRy3+mW907uVOoZfDb1Qzqfx4Et9id73i2moCCkxtP8B14UBoAQ zZQMHUJe6MkH0QUeBkp3PFL5yCxlUXVkrQ0s7fEugmronKJMvH6d4WsPEulKjBEVRGAg Z4qqk4xIuZqf/C0u6Q3T8q9xDu/v7BoGjihPJBOuEHO8HzmdTFI0y+cZDJrkTUd4zuFg oY+A== 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:mime-version:content-transfer-encoding; bh=aL33aBBb5EQqyCjBoq1JuCNk7QTJNBXCNaQlqfeIlKM=; b=BYwROXZWieizxRklW07RJJ1diJ2ink5T4c/Ydd4BZqu9hVFrYSgTgaLM8UjkgXi80N lCf6ZPTwUX4Jc7Nedq29NPfvsuph9BPTdj1ZctCdbS8D0Z8MivOO+r06YscqTHM4/HTC WNHBTvnFyOkk/GV5FRSQBtedexHSSpctKzyTaq2fGEoLLXJATbQyDXxEygJ3EuT3cLV+ rIJR3R5IaqyGn9ZGq9RVxLxrv8S8IDtCAMUxDrzDxX5bwDE8U2KX2F+60hOWI+7gvwLo eZOv+5Gs+kfTiMmmJvR+GA3BOfKJcmyNzG4yqIG3tNXBhlfVCOqG1sshTb6cveGYC3Na n3vg== X-Gm-Message-State: AGRZ1gLp8J2mmsgFGjq19kVTlGIf+Zx54dir67w9e5UNbH2eBBwP45mB xysSXfKaFcC0+3bQWweWhJFAOA== X-Google-Smtp-Source: AJdET5d/mUxGJHp3KUBvLDh4JK2TMi7rzLiJtuUbz4rDZWFKGUdXj/vo3RNsnIGiwS3ppgASxOtbaA== X-Received: by 2002:a25:3c81:: with SMTP id j123-v6mr11374646yba.250.1542393861397; Fri, 16 Nov 2018 10:44:21 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id b144sm5359134ywa.33.2018.11.16.10.44.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 10:44:21 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: robdclark@gmail.com, jsanka@codeaurora.org, Sean Paul Subject: [PATCH v2 24/24] drm/msm: dpu: Remove crtc_lock Date: Fri, 16 Nov 2018 13:42:34 -0500 Message-Id: <20181116184238.170034-25-sean@poorly.run> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog In-Reply-To: <20181116184238.170034-1-sean@poorly.run> References: <20181116184238.170034-1-sean@poorly.run> MIME-Version: 1.0 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 From: Sean Paul Each time it's called we're holding the crtc modeset lock, so it's redundant. Changes in v2: - None Signed-off-by: Sean Paul Reviewed-by: Jeykumar Sankaran --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 11 ----------- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 3 --- 2 files changed, 14 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index f15cba2584a0..70b5104d1111 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -69,7 +69,6 @@ static void dpu_crtc_destroy(struct drm_crtc *crtc) return; drm_crtc_cleanup(crtc); - mutex_destroy(&dpu_crtc->crtc_lock); kfree(dpu_crtc); } @@ -806,8 +805,6 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, old_crtc_state->encoder_mask) dpu_encoder_assign_crtc(encoder, NULL); - mutex_lock(&dpu_crtc->crtc_lock); - /* wait for frame_event_done completion */ if (_dpu_crtc_wait_for_frame_done(crtc)) DPU_ERROR("crtc%d wait for frame done failed;frame_pending%d\n", @@ -836,8 +833,6 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, cstate->bw_control = false; cstate->bw_split_vote = false; - mutex_unlock(&dpu_crtc->crtc_lock); - if (crtc->state->event && !crtc->state->active) { spin_lock_irqsave(&crtc->dev->event_lock, flags); drm_crtc_send_vblank_event(crtc, crtc->state->event); @@ -870,12 +865,9 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, dpu_encoder_register_frame_event_callback(encoder, dpu_crtc_frame_event_cb, (void *)crtc); - mutex_lock(&dpu_crtc->crtc_lock); trace_dpu_crtc_enable(DRMID(crtc), true, dpu_crtc); dpu_crtc->enabled = true; - mutex_unlock(&dpu_crtc->crtc_lock); - drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) dpu_encoder_assign_crtc(encoder, crtc); @@ -1177,7 +1169,6 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) drm_modeset_lock_all(crtc->dev); cstate = to_dpu_crtc_state(crtc->state); - mutex_lock(&dpu_crtc->crtc_lock); mode = &crtc->state->adjusted_mode; out_width = _dpu_crtc_get_mixer_width(cstate, mode); @@ -1264,7 +1255,6 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) dpu_crtc->vblank_cb_time = ktime_set(0, 0); } - mutex_unlock(&dpu_crtc->crtc_lock); drm_modeset_unlock_all(crtc->dev); return 0; @@ -1414,7 +1404,6 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane, crtc = &dpu_crtc->base; crtc->dev = dev; - mutex_init(&dpu_crtc->crtc_lock); spin_lock_init(&dpu_crtc->spin_lock); atomic_set(&dpu_crtc->frame_pending, 0); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h index 2b358546af49..34f0c4d4d774 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h @@ -140,7 +140,6 @@ struct dpu_crtc_frame_event { * @dirty_list : list of color processing features are dirty * @ad_dirty: list containing ad properties that are dirty * @ad_active: list containing ad properties that are active - * @crtc_lock : crtc lock around create, destroy and access. * @frame_pending : Whether or not an update is pending * @frame_events : static allocation of in-flight frame events * @frame_event_list : available frame event list @@ -173,8 +172,6 @@ struct dpu_crtc { struct list_head ad_dirty; struct list_head ad_active; - struct mutex crtc_lock; - atomic_t frame_pending; struct dpu_crtc_frame_event frame_events[DPU_CRTC_FRAME_EVENT_SIZE]; struct list_head frame_event_list;