From patchwork Thu Jul 15 06:52:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 477409 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1409311jao; Wed, 14 Jul 2021 23:53:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD59p8R8TzS3sCbJrX0Dgg5OrRqJ/XTNr/k1gV7u5SOghIDREdDtOQ2PPhT6CaJT2PSyOq X-Received: by 2002:a05:6808:1456:: with SMTP id x22mr2381758oiv.149.1626332002330; Wed, 14 Jul 2021 23:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626332002; cv=none; d=google.com; s=arc-20160816; b=rxM0JWB87vQPDtVLQZEkh20y7TE1XAK4uRBkKkNDWxkTTg9aQWXZzkWet2FUC82Hbe Adm5y9mCKd8FD+mQ3tU1IQnwt/fnn6S2yjmHskOoOiOFuOwxzY87NHUZ9D/TJLOTQz6D /3fg7e7qBqKqIQ7Q3BEEFVJKdTmJhbKPF1QDM0n+xJds29sNBCcgq5d7z/citrLGpi3Y wTLoNlncZARWEIxE4qNDEqS7VrPN0Xq15lHQJontIaZi3cOeE0GaLvhg4t67evWI/vk5 sKb3vY8ELsNSnVJltbqQ9/mG2Dq9VdcdrD/Z6iXrawwfeh9vGSvAILdKuyihTtmzTQ5Z Jnow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qUXJoZK14Orj6dm0msaaNMya3jgk3KRHWu6X847Z6yI=; b=JM4AU7BvOBYYgW/Mn2csdhoJLWx/eE3YjnXRX0wIrSQXcla8A1U3NMWtepXZd581/k UZ/lPkDsx8RwO2WNSayxuCt12wMAn0KaKypnsqCLtA6yt+43q6eTsb6l3Er+PnsElGhT 3LZHV8roOZltd2yU7Pqzg8dz/smue0XBkWz/R+ZKajGF7kfCoEzhoA9mgVANV6Sbmq2D tmtcm/Gu1LJQY5TJTSuw4+YNgfk58/J4CR+KR0VJjuRCjEoCw5cZHj1tb3NPo5SIZtbK EQtHCsACIeA2OLUvqGW2ltGdlhn4t/PQdJWLqAYQWgg+nGdSYTKvtHbyqFL6t6yG9a0C psrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X5gIm5BA; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si6277149otu.27.2021.07.14.23.53.22; Wed, 14 Jul 2021 23:53:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X5gIm5BA; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238694AbhGOG4O (ORCPT + 17 others); Thu, 15 Jul 2021 02:56:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:58660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240072AbhGOG4N (ORCPT ); Thu, 15 Jul 2021 02:56:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F72E6117A; Thu, 15 Jul 2021 06:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626332001; bh=zs8jtugBfxKu+QBaFNWoOagtbR470C8x4uQ4+ADZelg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X5gIm5BAGBRqPJZKINT4BrIpCcGHiQ0OoEkmKWZkG9tOFv200kU3kMAQhq+hHzIz1 t7qK+s1k7G8vWcdCRDdXreGTTkf2pYyQhsQATIJCGGr6Z3PDd3llNSPEv+fprMxLri OSEmPVpJ/7xQInvUUeOaSdeGj4/EE3mWpMuwbKKADFaRwkjbp5z7q7fFaJySFunc2M q+SS4xkuolhOMKI83r1qxC/hpu74cVaTexHMmc8j0oHBuMoEj2AmkVe7UBHLl96z2J /67JL0Nk7KA6jMeAjgahwC/9tQOfLJOjW11anTkerWlglPvwQs6v096EwKmEnIKCN4 pkDPMf9qaM3ag== 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 11/11] drm/msm/dsi: Pass DSC params to drm_panel Date: Thu, 15 Jul 2021 12:22:03 +0530 Message-Id: <20210715065203.709914-12-vkoul@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715065203.709914-1-vkoul@kernel.org> References: <20210715065203.709914-1-vkoul@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When DSC is enabled, we need to pass the DSC parameters to panel driver as well, so add a dsc parameter in panel and set it when DSC is enabled Signed-off-by: Vinod Koul --- drivers/gpu/drm/msm/dsi/dsi_host.c | 16 +++++++++++++++- include/drm/drm_panel.h | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) -- 2.31.1 diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 4e8ab1b1df8b..ee21cda243a7 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -2193,6 +2193,7 @@ int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd; struct platform_device *pdev = msm_host->pdev; struct msm_drm_private *priv; + struct drm_panel *panel; int ret; msm_host->irq = irq_of_parse_and_map(pdev->dev.of_node, 0); @@ -2212,8 +2213,21 @@ int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, } msm_host->dev = dev; + panel = msm_dsi_host_get_panel(&msm_host->base); priv = dev->dev_private; - priv->dsc = msm_host->dsc; + + if (panel && panel->dsc) { + struct msm_display_dsc_config *dsc = priv->dsc; + + if (!dsc) { + dsc = kzalloc(sizeof(*dsc), GFP_KERNEL); + if (!dsc) + return -ENOMEM; + dsc->drm = panel->dsc; + priv->dsc = dsc; + msm_host->dsc = dsc; + } + } ret = cfg_hnd->ops->tx_buf_alloc(msm_host, SZ_4K); if (ret) { diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 33605c3f0eba..27a7808a29f2 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -171,6 +171,13 @@ struct drm_panel { * Panel entry in registry. */ struct list_head list; + + /** + * @dsc: + * + * Panel DSC pps payload to be sent + */ + struct drm_dsc_config *dsc; }; void drm_panel_init(struct drm_panel *panel, struct device *dev,