From patchwork Mon Sep 24 17:45:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10612743 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 E7C5A13A4 for ; Mon, 24 Sep 2018 17:46:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D051D2A1C7 for ; Mon, 24 Sep 2018 17:46:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C448D2A24E; Mon, 24 Sep 2018 17:46:00 +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 4B7CC2A1C7 for ; Mon, 24 Sep 2018 17:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727497AbeIXXtP (ORCPT ); Mon, 24 Sep 2018 19:49:15 -0400 Received: from mail-yb1-f179.google.com ([209.85.219.179]:42165 "EHLO mail-yb1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbeIXXtP (ORCPT ); Mon, 24 Sep 2018 19:49:15 -0400 Received: by mail-yb1-f179.google.com with SMTP id p74-v6so8007180ybc.9 for ; Mon, 24 Sep 2018 10:45:58 -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=qUBLH1j2o7b0/MYL8lJA9glr4MplYV5pDAaYCqsaeA8=; b=lGdeccyN6vmzkH+uRZto4T9tqymM3cR48OfoyFZx0T04zGwW4dHkI2zqBWIc1CSO6L rNfxtm+LO1ZQV/Zwd13/VU+e9ZpN00ElqDhKm6VPtoo8UHVXezigoB4fJ14tlI2FqcL3 KCuMY6eqDEA/ETFNLMddjnOI+Zk/9IYkfkiuM= 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=qUBLH1j2o7b0/MYL8lJA9glr4MplYV5pDAaYCqsaeA8=; b=GRfKWPwqgFT1rbR00qmTOva3QC1//FlUWkIbpzsDMBzyczLrDJvJNL0h7bC0OGrXZe c0PYyzmOupPnfrJ4c6lpXMbJAbIv16AZUnVc7Y6IG+pZYX09qVIzHAe3GqoL+tmWBtkL fMNexrujUOP4FA81BW4xtiaOnm1BnTe7AFaXo/Dx26WNVisS+26Z99KhAYMNTkde5fD6 /azVa+NKF+ZaU8UPRprexEvbuF/8Amh2aEMieeoUTbc0kClcFIvwuXlTmCkcwPSwRKcQ o3653Q8pstqtMBElWsc9WEolbDdMiyji+PfrEhoG8M/F89z7lDy6nFzRFsaUULqXZJER R7IA== X-Gm-Message-State: ABuFfojZ3sPhAnGD3EInzmX7Apka5SKNxgOCmlq6x5smutquNeMc1WqO O53fwB3szHq+mH5CD9EixY+FwA== X-Google-Smtp-Source: ACcGV61x/0yx8FpRRR9FKCkm5BnbwLfqGKaWpxST5pq0ao1XJ17Ithcl9BkHix3lW2OsmJO1roPzLg== X-Received: by 2002:a25:9982:: with SMTP id p2-v6mr5267090ybo.315.1537811158297; Mon, 24 Sep 2018 10:45:58 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id z20-v6sm1894775ywz.75.2018.09.24.10.45.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 10:45:57 -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: Make _dpu_plane_get_aspace void Date: Mon, 24 Sep 2018 13:45:55 -0400 Message-Id: <20180924174555.11494-1-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog In-Reply-To: <20180924164729.GE10761@jcrouse-lnx.qualcomm.com> References: <20180924164729.GE10761@jcrouse-lnx.qualcomm.com> 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. The function no longer needs to return anything so it is changed to void. 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. 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;