From patchwork Sat Sep 8 00:24:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeykumar Sankaran X-Patchwork-Id: 10592755 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 10BB4920 for ; Sat, 8 Sep 2018 00:25:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E72CA2B627 for ; Sat, 8 Sep 2018 00:25:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D845F2B646; Sat, 8 Sep 2018 00:25:02 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 654A92B627 for ; Sat, 8 Sep 2018 00:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726187AbeIHFI3 (ORCPT ); Sat, 8 Sep 2018 01:08:29 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40922 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbeIHFI3 (ORCPT ); Sat, 8 Sep 2018 01:08:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DC81A60B10; Sat, 8 Sep 2018 00:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536366300; bh=VzoaDhzlQHjtYpUpoJPbpye1nLwQUz+DwkiC0JGyFU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2uRcAa62G+y9jzlFQbj9S5Uax3MqLDPHlrgnCPbKyBMTKTWj02JXi+1EJA6ML7Ga Ke56rT1tnkFsjSJc5qmIZVi8E9Nz+u5vacbAU7EseRedTOzWLhbG1ONGJu9HSXXVKq idPEt44df5PvvsvyyDYSh75z09/zMsew9geqzbKo= 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 D4B2960BE2; Sat, 8 Sep 2018 00:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536366285; bh=VzoaDhzlQHjtYpUpoJPbpye1nLwQUz+DwkiC0JGyFU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VselUzqByx+Y2DVKSkgzHwDEyLX6AXp3dRIvyVD8j9YxthiL9qrh8ZHwm27LA7PDZ KW1RGtFmLAt134rwCCknh7GOpJKTMBFjxyc/fRz37A+wSTw+LTPxM5Xp5UIAAEXGjl NnzRcNNjTBySqIRkpB2oZUIoEVk46xXJ0f43jtGw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D4B2960BE2 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 v6 10/19] drm/msm/dpu: make crtc get_mixer_width helper static Date: Fri, 7 Sep 2018 17:24:18 -0700 Message-Id: <1536366267-22336-11-git-send-email-jsanka@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536366267-22336-1-git-send-email-jsanka@codeaurora.org> References: <1536366267-22336-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 Mark CRTC get_mixer_width helper API static as it is not used outside the file. changes in v4: - Patch introduced in the series changes in v5: - Simplify the inline function (Sean) changes in v6: - none Signed-off-by: Jeykumar Sankaran Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 12 +++++++++--- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 18 ------------------ 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index c6db877..448994f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -47,6 +47,12 @@ #define LEFT_MIXER 0 #define RIGHT_MIXER 1 +static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc_state *cstate, + struct drm_display_mode *mode) +{ + return mode->hdisplay / cstate->num_mixers; +} + static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) { struct msm_drm_private *priv; @@ -601,7 +607,7 @@ static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc, cstate = to_dpu_crtc_state(state); adj_mode = &state->adjusted_mode; - crtc_split_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, adj_mode); + crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode); for (i = 0; i < dpu_crtc->num_mixers; i++) { struct drm_rect *r = &cstate->lm_bounds[i]; @@ -1283,7 +1289,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, memset(pipe_staged, 0, sizeof(pipe_staged)); - mixer_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode); + mixer_width = _dpu_crtc_get_mixer_width(cstate, mode); _dpu_crtc_setup_lm_bounds(crtc, state); @@ -1519,7 +1525,7 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) mutex_lock(&dpu_crtc->crtc_lock); mode = &crtc->state->adjusted_mode; - out_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode); + out_width = _dpu_crtc_get_mixer_width(cstate, mode); seq_printf(s, "crtc:%d width:%d height:%d\n", crtc->base.id, mode->hdisplay, mode->vdisplay); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h index ec9c538..5e4dc5c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h @@ -238,24 +238,6 @@ struct dpu_crtc_state { container_of(x, struct dpu_crtc_state, base) /** - * dpu_crtc_get_mixer_width - get the mixer width - * Mixer width will be same as panel width(/2 for split) - */ -static inline int dpu_crtc_get_mixer_width(struct dpu_crtc *dpu_crtc, - struct dpu_crtc_state *cstate, struct drm_display_mode *mode) -{ - u32 mixer_width; - - if (!dpu_crtc || !cstate || !mode) - return 0; - - mixer_width = (dpu_crtc->num_mixers == CRTC_DUAL_MIXERS ? - mode->hdisplay / CRTC_DUAL_MIXERS : mode->hdisplay); - - return mixer_width; -} - -/** * dpu_crtc_get_mixer_height - get the mixer height * Mixer height will be same as panel height */