From patchwork Thu Oct 7 07:08:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 515444 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp1022507ime; Thu, 7 Oct 2021 00:09:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyrncqgomHN5fJIb2OVUigiUOaQXEgu9jLF2n/OalrMhyNlRu2RFmnGSUYOuHya7sKAxYQ X-Received: by 2002:a17:902:e807:b0:13f:2e2:6951 with SMTP id u7-20020a170902e80700b0013f02e26951mr2209268plg.17.1633590586164; Thu, 07 Oct 2021 00:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633590586; cv=none; d=google.com; s=arc-20160816; b=TI3I5ak06WT9AY0mLbXmrM09k3611XVcxedCOB9TAjyIXKhrXfaMT3N6EKGkaMf6Qv ekof4Pqr8obFhKGxbR1vo6OY+iqemxIfMGfNEVAnHnvLyQVbYxUTjqd2U2frm1NSp5i6 iQzkZi6NXIaqe6gf6eA+4RbFTQJW6FWTS/2a9Nvhkn/xbOuMXAwwMikoY8SvKRerzPhw mcCvM3af9IQG4tVGwBzhVDEwHWcvM+EjAE8k6wwcUeWkLqd/K2tPebXM6FGFZEq1JIyk gY/rC5fpe9LwGqXCdZt28T6NCKppsIrA+Cv/CsnzaXorVpO4W9NlVa/x+NwAFS655RpZ a72Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature:delivered-to; bh=92cfpX7mbRRfOybYm2TvbTjdWcOPJqbSJlGfU2o/KKg=; b=mEM6cDzyuCqK2jOTbh2KuB1TxWqIc5CxPy0csD+cdsuHS9IC2mz7hPyKMnCDytRErI rceMoBxpus1AcATs3Y8P9vo3y4i5Ad7+b/AwRsD1i3Q6cCpnpxusukPRe0lFtLZZIYQu AMOXb3sc0jVASen4g7Jz0yhbsBMXJJf8kIhu6tQIs3MLFwif+6MFs4zOpATQeZYLZXOj 4+rxjdECVfbDKcKCr5guiRicwoWaFiK2z/Ff/n6KnBuNUWeHta1r7TeMXg4vlXB1oaMX C0l6Uf/WuL+FM0JFU/KdooqhZkXdl8KbHaD13mVvRRgZAUbaOzXQj1bKfQLInVHFvZ86 g35w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CmyceIfL; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id v7si7126840pjr.31.2021.10.07.00.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 00:09:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CmyceIfL; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (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 8F10F6F39C; Thu, 7 Oct 2021 07:09:44 +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 60F736F39C; Thu, 7 Oct 2021 07:09:43 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C635C611C1; Thu, 7 Oct 2021 07:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633590583; bh=ZO1mV6qw42E5CbS0YTo1KW2wwXIfr7yw1zLonzcFGpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CmyceIfLLWamkaAyresgbbqW3upAmmMA0G5XlVz2Pi7ee8POhfsOQAfjCZ6dh3NCq VnZ9hU7rQ4pAReKCX+IT8gkuHyPzvbE8L6hySMsxZdlM5qpvpTOroWjOpITZmDuZYV oKp3ukeuzLo1XgcLXpYQJwOuz8+B83NKAL9q902i359rKacjVVct3JCNkJUhXSrS7N nKHubgrx3WE0nvL+1kqoYVQznDIQTthE9Y78G6hnkOemXo9bqdjq/fJOLFkVXB+qb3 xS23a+rdCrZ22CdU9d1vbGUTYznb568Ez3NAo/P9dJdhVgC87hOHC4igSFFRLssOrq 07QucadIfRkNg== From: Vinod Koul To: Rob Clark Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Vinod Koul , David Airlie , Daniel Vetter , Jonathan Marek , Dmitry Baryshkov , Abhinav Kumar , Jeffrey Hugo , Sumit Semwal , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 06/11] drm/msm/disp/dpu1: Don't use DSC with mode_3d Date: Thu, 7 Oct 2021 12:38:55 +0530 Message-Id: <20211007070900.456044-7-vkoul@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211007070900.456044-1-vkoul@kernel.org> References: <20211007070900.456044-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: , 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_mode() to detect dsc enabled and pass this to .setup_intf_cfg() Signed-off-by: Vinod Koul --- Changes since v1: - Move this patch from 7 to 6 - Update the changelog - Make dsc as int and store the DSC indices 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 | 5 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) -- 2.31.1 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..fca07ed03317 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_mode(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 BIT(0) | BIT(1); /* Hardcoding for 2 DSC topology */ + + 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 aa01698d6b25..8e5c0911734c 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_mode(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..3c79bd9c2fe5 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c @@ -118,7 +118,7 @@ static u32 dpu_hw_ctl_get_pending_flush(struct dpu_hw_ctl *ctx) return ctx->pending_flush_mask; } -static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) +static void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx) { if (ctx->pending_flush_mask & BIT(MERGE_3D_IDX)) @@ -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..5dfac5994bd4 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h @@ -39,6 +39,7 @@ struct dpu_hw_stage_cfg { * @mode_3d: 3d mux configuration * @merge_3d: 3d merge block used * @intf_mode_sel: Interface mode, cmd / vid + * @dsc: DSC BIT masks * @stream_sel: Stream selection for multi-stream interfaces */ struct dpu_hw_intf_cfg { @@ -46,6 +47,7 @@ struct dpu_hw_intf_cfg { enum dpu_3d_blend_mode mode_3d; enum dpu_merge_3d merge_3d; enum dpu_ctl_mode_sel intf_mode_sel; + unsigned int dsc; int stream_sel; };