From patchwork Sun May 1 15:12:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12833682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B12BDC433EF for ; Sun, 1 May 2022 15:12:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F2F310F22C; Sun, 1 May 2022 15:12:25 +0000 (UTC) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by gabe.freedesktop.org (Postfix) with ESMTPS id 132AD10F22C for ; Sun, 1 May 2022 15:12:24 +0000 (UTC) Received: by mail-lf1-x134.google.com with SMTP id x17so21601463lfa.10 for ; Sun, 01 May 2022 08:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XGarRpvctMdxGlcndXm8WtgN3hVc/0JI0oFVA6fZ9m8=; b=RsHhj3VoDc3LIISFBmPUISWBPnxfnKqaLqDLkptb7/ia7ul5svNa1NVf/cMmGbW3td LuSTh8xLcmxUgPLq8MMwnlav0I2d8Wv+h1gc13z7PMZWuBpAxykTdrhDig8y0vqfitPv uMzGSaBsG6SkL2QHNwM09XPg/1lYIhX+w3Esssch+velHOTjAeI8+J/ACVXrGmMERmec 5JlM/U0lMk1LevuwIdqGIMHXA3F7E9FvlUvD/xY8fcE/cLbmvrVjB8KwKT6woBAXRSOr bhhwJIjR/08U3OcJI6Rm7vLzrd6LJRBt4hx8jPgK6FM/IMCNpsxVeSZUwDuq9xBLUrBA wBdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XGarRpvctMdxGlcndXm8WtgN3hVc/0JI0oFVA6fZ9m8=; b=LI6CT48VxsjhbwYummdEDfdpDaV2ZOzAfa0NvKbqq6POsPrP+Ax7Ezo9jcVrHG4bHv mGaqMfB0+VAB4bVifH1Fkt4BNBa8UXY9aC0GvrPxvP6a9KF2nsvL2WoVa+nAYOgq4qaI 9jbT64jxTLUzN9sljuJ1tp10LjaZjncBRMLrhOopkFFMMpn01lNP7DxrOmMAI8JAzZlq TV/iOOOQ/5q9AohmSl+huRkTTcDdUzrJKwwgCh6BlGU83a36pKs4eCajQvJm4tUOXElj qvCJ9L+ztBAKAdY9tpE2DNz1sX4gSHJWoKgb8gR26FCeJwPk1VSS1DE2lypOebs15/91 eGWQ== X-Gm-Message-State: AOAM5324HBB6GqqIKKKEszr9aZbMFlSTq5wt4iM0w0y31sf1KyrMTjqR 9au31eOoU0JuYmQ6Tcx2ctlz0Q== X-Google-Smtp-Source: ABdhPJzF3yd5sTdv0tEELeBUYEWDcbSrKXbhUZWTy0NT5w5e1JZRH9LQky4B6RnAS+09nIdjm7e/IQ== X-Received: by 2002:a05:6512:a83:b0:472:1817:145b with SMTP id m3-20020a0565120a8300b004721817145bmr6554902lfu.437.1651417942371; Sun, 01 May 2022 08:12:22 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id l16-20020ac25550000000b0047255d210dbsm461975lfk.10.2022.05.01.08.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 May 2022 08:12:22 -0700 (PDT) From: Dmitry Baryshkov To: Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH 1/3] drm/mipi-dsi: pass DSC data through the struct mipi_dsi_device Date: Sun, 1 May 2022 18:12:18 +0300 Message-Id: <20220501151220.3999164-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220501151220.3999164-1-dmitry.baryshkov@linaro.org> References: <20220501151220.3999164-1-dmitry.baryshkov@linaro.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: Vinod Koul , linux-arm-msm@vger.kernel.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The commit 0f40ba48de3b ("drm/msm/dsi: Pass DSC params to drm_panel") added a pointer to the DSC data to the struct drm_panel. However DSC support is not limited to the DSI panels. MIPI DSI bridges can also consume DSC command streams. Thus add struct drm_dsc_config pointer to the struct mipi_dsi_device. Signed-off-by: Dmitry Baryshkov --- include/drm/drm_mipi_dsi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 147e51b6d241..8b1c9be9b2a7 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -177,6 +177,7 @@ struct mipi_dsi_device_info { * @lp_rate: maximum lane frequency for low power mode in hertz, this should * be set to the real limits of the hardware, zero is only accepted for * legacy drivers + * @dsc: panel/bridge DSC pps payload to be sent */ struct mipi_dsi_device { struct mipi_dsi_host *host; @@ -189,6 +190,7 @@ struct mipi_dsi_device { unsigned long mode_flags; unsigned long hs_rate; unsigned long lp_rate; + struct drm_dsc_config *dsc; }; #define MIPI_DSI_MODULE_PREFIX "mipi-dsi:" From patchwork Sun May 1 15:12:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12833683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE8CDC433EF for ; Sun, 1 May 2022 15:12:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FE9210F23B; Sun, 1 May 2022 15:12:26 +0000 (UTC) Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 184DD10F239 for ; Sun, 1 May 2022 15:12:25 +0000 (UTC) Received: by mail-lj1-x22f.google.com with SMTP id c15so15832947ljr.9 for ; Sun, 01 May 2022 08:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ce4A8wMAvBJZnLY4Vg9L/lhIMXxs87k9mqHw26OfST8=; b=gjHGYTcvqx4d6Bv0cZY2fCzUjQWr4EPLQV7QknyllrvEV/EpvaI2hyEOySVyyutGww 8BjCmyFZEI8GHnxU5AiJ9OkiUqtWJmNBeXoEmBfbffWjPhkUL18y5whPY9PMG6Hd+4Hb mEFHGb6ISo+XrEvj9CrryfK2Y9aHE34kTRBZrhf81a/K740/QZrLlCTZ11wMvH0DWOq8 LNIiAjqXw/PM7JG3pss4txr1I3kkHTbInnp7yUxRxS6VXwBhdS0th8nV4AJtsrq2Kd+i UMienQEv09yytTSIQorxzSnUpPRxxYnWnrL9OIsqi9azzC/9RyVamuSWFlwLxwA4PvJn 3Caw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ce4A8wMAvBJZnLY4Vg9L/lhIMXxs87k9mqHw26OfST8=; b=gzeJBOQNVFWFefNwlEqkscrlmduKyTK9qhPsqdPG0lzXtYxzJbmDxh6LaO526v67q4 YGphMWa9TcZo9AbRmh7D8kGmA3FL2HPNMzKaE67Wmk9eQC2k5lJqSqpKlzFNzIatD1Wp xrS876EWdN/eEDt6og9aaXoeGCKSQ5GHALv6gfHNCu+z+TWGlcUc91YVi2qnULBAHHsn MINq+3RTKNEoF708ndwQtk90zGUkRmLUIvGiD016wOix9XWH1TV8XrtjLeUiKZByqcRm 6gOQguVLatQifA/Y8+JWN/M0x66yGcembFnQntCfKRGWMpMn7uta2If+EdR+1ZL4X+XD DKYQ== X-Gm-Message-State: AOAM533unujhrTX42lfwCPv4fm0IC4NQ1AwNWrsdbvZeh+4jnKB7GpOz PgYnR68JCeDWTN+/GibFjPuA4Q== X-Google-Smtp-Source: ABdhPJxYLBWRih7LcolP7XgihrHaq5BfPrrpzEQadwR5izXUNeUDfSjYqK/SKWFWz89qUTtf0OEgiA== X-Received: by 2002:a2e:5407:0:b0:24f:64c:980c with SMTP id i7-20020a2e5407000000b0024f064c980cmr5783370ljb.163.1651417943463; Sun, 01 May 2022 08:12:23 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id l16-20020ac25550000000b0047255d210dbsm461975lfk.10.2022.05.01.08.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 May 2022 08:12:23 -0700 (PDT) From: Dmitry Baryshkov To: Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH 2/3] drm/msm/dsi: fetch DSC pps payload from struct mipi_dsi_device Date: Sun, 1 May 2022 18:12:19 +0300 Message-Id: <20220501151220.3999164-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220501151220.3999164-1-dmitry.baryshkov@linaro.org> References: <20220501151220.3999164-1-dmitry.baryshkov@linaro.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: Vinod Koul , linux-arm-msm@vger.kernel.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that struct mipi_dsi_device provides DSC data, fetch it from the mentioned struct rather than from the struct drm_panel itself. This would allow supporting MIPI DSI bridges handling DSC on their input side. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi_host.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index a95d5df52653..173df1fd3692 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1690,6 +1690,17 @@ static int dsi_host_attach(struct mipi_dsi_host *host, msm_host->lanes = dsi->lanes; msm_host->format = dsi->format; msm_host->mode_flags = dsi->mode_flags; + if (dsi->dsc) { + struct msm_display_dsc_config *dsc = msm_host->dsc; + + if (!dsc) { + dsc = devm_kzalloc(&msm_host->pdev->dev, sizeof(*dsc), GFP_KERNEL); + if (!dsc) + return -ENOMEM; + dsc->drm = dsi->dsc; + msm_host->dsc = dsc; + } + } /* Some gpios defined in panel DT need to be controlled by host */ ret = dsi_host_init_panel_gpios(msm_host, &dsi->dev); @@ -2164,23 +2175,9 @@ int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, { struct msm_dsi_host *msm_host = to_msm_dsi_host(host); const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd; - struct drm_panel *panel; int ret; msm_host->dev = dev; - panel = msm_dsi_host_get_panel(&msm_host->base); - - if (!IS_ERR(panel) && panel->dsc) { - struct msm_display_dsc_config *dsc = msm_host->dsc; - - if (!dsc) { - dsc = devm_kzalloc(&msm_host->pdev->dev, sizeof(*dsc), GFP_KERNEL); - if (!dsc) - return -ENOMEM; - dsc->drm = panel->dsc; - msm_host->dsc = dsc; - } - } ret = cfg_hnd->ops->tx_buf_alloc(msm_host, SZ_4K); if (ret) { From patchwork Sun May 1 15:12:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12833684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 436FFC433EF for ; Sun, 1 May 2022 15:12:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF14510F246; Sun, 1 May 2022 15:12:27 +0000 (UTC) Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id B57F310F23B for ; Sun, 1 May 2022 15:12:25 +0000 (UTC) Received: by mail-lj1-x230.google.com with SMTP id l19so15843087ljb.7 for ; Sun, 01 May 2022 08:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QgI1RLE4QjZBMdfYSm+1pfZAQh9ERx+LC2dX8V73DIk=; b=Sk5V9+hcGZ2vhjdPvbMVdA2+0QSRX1JUp4+W00RgJTYiFeJzairgk6e+bRMqd5TTpx t7dupZa/pDOL2bo2/Rh1F5D1OwYXlchvU/px8KGfuosWGXERh744o3ETZ3ktbDOhELR3 6lqzQiKrlgx7U4+eysp3o/9fRYtUEv6G9j53fgiappsQgPdPIsevbIha1gX+BLGaULt6 Uv1vqxxRJp38wJjIY2NyrgF/AiP/IlQUlsEA87onHuioBp+JczYNU0k7e/8Dbu4jq6ZR 7pVejmb0NAH7cmk1DX/iV9AQw2UoabyeBQGLQv3Kbf39BJFMe+Ea6aa31Ve+/gY4K4gn xPbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QgI1RLE4QjZBMdfYSm+1pfZAQh9ERx+LC2dX8V73DIk=; b=ImntVCpFGmym0IKb7Og93ui7lOsBf/NCDARi/0MN0nJmz3od8g1dNcYCMRzBMu7KfO D58eH/22lQxvXvjItpH7EH6/svB1Adl30bcaFeHsRjadYivjOPjTvW8P2PBpICE4JIhR Y18v8cbc3q478dTe5Wizet/Wb5llrArKCcAPlYog/vjE6E6KpnBRsleJUpSOiDEwUAg0 HC3BglsDHaCQNCQZI0l7AC1AtDTPnDMEV5zejUeR1pdZfclsucvJ+AwKYZ0ZMDVGUESX jM3aqu4X5nUkzYHHMxzaWZwqJube2OCIhuUGwMcpuuz0OsmuS7Lp+ci6Bkle0AqTCnQk 8udA== X-Gm-Message-State: AOAM532fitQ2/z5sIrYntzK8DaFIPuDFq96qyq32QgFMhQfiKqHhbNpx YXzogW9M2WwZF32EiAFcN+mw+g== X-Google-Smtp-Source: ABdhPJyc3fJfnPgQHWznkOtDdnF03pldZtT/k0xHZMBcfFyaS2gkFMw+G1J2k5EXTxVwhD08Qnwz4Q== X-Received: by 2002:a05:651c:54a:b0:250:5b67:b7b6 with SMTP id q10-20020a05651c054a00b002505b67b7b6mr565451ljp.305.1651417944069; Sun, 01 May 2022 08:12:24 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id l16-20020ac25550000000b0047255d210dbsm461975lfk.10.2022.05.01.08.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 May 2022 08:12:23 -0700 (PDT) From: Dmitry Baryshkov To: Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH 3/3] drm/panel: drop DSC pps pointer Date: Sun, 1 May 2022 18:12:20 +0300 Message-Id: <20220501151220.3999164-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220501151220.3999164-1-dmitry.baryshkov@linaro.org> References: <20220501151220.3999164-1-dmitry.baryshkov@linaro.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: Vinod Koul , linux-arm-msm@vger.kernel.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Complete the move of DSC data pointer from struct drm_panel to struct mipi_dsi_device. Signed-off-by: Dmitry Baryshkov --- include/drm/drm_panel.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index d279ee455f01..1ba2d424a53f 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -179,13 +179,6 @@ 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,