From patchwork Thu Feb 10 10:34:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 541421 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp2113381imo; Thu, 10 Feb 2022 02:35:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJygSug6DDw/JC6MFYbP5uKo6TX4vLSg7yuvzP2DEQ9DdFUDwFOrClp/0phKNGYF6/nk1Ou6 X-Received: by 2002:a17:90a:4b8b:: with SMTP id i11mr2093250pjh.148.1644489302815; Thu, 10 Feb 2022 02:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644489302; cv=none; d=google.com; s=arc-20160816; b=k8dJpDaOOXJCPz2TKROM35w5bj/UysuJOftU73EVCUUdV0sgILyM2EKj4MNaYiWYtf 1ADFoZ6zJ0arBqhxl9/DuIOASPXM3YRc2IdrV3Ctdon+VsGygv8n8zKvB6yJDS4mxtpD OoZbZ0v0RMtUw0v1hADib/3DOaZ3YcKzv9FDNGVDgugW3bme7M3C03YWuow8SwUmHwl9 HWrECFtwRFb0ZPbQ/U9+8bCBOZCbRceKVzPZCcKbs+QUXT3J3eAf1LtG9MmwvaIyFlBW wQ1gvl12PT/uFtSHLT3RFizm6NNMa9IkBCtza9YQtXP+E2dOy9Z6VckapWgFVq0YwePG d+Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=n2EydMC8liy11jJ/zyENCosa6BI6c04SXz3ocy7u1IM=; b=0mIcvtLYfr2m2lkZ+wNI+kKL/Nv0g7u+SoBSApaMTWtgI/xhQDxgxAp1qqE7fMcdKZ mIxlQIUcN22VJNUchstyQRuAlkkHPQpk7Q8V025MPHzlY0pLV3k9UsCljesQ3ckQvWQ/ 3DHrZUkGALzJOlxFI8issGtt+vunPdFWc+jClAkWNwfvX1i5K0HPUzK/fBk/7k9btZKG dtEoI+B9NxZXn4D4gCqJWUFDthhUK6mY63Ft19t+lcAiuj22oVTN7mMZWY9Sx4wZ9XP7 5iitoTlX8Y0BN30hg9bMg8PHd4uBpaWKchIRO4MtcXKGUSEe3aQmBGtT5uTXeoW87xNy DIrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=gHRGD9b9; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id v191si18104967pgd.816.2022.02.10.02.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 02:35:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=gHRGD9b9; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1EB6F10E7D6; Thu, 10 Feb 2022 10:35:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32C9010E7D6; Thu, 10 Feb 2022 10:34:59 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AC80B61B96; Thu, 10 Feb 2022 10:34:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 051D8C004E1; Thu, 10 Feb 2022 10:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644489298; bh=s77zX8tlQZGtLkt3yoLZJ4/EQEAGs6BTpnX/BQtdbYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gHRGD9b92gcyrUm5uzA4/hTcbQZonWdYW3ITgsSZv/o7g5RSJMCHTYocCGoDJbQKV 95oGsjC2j26rYBfW9cF0Ii8CbfHwApE7/ia+s7qb1tA2vWdDjI07S5zow4vQ16h0Ey 8ho2lfovcwNdiFDd7T2YIU9mgJc7nkAG6gLMQMDetlMYzY8njKFNjEehNnwD3W4f5T cNqPZDX1gAUy4+M1ooWzOTxos3r4mi/LHAKLG8hYVxL2OnNvGcXCSuatxZOP1VBtYK IP0WdVlizy6woYoQZR/9KZxHgsNkPDczsmCwi49aPlnukUIMiwws5bOgQzNJWqx7qj uVXKZa/vjC20A== From: Vinod Koul To: Rob Clark Subject: [REPOST PATCH v4 06/13] drm/msm/disp/dpu1: Add DSC support in hw_ctl Date: Thu, 10 Feb 2022 16:04:16 +0530 Message-Id: <20220210103423.271016-7-vkoul@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220210103423.271016-1-vkoul@kernel.org> References: <20220210103423.271016-1-vkoul@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonathan Marek , David Airlie , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Abhinav Kumar , Bjorn Andersson , Vinod Koul , dri-devel@lists.freedesktop.org, Dmitry Baryshkov , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Later gens of hardware have DSC bits moved to hw_ctl, so configure these bits so that DSC would work there as well Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 11 ++++++++++- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 02da9ecf71f1..49659165cea8 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c @@ -25,6 +25,8 @@ #define CTL_MERGE_3D_ACTIVE 0x0E4 #define CTL_INTF_ACTIVE 0x0F4 #define CTL_MERGE_3D_FLUSH 0x100 +#define CTL_DSC_ACTIVE 0x0E8 +#define CTL_DSC_FLUSH 0x104 #define CTL_INTF_FLUSH 0x110 #define CTL_INTF_MASTER 0x134 #define CTL_FETCH_PIPE_ACTIVE 0x0FC @@ -34,6 +36,7 @@ #define DPU_REG_RESET_TIMEOUT_US 2000 #define MERGE_3D_IDX 23 +#define DSC_IDX 22 #define INTF_IDX 31 #define CTL_INVALID_BIT 0xffff #define CTL_DEFAULT_GROUP_ID 0xf @@ -121,7 +124,6 @@ static u32 dpu_hw_ctl_get_pending_flush(struct dpu_hw_ctl *ctx) static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) { - if (ctx->pending_flush_mask & BIT(MERGE_3D_IDX)) DPU_REG_WRITE(&ctx->hw, CTL_MERGE_3D_FLUSH, ctx->pending_merge_3d_flush_mask); @@ -506,6 +508,9 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, if ((test_bit(DPU_CTL_VM_CFG, &ctx->caps->features))) mode_sel = CTL_DEFAULT_GROUP_ID << 28; + if (cfg->dsc) + DPU_REG_WRITE(&ctx->hw, CTL_DSC_FLUSH, cfg->dsc); + if (cfg->intf_mode_sel == DPU_CTL_MODE_SEL_CMD) mode_sel |= BIT(17); @@ -517,6 +522,10 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, 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(&ctx->hw, CTL_FLUSH, cfg->dsc); + DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc); + } } static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h index 806c171e5df2..9847c9c46d6f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h @@ -40,6 +40,7 @@ struct dpu_hw_stage_cfg { * @merge_3d: 3d merge block used * @intf_mode_sel: Interface mode, cmd / vid * @stream_sel: Stream selection for multi-stream interfaces + * @dsc: DSC BIT masks */ struct dpu_hw_intf_cfg { enum dpu_intf intf; @@ -47,6 +48,7 @@ struct dpu_hw_intf_cfg { enum dpu_merge_3d merge_3d; enum dpu_ctl_mode_sel intf_mode_sel; int stream_sel; + unsigned int dsc; }; /**