From patchwork Thu Jul 15 06:52:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 477407 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1409156jao; Wed, 14 Jul 2021 23:53:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx75eYI9XWq3uTnJvbOxh4IijYPVrjczL+qs9JnRGac9aBaQAHsvi0q1uwRT4KWx1+FKtIl X-Received: by 2002:a05:6830:1f1b:: with SMTP id u27mr2330336otg.354.1626331993031; Wed, 14 Jul 2021 23:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626331993; cv=none; d=google.com; s=arc-20160816; b=OmitTM/ri80MMDT34F7ATQ3uJ2yUz+3b0Mx/wtWuiY7VM3LlFCcwtULlBDkIYMqOUE V7QpN6BLe9deUcdvNy126SpV0YLSpAlkL48p3QaqwMFMw+S0Ce83fFfkKrd/msCZ3M5t h1iA60xu0XmlTp9CeLDppx/h4q7cRe0otJgUSGCLnRa6jcKLGsIdoN3HUTQcCekiDMfd alh/4qFxVGY2LyICygwUAUpHuSBI445E0tT0eBfjWTU4D9dhERKUcl2d9DbxzL8jqzWX btkeH9J3XMMdYNuG4n5MNRIybdwrEraZeIJOXi0Ttb1LMnAZrGDGSsW3Bgb5+Nbi8/Uu ESTw== 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=s3sELArwnllLD+ugCVP9YYlw3bRwDiF35pzdGOPf40k=; b=qXDV1lTfc1UYQg/mLV+O0UnPbRFcOMO7b+UyNW+B/rvfoXejjoF4x/RXCRCqYA1iOQ zALhLtyTJaN5oBhiJzOfjWVnmzXbT4f/tz5ZPtW5qZP8S4KhzslJ+A6JBRO0WBgSlL+F a/+2l67rXRKxYTXUNlD+rmZy6XgtwrAYAIazSURHFhv+gEwBvSqMlehz4tzbZEaBZlSL ZvXae4+oLEl6zY6SUMDRR1VpTw7EZEQpNyV7HVoN1PVFbrBdqPGvhgMAjG+Un7gRjT8p 1CFX3MEZUnSpw9fpvFSrx0cW0Ti79XJmDRRYkeJ0kC4ldogy7QYZReJuXWcT1ePsJXyj o04Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HGqcNWA0; 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 b16si5637878otq.201.2021.07.14.23.53.12; Wed, 14 Jul 2021 23:53:13 -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=HGqcNWA0; 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 S235173AbhGOG4E (ORCPT + 17 others); Thu, 15 Jul 2021 02:56:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239636AbhGOG4D (ORCPT ); Thu, 15 Jul 2021 02:56:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 978026117A; Thu, 15 Jul 2021 06:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626331991; bh=R4oQOomA8Ok/mNiwcSkcXhUgjl0dzN7G+Iv9LqLtcyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HGqcNWA0Cq+fYE9hv4SNYQ5hklXh4lnZWTj0DFfm8gBPSfmIVoIpR1wns12zrYnBk iLXd6C37MhC4m7sYiSN9JXIZANsTm7C/3W4WBWtOqyGjY/kN0nxGIR8kU82Qg/HD2l SXxy7KjFiZeIDdwkDxHL1SZG+rDG68gN6UvEDRvnqplEc284wmtJD4c2uloQ3YzJq4 8RnEpQMJefeK43h8UYXcrQxBlBnmQT1XEYA58ZqKj8MINwN/oG2Yq4k2btwyoLYhgJ ttU0TvgJZAxO3rXiGKNTY3SiPXt8gPmQyIK6LZnpEojz5PU1WfMjXdpMyIxLkvvf9Z 8pcmaqodP9bXQ== 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 09/11] drm/msm/disp/dpu1: Add support for DSC in topology Date: Thu, 15 Jul 2021 12:22:01 +0530 Message-Id: <20210715065203.709914-10-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 For DSC to work we typically need a 2,2,1 configuration. This should suffice for resolutions upto 4k. For more resolutions like 8k this won't work. The topology information is provided by DTS so we try to deduce the topology required for DSC. Furthermore, we can use 1 DSC encoder in lesser resolutions, but that is not power efficient according to Abhinav, it is better to use 2 mixers as that will split width/2 and is proven to be power efficient. Also, the panel has been tested only with 2,2,1 configuration, so for now we blindly create 2,2,1 topology when DSC is enabled Co-developed-by: Abhinav Kumar Signed-off-by: Abhinav Kumar Signed-off-by: Vinod Koul --- Changes since RFC: - Add more details in changelog drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.31.1 diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 41140b781e66..8f0a8bd9c8ff 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -573,6 +573,8 @@ static struct msm_display_topology dpu_encoder_get_topology( struct drm_display_mode *mode) { struct msm_display_topology topology = {0}; + struct drm_encoder *drm_enc; + struct msm_drm_private *priv; int i, intf_count = 0; for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++) @@ -607,8 +609,22 @@ static struct msm_display_topology dpu_encoder_get_topology( topology.num_enc = 0; topology.num_intf = intf_count; + drm_enc = &dpu_enc->base; + priv = drm_enc->dev->dev_private; + if (priv && priv->dsc) { + /* In case of Display Stream Compression DSC, we would use + * 2 encoders, 2 line mixers and 1 interface + * this is power optimal and can drive upto (including) 4k + * screens + */ + topology.num_enc = 2; + topology.num_intf = 1; + topology.num_lm = 2; + } + return topology; } + static int dpu_encoder_virt_atomic_check( struct drm_encoder *drm_enc, struct drm_crtc_state *crtc_state,