From patchwork Tue Oct 9 04:27: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: 10631817 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 9747D112B for ; Tue, 9 Oct 2018 04:27:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8976529A28 for ; Tue, 9 Oct 2018 04:27:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D8B529A36; Tue, 9 Oct 2018 04:27:53 +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 2BE8E29A28 for ; Tue, 9 Oct 2018 04:27:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725823AbeJILmu (ORCPT ); Tue, 9 Oct 2018 07:42:50 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58322 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725803AbeJILmu (ORCPT ); Tue, 9 Oct 2018 07:42:50 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7514560C80; Tue, 9 Oct 2018 04:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059271; bh=4H6qIo4AQvjte38QShDc+OoA5Bk0WU9tAvJjW+KDu5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TB8nzH/hCvoF26CttWiEBBXr4YTM1H4EQKka45d+oSN72/IdysrPr0MEdz7ag8Ttl FXMAQCCkZI2rrxUdqvntFRAWRcFZTRRWOpJE6tUA1JpoE2XkXbHEZ/LoPDn5la6W83 DoaubeiU3xQAI3JpzfhnlWNRwjzfY+d51WrO9Vs0= 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 66DCD60C7D; Tue, 9 Oct 2018 04:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539059270; bh=4H6qIo4AQvjte38QShDc+OoA5Bk0WU9tAvJjW+KDu5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gcve0/s+qkgt/kZ0PMgsCLrm8pMf5GDZYt0aLYhKeApgljEMXWgWCJJq3vYt6pOfY gEtD3h1UNr7k5MGwMMkL+yeInorqJ2gamF8Jvx36q1vlBW5hSZnRDE295JY32w6ZqA xUC/RFNHiDu5oIkdmtWAIkh2sR9eRfgzJzjgiTcg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 66DCD60C7D 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 01/25] drm/msm/dpu: fix hw ctl retrieval for mixer muxing Date: Mon, 8 Oct 2018 21:27:18 -0700 Message-Id: <1539059262-8326-2-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 Layer mixer/pingpong block counts and hw ctl block counts will not be same for all the topologies (e.g. layer mixer muxing to single interface) Use the encoder's split_role info to retrieve the respective control path for programming. Signed-off-by: Jeykumar Sankaran --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 96cdf06..d12f896 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -1060,6 +1060,7 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, for (i = 0; i < dpu_enc->num_phys_encs; i++) { struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i]; + int ctl_index; if (phys) { if (!dpu_enc->hw_pp[i]) { @@ -1068,14 +1069,16 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, return; } - if (!hw_ctl[i]) { + ctl_index = phys->split_role == ENC_ROLE_SLAVE ? 1 : 0; + + if (!hw_ctl[ctl_index]) { DPU_ERROR_ENC(dpu_enc, "no ctl block assigned" - "at idx: %d\n", i); + "at idx: %d\n", ctl_index); return; } phys->hw_pp = dpu_enc->hw_pp[i]; - phys->hw_ctl = hw_ctl[i]; + phys->hw_ctl = hw_ctl[ctl_index]; phys->connector = conn->state->connector; if (phys->ops.mode_set)