From patchwork Tue Nov 16 06:22:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 519180 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp6710472imj; Mon, 15 Nov 2021 22:23:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlRxBg2LgvcEqGVH5Zh41JYKZqFxihRm0PPIcynHty5r3/ALcn7zKmsFZUV29P1eHirvvq X-Received: by 2002:a17:90b:2412:: with SMTP id nr18mr73631666pjb.233.1637043822127; Mon, 15 Nov 2021 22:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637043822; cv=none; d=google.com; s=arc-20160816; b=R0UdL7v4x9RJnn7qz6ZVXoq+3IPUpzb2LVDBP4IbjK4/0s/Z+3n1wUK+/HduqCsUeo lit+RHjxYxHYh+lUP+vG4f3oJimplNcVdBmHc53Q+uoeEYHZH+0fzSUABHRyXVDkPNUT gQiP85j+LXI9zgPtvVisYBRRlHYLXiBwzfsDGppoI5uCpE/OZo1vav/6jv8D4+zRJlsc E7d+3wLpGoPHsVz7iBSLTJwQvnIaYPz6cjg01xYxwZ0cAWelwJ1eBa9uQDSjV/oy5xAU 2qA99ICiFLOjW+4uay3Iep2y7kvZtTzUzcq2mI0a9yc2/DvWGyYSrMeARoYKJJUTYLha SaoA== 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=a+MucjxfiKvIFsGH+UppVMnftuvYvMNtTJIIycfEo1o=; b=hVthWkLh1t3h3JHSjwacmlbfizvZD/3FecQYXeZp+yi78lgE+jRA6SRR4ud6fbFMq5 cRkzCLCRhdTnqRFQvYIOPOiyEqhS/MGc2TQl9MAHxcA7y4d3f9hnbthXoshDJ9aP7ywd +smzMIy8/hbCkq1hv2mIer4HzdvXquuY65DjalpL+V0po5ce10kvt+s06v9Sm+1Pb8CI WSvmTFSD8dfEoLhjHu4blsujuhGsLFlBca5OpFtZ9z5506qi5+SywFCe26hwvxZ06AHl zD50u8AwOSJIC9qrq/S6y6EAtpUasbWI1u23dRarPVDKUuYXn7dpoZb2ljMfBAyQx4Vy PcNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=cOuRuvZt; 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 k13si23674392pll.38.2021.11.15.22.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 22:23:42 -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=cOuRuvZt; 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 562076EA1B; Tue, 16 Nov 2021 06:23:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id B0B0C6EA1B; Tue, 16 Nov 2021 06:23:38 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 1D0F061C14; Tue, 16 Nov 2021 06:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637043818; bh=8Tn4eiu65chTlV9GpBsJxq5woJ47j+59RWB1tmI83cE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cOuRuvZtjfsE0It8VEGTpy3Wwp6qZBnwj4yG/IeJsbM0EEIPQcW5h3M92ijROHTIT hkSmay/9hCXFPuSj9KrJlsiFo7Z7JQUP6bkd5OYLlOxohDbtsqm7PHV4CkUBMGWf/5 b8ctW/gxleUF0bA5UtTGHq+KkbPioHP/NKfXCSx+2HGXb+jVGNOn2WrOdOLwDtJlsF sWb/X35t2wYSOoVuJeGiHRDyY4sA6vuzgcLqBW9b09zGn98t9K9Er3od3ifYlqeLlD 8JPkC9EU1isS8S+7BN4buOsm1pI/TGmogMoLQ3uJOYFRlAymoLG+IDYIbbdKmMhaj6 C7nH1JOJbzT+A== From: Vinod Koul To: Rob Clark Subject: [PATCH v3 05/13] drm/msm/disp/dpu1: Don't use DSC with mode_3d Date: Tue, 16 Nov 2021 11:52:48 +0530 Message-Id: <20211116062256.2417186-6-vkoul@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211116062256.2417186-1-vkoul@kernel.org> References: <20211116062256.2417186-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 , Jeffrey Hugo , 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" We cannot enable mode_3d when we are using the DSC. So pass configuration to detect DSC is enabled and not enable mode_3d when we are using DSC We add a helper dpu_encoder_helper_get_dsc() to detect dsc enabled and pass this to .setup_intf_cfg() Signed-off-by: Vinod Koul --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 11 +++++++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 2 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 3 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h index e7270eb6b84b..efb85d595598 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -332,6 +332,17 @@ static inline enum dpu_3d_blend_mode dpu_encoder_helper_get_3d_blend_mode( return BLEND_3D_NONE; } +static inline bool dpu_encoder_helper_get_dsc(struct dpu_encoder_phys *phys_enc) +{ + struct drm_encoder *drm_enc = phys_enc->parent; + struct msm_drm_private *priv = drm_enc->dev->dev_private; + + if (priv->dsc) + return priv->dsc->dsc_mask; + + return 0; +} + /** * dpu_encoder_helper_split_config - split display configuration helper function * This helper function may be used by physical encoders to configure diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index 34a6940d12c5..f3f00f4d0193 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -70,6 +70,8 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg( intf_cfg.intf_mode_sel = DPU_CTL_MODE_SEL_CMD; intf_cfg.stream_sel = cmd_enc->stream_sel; intf_cfg.mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc); + intf_cfg.dsc = dpu_encoder_helper_get_dsc(phys_enc); + ctl->ops.setup_intf_cfg(ctl, &intf_cfg); } 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 64740ddb983e..36831457a91b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c @@ -519,7 +519,8 @@ static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, intf_cfg |= (cfg->intf & 0xF) << 4; - if (cfg->mode_3d) { + /* In DSC we can't set merge, so check for dsc too */ + if (cfg->mode_3d && !cfg->dsc) { intf_cfg |= BIT(19); intf_cfg |= (cfg->mode_3d - 0x1) << 20; } 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; }; /**