Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2580123lqz; Wed, 3 Apr 2024 02:19:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBTCbAI6rQ8sYAmuFZGymZ0UWPAxGBMieHMTGDxb+ZeXILmpNlqv2AjAh9rpVGLLoPDXM+2zcb2bWClWA+YCLDje2UMnEKUabzqjmlyg== X-Google-Smtp-Source: AGHT+IG42CTBEYb8LiyccpsNw/ReRxAZoUB86iaCLoamCVsTmJ685iIh/TJN7HN9CI57v6OOSDzC X-Received: by 2002:a05:6a20:9c90:b0:1a7:204:16d2 with SMTP id mj16-20020a056a209c9000b001a7020416d2mr16548235pzb.35.1712135995268; Wed, 03 Apr 2024 02:19:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712135995; cv=pass; d=google.com; s=arc-20160816; b=jFpd/GheqDEQC/HP9a5Ew7+PLx+OVjfpFYHMiwJagocOJuRy+1Ideb2lt7oO0Tl4Zr Ot77On9gwqQwSrWsRLqIdnrWPXmJtPJGwEqROW1reTmshcN0Sz21ExVUgfc7gi9U0LhR wanHS4HhnjbVF9M2lVCNlScw7IxXg5evSAGbAHwiDp/qGTkpyVWBp1442eAGKVX6ymFO CgNAfFz4IPpj0BdDGYV06Dmmm3iM6GPGkgyJDAZn13pUHyYsJr0Xo49E42TMN8AkvGAZ 4fDnB6H+EF8iOU9DFfW2Vibcrd0CV9fDxLHPcIV3y0OGIM3xXofco2h9rCUvVd49r0so EFHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=NP1mArxks5bntvoBu6vgePRngXslO+DwNYzgIBI4xco=; fh=Zv4lxd77K8Yr9q4lQZSBF1jNOOGaY4zEL0QYVvSwjs4=; b=EFkssQ/xRb+K0mTpjimj6MeIP3JqyVCF3R3cuEYoVQbvcyScK5z7YolS1/KgQxxt5G XhhjogMh2cZzrLz3qIqMMTTZnuuaC8PjZ6vJBZZyhEMXk+NVF1985CSO5kw0pV3tpYie oPuHkNU3lz88shUSfeL2cVilQNFsKl2ZH2UA9Rg2sd9ungSSuad7GJd3u4b3tvFEPcKb MWTyg8UYXfg+CsxzrMeyZU+aj8+PO1jarTC17I3YpXwjyMbzWZMKSiUQcTwL3yv8PshX aYFEoRE1OOr8cDDxh5pLECLgDKtnddwRuh8qSNd8kkO6etJggnJ8ir+kilW1EB+dm1QD q8Jw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BZm9pBQs; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-129397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i12-20020a17090332cc00b001e09120e9d3si13241520plr.45.2024.04.03.02.19.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 02:19:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BZm9pBQs; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-129397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9463F28CEA7 for ; Wed, 3 Apr 2024 09:11:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF8526FE1D; Wed, 3 Apr 2024 09:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BZm9pBQs" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85CC76F08A for ; Wed, 3 Apr 2024 09:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712135480; cv=none; b=dOjnod5/yoWbkcPmiiYovbKLsiFQvgFJw8PRGh5XIkv3uqj+9mbJIJ6GD+KtFDraAUYfA9S3da5NrScPucZ3nOncFCltlEfW0gKCOFQQeAHRsxzrwzPagaPHd9NhZbF2coOWWawVSRlMAwgfnQ27EjJ/JDvIAX2nM2GrtYxZXnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712135480; c=relaxed/simple; bh=17irNPUG8rONBYpdu5/zoIuYJGUsley5193TkmEMtIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B7rumaubCR2uHV/VFpCwEVoljl8ZymeopDgyCFsvR6ZbYM4R70O0IFxd84Uvfxaew9HnwLByf6mSd4lxfCMiSwrsMu3kfEs4StSV7wd5bobtx1ZgcFJsSDIB/rdXIpcLduEsKiFwt1v7we+7Fwf0wiQFqEwe5pVD1iVhDL80p0M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BZm9pBQs; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e27e174ccbso9391155ad.2 for ; Wed, 03 Apr 2024 02:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712135477; x=1712740277; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NP1mArxks5bntvoBu6vgePRngXslO+DwNYzgIBI4xco=; b=BZm9pBQsAb6QaI1UZQaT6yCYdUjdNkYtvI9CB1ZMkms/GDTLUFvEzrcU9p90qZk2Jy T6G2YfVYJbsKficpr3E+mtLcJJz4eDYxqldzTtMs+wSnRjElsMCwmqhbQUKAEKt9HiIi an/uvidR83fyZnAFTBYO82/1zaqDGl5+Zj5LLkMUTzd9NC2GndPks7ssapZMtMdKkcvL oL6HI+VKtzG1KaErHFHHnGafjkOT3kVicePu4SZuOEsXBtNNz+ipnDCRRZLG/K8ALBdl wKLt+2/yAyvpS6H8vFx163jCoiKdgb1+vZGGph8OpjKS7v0U+HzI7WdWzdUZpoJAYMgN jkrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712135477; x=1712740277; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NP1mArxks5bntvoBu6vgePRngXslO+DwNYzgIBI4xco=; b=unsZhRNmHhigDJ/+Qwa83u++fp6UouHnX5slmRQobxl196LO5uc0m39V1f7TYioUND 1gHKx8oTWtJoAvvj3V/GdbjEa+1o/OzorqweBILGN1s30Y07plpJjEQKZ6ga+em9FFl5 IyT8tIAanTyIM+/BNlC3xQ1Vudp5xLrS/RIz70Eydg4BWZsgYl/B4MGjfA9VGjFfbnw7 fVA1UZ2Q+4jx20/+HJZMftYHLEKIHiEvbYwHY6Jzo7hPbQRyKbC1qMtWQYDjrFamFdom 0huCF14u0RTY1agq/RM8ey0AjNsq/T0iC/4JGtwbRHpfJJLoYY5YmiuPD+S/JrN9ZCy1 Ib9Q== X-Forwarded-Encrypted: i=1; AJvYcCVw3tbusdhK+n/yjHjQafxn41ftzomGRJy62VVa8+QTPJVT3fShxejq1H65d2Tg3sbDFxnHj5pedAxnmx1BWKYPt4/iZo7BQTs3ScHs X-Gm-Message-State: AOJu0Yz/PclurNI1cDmvKINDWErcBX7CIfiNr4JXmsEa0wEnEW0kIm/C 0lKPI246pc0xdpZePKirjNF54YbnOOBulJZvHymIzazsvkoZrNQhuugevjc3+8jVuOuflfb11l0 /5VX9fA== X-Received: by 2002:a17:903:2285:b0:1e0:b872:d862 with SMTP id b5-20020a170903228500b001e0b872d862mr19646560plh.52.1712135476796; Wed, 03 Apr 2024 02:11:16 -0700 (PDT) Received: from [127.0.1.1] ([112.65.12.66]) by smtp.gmail.com with ESMTPSA id lo14-20020a170903434e00b001e0aded0ca7sm12688087plb.239.2024.04.03.02.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 02:11:16 -0700 (PDT) From: Jun Nie Date: Wed, 03 Apr 2024 17:10:57 +0800 Subject: [PATCH v3 1/6] drm/msm/dpu: fix video mode DSC for DSI Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240403-msm-drm-dsc-dsi-video-upstream-v1-1-db5036443545@linaro.org> References: <20240403-msm-drm-dsc-dsi-video-upstream-v1-0-db5036443545@linaro.org> In-Reply-To: <20240403-msm-drm-dsc-dsi-video-upstream-v1-0-db5036443545@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Jessica Zhang , Vinod Koul Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jun Nie , Jonathan Marek X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1712135460; l=2016; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=m6HQvVN42IUfffBpA5rSrdSQLAGl00b8q3W/bbmwYL0=; b=X1XSY5kWlW4EvhrnUx70p2aoQcx3f1DnnQ4OyjHIWQvbWeRXvcU2GduJDjEEDh2iXJNAm4MLN Z3Bv1A5eBC0BqnYTDzQzUt3NZ19ccVql5AenjM0xwfQJWidDKXu80Ql X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= From: Jonathan Marek Add necessary DPU timing and control changes for DSC to work with DSI video mode. Signed-off-by: Jonathan Marek Signed-off-by: Jun Nie --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 9 +++++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index d9e7dbf0499c..c7b009a60b63 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -115,6 +115,15 @@ static void drm_mode_to_intf_timing_params( timing->h_front_porch = timing->h_front_porch >> 1; timing->hsync_pulse_width = timing->hsync_pulse_width >> 1; } + + /* + * for DSI, if compression is enabled, then divide the horizonal active + * timing parameters by compression ratio. + */ + if (phys_enc->hw_intf->cap->type != INTF_DP && timing->compression_en) { + timing->width = timing->width / 3; /* XXX: don't assume 3:1 compression ratio */ + timing->xres = timing->width; + } } static u32 get_horizontal_total(const struct dpu_hw_intf_timing_params *timing) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c index 965692ef7892..079efb48db05 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c @@ -167,6 +167,14 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx, intf_cfg2 |= INTF_CFG2_DATABUS_WIDEN; data_width = p->width; + if (p->wide_bus_en && !dp_intf) + data_width = p->width >> 1; + + if (p->compression_en) + intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; + + if (p->compression_en && dp_intf) + DPU_ERROR("missing adjustments for DSC+DP\n"); hsync_data_start_x = hsync_start_x; hsync_data_end_x = hsync_start_x + data_width - 1; -- 2.34.1