From patchwork Tue Sep 25 21:10:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10614843 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 98F3B180E for ; Tue, 25 Sep 2018 21:10:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B0562ADC0 for ; Tue, 25 Sep 2018 21:10:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DA122ADB2; Tue, 25 Sep 2018 21:10:30 +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 0E2652ADCF for ; Tue, 25 Sep 2018 21:10:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726319AbeIZDT4 (ORCPT ); Tue, 25 Sep 2018 23:19:56 -0400 Received: from mail-yw1-f42.google.com ([209.85.161.42]:42232 "EHLO mail-yw1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbeIZDT4 (ORCPT ); Tue, 25 Sep 2018 23:19:56 -0400 Received: by mail-yw1-f42.google.com with SMTP id h134-v6so6758943ywc.9 for ; Tue, 25 Sep 2018 14:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aX4U4B290ECaR0V3f1mgtove8/YC5Sw2XBV8kLsocu4=; b=keiYzb1Xf5MbhiReH1St79vaL672+W0tAlIEuVygsc+J+6X71KapF1aJa86Tw1bd2Z cItDk5cb4N5dIjUj/3sb+oGaeJ1nKfDqK6al62HnGE3AGozAr13eg05NcPdusREz0fwb 2YokF8jaDKvv2GAkd+seyWbaHGl4ZmZHkd7tg= 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=aX4U4B290ECaR0V3f1mgtove8/YC5Sw2XBV8kLsocu4=; b=b+tyjByBsFYJ7hFwj2HvzV3OpxbcZLme6QQwos8CBGPNQ+labtCXDb6sCIaiGmbt7a B5xBleG2d13Nnq6OzsnRrwU/6URHBYAR06QfIANAGCu/xiWS6LuoimpVg/ELSbOa5bJo UmK9ZWlByYjucunXH6mbzUk4o4ByEOX/LZ4u1ilIjNu9FdPIx4QDliqRRXpbCwxfjlwb RZB1417fNMEH20f9WYpPMnuNBFUucQncKcY3C+cpzy8brPgFGv1KsEBaCNHbwjOVVDpf oxlNK9Cb2mFq8nbnszi2pe+DYjH2xB/EaiKTxXOynKsm1ew1nbl5je07DpeWWKFk5yCC 2uyQ== X-Gm-Message-State: ABuFfohl35PtrxQ0R+YU37/5hzevkseNqNzTl1WbFNrlr1qNobnXd1ny Z81F90BXbPxUKt0y+4YhBnleBA== X-Google-Smtp-Source: ACcGV62NN0gFoc3PxWZZMCP/0Om3qwxFHe2R7FX5C4ERGhEI9aihRuLTyLj2z4oYDgJnhKYHFck+AA== X-Received: by 2002:a81:270d:: with SMTP id n13-v6mr1571222ywn.347.1537909827872; Tue, 25 Sep 2018 14:10:27 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id b71-v6sm5343698ywa.48.2018.09.25.14.10.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 14:10:26 -0700 (PDT) From: Bruce Wang To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: seanpaul@chromium.org, jsanka@codeaurora.org, robdclark@gmail.com, abhinavk@codeaurora.org, jcrouse@codeaurora.org Subject: [PATCH v3 7/7] drm/msm/dpu: Revise _dpu_plane_get_aspace Date: Tue, 25 Sep 2018 17:10:25 -0400 Message-Id: <20180925211025.148140-1-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <41c32e7d920f1e9d5d80d82cdd3a2067@codeaurora.org> References: <41c32e7d920f1e9d5d80d82cdd3a2067@codeaurora.org> 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 Remove unneeded checks from _dpu_plane_get_aspace. v3: change _dpu_plane_get_aspace to return a struct *msm_gem_address_space instead passing in a pointer of the same type to edit. Remove uneeded arguments. Signed-off-by: Bruce Wang Reviewed-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 35 ++++------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 924e321a5ac4..02c27240d38f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -431,23 +431,12 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane) /** * _dpu_plane_get_aspace: gets the address space */ -static int _dpu_plane_get_aspace( - struct dpu_plane *pdpu, - struct dpu_plane_state *pstate, - struct msm_gem_address_space **aspace) +static inline struct msm_gem_address_space *_dpu_plane_get_aspace( + struct dpu_plane *pdpu) { - struct dpu_kms *kms; - - if (!pdpu || !pstate || !aspace) { - DPU_ERROR("invalid parameters\n"); - return -EINVAL; - } - - kms = _dpu_plane_get_kms(&pdpu->base); + struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base); - *aspace = kms->base.aspace; - - return 0; + return kms->base.aspace; } static inline void _dpu_plane_set_scanout(struct drm_plane *plane, @@ -456,15 +445,9 @@ static inline void _dpu_plane_set_scanout(struct drm_plane *plane, struct drm_framebuffer *fb) { struct dpu_plane *pdpu = to_dpu_plane(plane); - struct msm_gem_address_space *aspace = NULL; + struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu); int ret; - ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace); - if (ret) { - DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret); - return; - } - ret = dpu_format_populate_layout(aspace, fb, &pipe_cfg->layout); if (ret == -EAGAIN) DPU_DEBUG_PLANE(pdpu, "not updating same src addrs\n"); @@ -816,7 +799,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane, struct drm_gem_object *obj; struct msm_gem_object *msm_obj; struct dma_fence *fence; - struct msm_gem_address_space *aspace; + struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu); int ret; if (!new_state->fb) @@ -824,12 +807,6 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane, DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id); - ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace); - if (ret) { - DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n"); - return ret; - } - /* cache aspace */ pstate->aspace = aspace;