Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp301347lqb; Tue, 16 Apr 2024 16:59:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfvFwl+Y4OlpUrqC9BiGhxh0wZS3VC9TxrHUJ/Z37/178n4/7EmPHH/9zijbNVzIWzZXEuXxn0S8YnIEDExEPB3j97HAAMrRUGMYu+IQ== X-Google-Smtp-Source: AGHT+IETf7t33fahkwPs/s3wdi0v5VGQ8kWqd/6WS0cnfkFP8C1RWvWq7Q/uCFalZSNGub7EQog2 X-Received: by 2002:a05:6a20:7687:b0:1a9:8d1f:df84 with SMTP id k7-20020a056a20768700b001a98d1fdf84mr14165324pzf.57.1713311997553; Tue, 16 Apr 2024 16:59:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713311997; cv=pass; d=google.com; s=arc-20160816; b=k/PcjAWsYM4KkN3Q/p2oHZQy43P2PqPUtikT3U6UGHARwhr8Flnt3yR4/BlI+QYBpJ 6ErfG1Wfzc8YEpwENnKSb0RUrlXGiVXFF0T2wEFQOBgNyfQvF//xTUyxJLj75SDI3JSi FUSjuSfZvmVB8hT33sa4QV3jbMhue9IUYNO22UKLEz4EDnSzf2+nvbrJ3ngzROPCVsEn TJDlxkVsBPYcC4XY/zneNZWdOcJj+P+6v70NHyt9yq6jmjPrLVLm9bYD+pcz/2f5HSYn Xyl1s3DbfuqKWFdxQ4gAb2IwQn5K3I9xOowsayIjo/0gbWI6ALmWUPAhgLmUhJI4b3gZ un4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=k1OTLyq2WYl4ILCPAPfy3dAIs4ksuXj5e2sjbkNTN5E=; fh=EaVNV8gKHS73tSa0PfwfCJhAdPfizlMjT2zacFzFq/Y=; b=WnYJrwbwTDYBpSfnRBSoODYJ6lfX2YLn9IQP3X92alzhKg+VWuY+nkNVp6pTER7/2g XQfeu2dy9OJAJiv0D5GTLUFn1rNg1RTHtFV8vqWlwvWOl3mX1VNh2IcstAFrY3aafkjo nOVzGoCFM+/SBBq1E5Ck0BhxOpk8n/pSuvNzlD4IQEB/dTg5EpQ4S/ESKUQt9XqbNIPE X1+WfFQm8hrg9DCvX79/YaC2DzJs1krIYMfQUS58q/HU4ak8c1P0yTOiFNNB9oe/du2l 7z/fVq7EwERGkuH6bZAV4OxaIhHkEWVeWy9+b2RM1FUWrXMWoqMjBrm6HdBvCjAh+xI3 440g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147773-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q26-20020aa7983a000000b006ecfc9f0c78si10498822pfl.267.2024.04.16.16.59.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 16:59:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147773-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147773-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B1D63B23563 for ; Tue, 16 Apr 2024 23:58:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 958B013C3C9; Tue, 16 Apr 2024 23:57:52 +0000 (UTC) Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [5.144.164.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 919AB13AD1A for ; Tue, 16 Apr 2024 23:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713311872; cv=none; b=Sas48q0j/QzYP1G0q0Qjo/lmUNJWMG8EtkBl8w/gScvPt0ebfVZKOTQlfxdO1mxQa0Et3AvRqObe9NH/JKuWnSw7pYAaGqszkM53Ccob3X3atkaJhsxTL4bpdM01oruw2m1zq58BTtjC5+QePntB01qsRbPRk7cBv3bO2frddYM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713311872; c=relaxed/simple; bh=m47iN2Qx4QgStq50FEm3/gYACYUiHtmJPCULeaPgmv0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p413CFUhiBehsChJVRF48qJNBXt6NHQOlKao/7cHKVMjvX3jp62E6OiwHR4VcR8Jg99N4y/UyWllZ+NwPhB48y77WDx343xi+/YT+qKe0wW66T04U3UvixGd/Lq3fVBspwXjCcf7qN7cp3NiQ/JmLHUd6w9Lxuwdqzk8sTT89FU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.localdomain (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id D756A3F01F; Wed, 17 Apr 2024 01:57:47 +0200 (CEST) From: Marijn Suijten Date: Wed, 17 Apr 2024 01:57:44 +0200 Subject: [PATCH 4/7] drm/msm/dpu: Allow configuring multiple active DSC blocks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-4-78ae3ee9a697@somainline.org> References: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> In-Reply-To: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Archit Taneja , Chandan Uddaraju , Vinod Koul , Sravanthi Kollukuduru Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jordan Crouse , Rajesh Yadav , Jeykumar Sankaran , ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten X-Mailer: b4 0.13.0 Just like the active interface and writeback block in ctl_intf_cfg_v1(), and later the rest of the blocks in followup active-CTL fixes or reworks, multiple calls to this function should enable additional DSC blocks instead of overwriting the blocks that are enabled. This pattern is observed in an active-CTL scenario since DPU 5.0.0 where for example bonded-DSI uses a single CTL to drive multiple INTFs, and each encoder calls this function individually with the INTF (hence the pre-existing update instead of overwrite of this bitmask) and DSC blocks it wishes to be enabled, and expects them to be OR'd into the bitmask. The reverse already exists in reset_intf_cfg_v1() where only specified DSC blocks are removed out of the CTL_DSC_ACTIVE bitmask (same for all other blocks and ACTIVE bitmasks), leaving the rest enabled. Fixes: 77f6da90487c ("drm/msm/disp/dpu1: Add DSC support in hw_ctl") Signed-off-by: Marijn Suijten --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c index a06f69d0b257..2e50049f2f85 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c @@ -545,6 +545,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, { struct dpu_hw_blk_reg_map *c = &ctx->hw; u32 intf_active = 0; + u32 dsc_active = 0; u32 wb_active = 0; u32 mode_sel = 0; @@ -560,6 +561,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, intf_active = DPU_REG_READ(c, CTL_INTF_ACTIVE); wb_active = DPU_REG_READ(c, CTL_WB_ACTIVE); + dsc_active = DPU_REG_READ(c, CTL_DSC_ACTIVE); if (cfg->intf) intf_active |= BIT(cfg->intf - INTF_0); @@ -567,17 +569,18 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, if (cfg->wb) wb_active |= BIT(cfg->wb - WB_0); + if (cfg->dsc) + dsc_active |= cfg->dsc; + DPU_REG_WRITE(c, CTL_TOP, mode_sel); DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active); DPU_REG_WRITE(c, CTL_WB_ACTIVE, wb_active); + DPU_REG_WRITE(c, CTL_DSC_ACTIVE, dsc_active); if (cfg->merge_3d) DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE, BIT(cfg->merge_3d - MERGE_3D_0)); - if (cfg->dsc) - DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc); - if (cfg->cdm) DPU_REG_WRITE(c, CTL_CDM_ACTIVE, cfg->cdm); } -- 2.44.0