From patchwork Mon May 27 14:21:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 13675417 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 4537815FD04 for ; Mon, 27 May 2024 14:23:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819813; cv=none; b=dAw2lAqLFHTTUIN+QC5MzrQOdG08BhEsmABHT7fbVoyDb910NBEqgPvgu+jVAtBzHpyb773/qitEzh4LmBMI4nBuc6WcgtPaNnKOVAFGiLUPdLQ99+JMDZvgG5j7qjRmt0fEfTB6NqgE6tZql9OzFoBDHsLmbNAqB5fnMZ3pWYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819813; c=relaxed/simple; bh=BZ7wX/Bpz8n5eiAQ97O63A8D6o9XzCiQVYKk5arzCtQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xh8gNSQRH2BHxjpo9+teG1Q/77gybefm/Cw5HjRlmtnRw7UPA1+TCtrn4xu/gJ0Hv2xkcEBDNPvwaRQ4arfF7uckdl/9Xspl88uwW+PQepNsZEnMNA52HygQ0nPcA8bxEPa0FRWkXvCAjT2w+O/ojuDhw8WxZaGtZxKr9V3KMU4= 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=S3GtWWKF; arc=none smtp.client-ip=209.85.210.170 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="S3GtWWKF" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6f8ea5e3812so2699322b3a.2 for ; Mon, 27 May 2024 07:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819811; x=1717424611; 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=L9Z/Xi90npJWSANZU6vr3ADO8xKaQ7p/btP/dc1GbEs=; b=S3GtWWKF1w+mvPHjgS/yHLj1jDYj+ueRDpc2XTay793WH7vXSW69X9tgMfNYGaaSPn KOcyE4tJ9eYRWh65tQv7IScD4KjRK0lgAqL4tr3XxVo7/2pb/RFj89nAOngQLiTEnBCo L4U6obaIhYs1HtYSgs8HjrFu0Sj9ceueJ20viEJSwKSgW2q5+T17f20LSA46MjlTPDyF Shs6elhuYIXF/zW1d22q7xy+VpCvXa0veQMKGpojUqAVUMQX+cHENAktx3NC/zdc3dLM 3qsA6vg9oUzBxB82x5ac7PWbJK0ri4vWTGXwTXS4Q6ud5JHA1IaFBR7GRoGecYBngff2 Cstw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819811; x=1717424611; 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=L9Z/Xi90npJWSANZU6vr3ADO8xKaQ7p/btP/dc1GbEs=; b=e3l7OivJYE5t4HPaQJFH9y/2c6An4Slofy0uFooUn/iGzrqHzMvD8fhvpSBWTMKEHB mW6eyQAreYiB68pCaBc3jfO8Fn48GLjU3b/yLNnfyVn3xAHt939Oet/6bJCnIlceRfgE caFVKdvMwh1p/qcnFLPF6kXhF30llna79YQgEpq163J55X/LbWBuosphXFW20P9mAGtU vyLSIg44aA6wFqNsZzTcfW43jZG/qA7Jkz3rP11tvmwnoy9D7xv603sxXPGb4F/mz6sy qJsqKlYhSbtqkQhfHaASCjjREc/MBDrMvGehYTtpQI95yuJahG/5cvVR24jrlA8eDGVT 35Ng== X-Gm-Message-State: AOJu0Yz7N+y0gPN5+l9wXJAb0p6P+3Ll+hEdhHKsTJhmKQptFtMjAeDm QkUk7IVJCYXwo7oXxND3GF37oZEWVfXDnQMLyTqPXiev8u3ymJyDSMah7no6Zfo= X-Google-Smtp-Source: AGHT+IGUEW9adF5QWmGNx1DovOuHLsKxPisVNvPhcbc2Cq/jloQiLoZPjjpF/w4GkgiCUaAOTK1iYA== X-Received: by 2002:a05:6a00:28cd:b0:6f6:7c17:704f with SMTP id d2e1a72fcca58-6f8f2c626e6mr9680863b3a.5.1716819811597; Mon, 27 May 2024 07:23:31 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3eb67sm5109895b3a.19.2024.05.27.07.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:23:30 -0700 (PDT) From: Jun Nie Date: Mon, 27 May 2024 22:21:47 +0800 Subject: [PATCH v5 1/6] drm/msm/dpu: fix video mode DSC for DSI Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-1-f797ffba4682@linaro.org> References: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@linaro.org> In-Reply-To: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@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=1716819804; l=3468; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=pcO3EpSEffMXfzg3qm9/56HyKCoO+GZpl6408uIpjZY=; b=1A5BlK6c1bwwAerpYBl8UlV6cF5n3ZbY3fE8Nds6gp7rWU/K/IBq1VVN1PiZ+uWBQGtopy1WL PbEDmwmC249DHdk1GblzbVPzt8mM+9JWPyReTQIY1dC8ARwGDqrxOZy X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= From: Jonathan Marek Add width change in DPU timing for DSC compression case to work with DSI video mode. Signed-off-by: Jonathan Marek Signed-off-by: Jun Nie Reviewed-by: Dmitry Baryshkov Reviewed-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 8 ++++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 119f3ea50a7c..48cef6e79c70 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -564,7 +564,7 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc) return (num_dsc > 0) && (num_dsc > intf_count); } -static struct drm_dsc_config *dpu_encoder_get_dsc_config(struct drm_encoder *drm_enc) +struct drm_dsc_config *dpu_encoder_get_dsc_config(struct drm_encoder *drm_enc) { struct msm_drm_private *priv = drm_enc->dev->dev_private; struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); 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 002e89cc1705..2167c46c1a45 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -334,6 +334,14 @@ static inline enum dpu_3d_blend_mode dpu_encoder_helper_get_3d_blend_mode( */ unsigned int dpu_encoder_helper_get_dsc(struct dpu_encoder_phys *phys_enc); +/** + * dpu_encoder_get_dsc_config - get DSC config for the DPU encoder + * This helper function is used by physical encoder to get DSC config + * used for this encoder. + * @drm_enc: Pointer to encoder structure + */ +struct drm_dsc_config *dpu_encoder_get_dsc_config(struct drm_encoder *drm_enc); + /** * dpu_encoder_get_drm_fmt - return DRM fourcc format * @phys_enc: Pointer to physical encoder structure 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 ef69c2f408c3..925ec6ada0e1 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 @@ -11,6 +11,7 @@ #include "dpu_trace.h" #include "disp/msm_disp_snapshot.h" +#include #include #define DPU_DEBUG_VIDENC(e, fmt, ...) DPU_DEBUG("enc%d intf%d " fmt, \ @@ -115,6 +116,23 @@ 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. bits of 3 components(R/G/B) + * is compressed into bits of 1 pixel. + */ + if (phys_enc->hw_intf->cap->type != INTF_DP && timing->compression_en) { + struct drm_dsc_config *dsc = + dpu_encoder_get_dsc_config(phys_enc->parent); + /* + * TODO: replace drm_dsc_get_bpp_int with logic to handle + * fractional part if there is fraction + */ + timing->width = timing->width * drm_dsc_get_bpp_int(dsc) / + (dsc->bits_per_component * 3); + timing->xres = timing->width; + } } static u32 get_horizontal_total(const struct dpu_hw_intf_timing_params *timing) From patchwork Mon May 27 14:21:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 13675418 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 EEF301607B5 for ; Mon, 27 May 2024 14:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819820; cv=none; b=QES1o4G9U30xExyQlPT54b1HblNz8SBxvkY2M583YWjgtuFrl7Jgsd5JutfrbtrMZV8F5np3g2wmJeeYLdnhzKnLS8Og6AX53Owf3/qMAX1hv3hwQwfAinY/AKwdDBKwotMRrlrV1lLgrpnAGgpInSAwS/sKat7YBQMtGD0qp2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819820; c=relaxed/simple; bh=jIW+hVQ5X0Zur669tpB4Gs4vZvbIu7XObZH+l6jhkHM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Nv5S5W1WqOWXA9EBnd/vzeWvOh9e76eTT9SyQUecbLjIHTiVGAO+IdMpcMyekNjiRZCB7AI/MVl9w9aP4racnhpyYtyE0aHoD9XSr04q7fhdJvVRNaIPzzDRofe1DBqSBIg3TC/JedWuThV1uWBL/z/rkfxcPhAhv4VZAzlYZdA= 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=yQix86qx; arc=none smtp.client-ip=209.85.210.181 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yQix86qx" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6f8ecafd28cso2629480b3a.3 for ; Mon, 27 May 2024 07:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819818; x=1717424618; 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=or9AvWwVuKmZ+9fVlUmm74FcJvOEhh8SwrrrpYlBRos=; b=yQix86qxiVtPxGDzRKbEokVryIUDdEhmRh5a/sWE1NXsaLS/ZDBut/pc9T++4y2uxC bgclVofE25MRih1kA5E9egivfhOTcGa1Gg45/MR0TYkMmd80prPzoxs0KFenSPMypOT9 QHrKA/rulQi7/QGLGFEopZAP+R8PapBmxzYA2RYIXjkEq8TMaaFwUc61UeoWLUD1v9TV S/bjilVf8c1ehJbk8SEjOIZHeWjybBItOlJbspqd/vBYihRDyf8ODcBm+l4UBeV3wALn /noFqavdxk82A3IOQW62tkPEOcI9Ru0ZHM/BGl6wTw+jPf6FOQBKZetIoyPfqI5PSh0y NgQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819818; x=1717424618; 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=or9AvWwVuKmZ+9fVlUmm74FcJvOEhh8SwrrrpYlBRos=; b=rWsDEuwJwtbF/q+xVHqjDGnGmW/nH+uNAKT/F0Ml1OOQKzn7aoCDnem23JeBK9HYyg aYwdBFpz6885gQAqmSNqa/KX4j8cKllaW94yjIbDOVMg+LAaD183TDE7ra2zI7plAXcB 4wYRwUdHHetJmmIdTYq/Rusdg+QcroRjm54IEqh93mIRtqXTwBK2xm+S+sY57ZiiODuj m9mNtyktLhXEKm8SRdUFUShexatUL78y+7fZK5UIaQyD8BSxsD/IVqhXPM95JxZzRMP4 cXO7sW20A+Eq63cXDF1v1g5i4t+z2hEB0Wym71VusxgcneJjuURAVGAMR4dfVzrFxsJA DMIw== X-Gm-Message-State: AOJu0YxAJ10cUIs5iuSOS+cNg3+UOV4vSr1jqjGzrQ2bvwR/9MSKHRgx uX52p+PMv/QeBTDdhjZ7OvovfFcLJITBsdqaWHSsRUvOOz47RcKv7QZEp7DN/+o= X-Google-Smtp-Source: AGHT+IG5s0Nx0z1cNOvoX29tySD1dcKs02n2sVztOhjJ9jVpF8k3LNAXLHRmrH7DYpDq8Rlpg8Kfdw== X-Received: by 2002:a05:6a00:1f0f:b0:6f8:c476:4a7c with SMTP id d2e1a72fcca58-6f8f2d6ad6amr9840061b3a.9.1716819818292; Mon, 27 May 2024 07:23:38 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3eb67sm5109895b3a.19.2024.05.27.07.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:23:37 -0700 (PDT) From: Jun Nie Date: Mon, 27 May 2024 22:21:48 +0800 Subject: [PATCH v5 2/6] drm/msm/dpu: adjust data width for widen bus case Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-2-f797ffba4682@linaro.org> References: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@linaro.org> In-Reply-To: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@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 X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716819804; l=1032; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=jIW+hVQ5X0Zur669tpB4Gs4vZvbIu7XObZH+l6jhkHM=; b=ZW/KEuf6tsdQf0Sk0wk5BACoDmI2+DpY51Q4pwE0OKKXu364y9sAhtTGrFFKHEQ79OwXPuh2F xX2RHPQo34GDpKQvAZ4eNpMtIVTlQepkOvcKf8rkEpVIRCgHs6R/TDt X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= data is valid for only half the active window if widebus is enabled Signed-off-by: Jun Nie Reviewed-by: Dmitry Baryshkov Reviewed-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 225c1c7768ff..f97221423249 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c @@ -168,6 +168,15 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *intf, data_width = p->width; + /* + * If widebus is enabled, data is valid for only half the active window + * since the data rate is doubled in this mode. But for the compression + * mode in DP case, the p->width is already adjusted in + * drm_mode_to_intf_timing_params() + */ + if (p->wide_bus_en && !dp_intf) + data_width = p->width >> 1; + hsync_data_start_x = hsync_start_x; hsync_data_end_x = hsync_start_x + data_width - 1; From patchwork Mon May 27 14:21:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 13675419 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 9ED26161319 for ; Mon, 27 May 2024 14:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819827; cv=none; b=VVgsqkJf9STQtwUIFpJp3wobwZazg0pvY4b11PJpqhc6lfloLE02dGdsaZyElQfB3L9k62FxnqU77B0VmmPzu90Zk7InqLH7IAnGex8iqxzvxGqgLKKSKze0SBE2XWoe3KZMkA69U/tdXgzsU+ufigCKb/EcaOavpDX+NoghYTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819827; c=relaxed/simple; bh=puwV6VMl3Gje+6cIe4adoHwyL8CXWB3PvIs7MINp1lg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qGRhbjUk32/rnaWmC0HW0CMDP4UwJLB0VUcHWm7t+3dKEnnHFujGd24M76UcO0ZI6693yOldshkpUpT9yqs9CaBeF7/y904/ZZLZdazcbuhtUMb/uCMGwy5rBn6dSBsdkOu8t/0g/Uu5biuY9UpRa+m3ZWeAeGhs/1KXqr0knpA= 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=ITL8eiBl; arc=none smtp.client-ip=209.85.210.175 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ITL8eiBl" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6f8ecafd28cso2629593b3a.3 for ; Mon, 27 May 2024 07:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819825; x=1717424625; 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=9zZvfy4gBMpippgmQ5wbc8/FSu6Fg33BHDu+XbQ+New=; b=ITL8eiBlZbFXSrNKy7PvsQzawBX0cEqhk2kSk0RSQjGEaTcfXre2xxoKi5VRj18jWR M048OKP7cJuKfnH8sFZy2TND2i02wqV1MnPFdvDI/iSN872OV5Q0UHiGiFzH4pQoCOKT 0CF+yukHAVZs1sF8s0aFhFKhDzI+wA+fzT0schUH7Bm3Q2iRtWvS1GJbuQsob5PD1ZP9 J9J+Q23GYlyW2CvNXoqz5aleY6YgRtAWKE8LL/5+e8+pgAVSX8rvqZEzo0WxY0MbO9Gw jLP16wF0o3yhU2dEN3R4ZicuIs+MYbvLiAoX4nyQvEZ1BEOq+NgyzvZHR0lNyXe7Lsqi qYzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819825; x=1717424625; 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=9zZvfy4gBMpippgmQ5wbc8/FSu6Fg33BHDu+XbQ+New=; b=VE1Gk2vUpzhEXyeuNARvEuv96EwOEt/unGRwhJza/xbTMpHIx7KCQ83cXIgZq1oipn QKZ0/LM9jq4CTwPj2O6vb7O+1sHtVPOv5ASHSXhOEMeQi7zbOXAlrDIEdoD9ma1jLovA kZpmd/jNtCThk5HbUj1Rl5bSS71FoV/AOSCqiVXXRVB+HlNmA+QTGxzu+k6IJ/7Mx1lI 4ECxtqEp3YdMhh8/WotPyt0eIg0LbGUyCizqQ+Um0YWdpwEwAcToc9Vmq+x4iH/8liIo Me/uTwWAqDrW0ZPQeoneE5/bVN4lXnWR5KQ1B9enQpsHKGN95pf62MJmDG3bbW0ttpuD Vo4A== X-Gm-Message-State: AOJu0YzyPpSix4SRFfQUZf2vbj2RrIVXd0L3Qct2b0GJEoYsJft3uOCk VrF9egJdATBdUZYFc+s1JPi0p8LA4P4Zcf3CwQ2rXVk1zuwFWwx3WUx0LyZbrNE= X-Google-Smtp-Source: AGHT+IFNKaRSlZszopjikYU0pMskYc/ekBfYriMXVMO/i95lcWdRC6YJKq+hsm5J3tzzdDaM/zWi/Q== X-Received: by 2002:a05:6a20:72a6:b0:1af:a45a:a8de with SMTP id adf61e73a8af0-1b212d5aa97mr11310422637.5.1716819824793; Mon, 27 May 2024 07:23:44 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3eb67sm5109895b3a.19.2024.05.27.07.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:23:44 -0700 (PDT) From: Jun Nie Date: Mon, 27 May 2024 22:21:49 +0800 Subject: [PATCH v5 3/6] drm/msm/dpu: enable compression bit in cfg2 for DSC Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-3-f797ffba4682@linaro.org> References: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@linaro.org> In-Reply-To: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@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 X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716819804; l=886; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=puwV6VMl3Gje+6cIe4adoHwyL8CXWB3PvIs7MINp1lg=; b=ZogImoZXzCH580LPFWHl29ocg7xqFmLTY0xbQUs0QVH/Rf4R1calGI+KqzyIgCRbmiPD8fn9V 6qwpylPoVrBBEX6cdG8aua9l2xblGmOgNFwbUeRWLLOM6Wl0yuwy7Ny X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= Enable compression bit in cfg2 register for DSC in the DSI case Signed-off-by: Jun Nie Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 4 ++++ 1 file changed, 4 insertions(+) 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 f97221423249..34bfcfba3df2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c @@ -177,6 +177,10 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *intf, if (p->wide_bus_en && !dp_intf) data_width = p->width >> 1; + /* TODO: handle DSC+DP case, we only handle DSC+DSI case so far */ + if (p->compression_en && !dp_intf) + intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; + hsync_data_start_x = hsync_start_x; hsync_data_end_x = hsync_start_x + data_width - 1; From patchwork Mon May 27 14:21:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 13675420 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 D9C0B16F82E for ; Mon, 27 May 2024 14:23:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819834; cv=none; b=CUz7vzm5T6uDLyH0VEMX2JMmm8cSjIoCcZOtOAcvEdkjlvKilRM96qbY+bdy40UtWeQTHs84BdxzxZBSpxl8sfwdRMSxt1/1bHcz/e/0faktVBwrWCklKZat2Q4el85433TIsGJYD+BZ0lrBbskB3tdvZWw0kWVbgo5TlGblr40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819834; c=relaxed/simple; bh=G4jmD+K/fkmFufgBXjmnjPbCcQzArsr/IXqIKSDtt2s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PE2RJMI5BbBkG/OHBTs6YicAloEYbdGyrLgEAKpGwGeXCSUXfk/bk/TH4JbH1dbPGj7fcmqcR/NKfsdAr8lTN1tdp22cZeQzcs8JNDC24+Z0P3cXZcwz+dzBdk8Dqy/+X2TD+uPftqk2xhGryS7z8QyAl5OM5di1A28uQ1Rn4sk= 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=L3bm/2hS; arc=none smtp.client-ip=209.85.210.181 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L3bm/2hS" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6f6bddf57f6so6539552b3a.0 for ; Mon, 27 May 2024 07:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819832; x=1717424632; 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=O7X6X7Xg0a7P3rLwok0YLujXGrmUyMxWDQ/9AezaVG8=; b=L3bm/2hSZFyoQ6N3aybetsRc6AaauTaN9MciBwqzUbaFPtcdjE/7nGFKQ/kDzfF9+L qMX7aKUQBbhqD7CFGe6qkzaMRLCUy2eHG1tNsCZiDvB4m/ibGLe7qHXSz/y7bRW+sZ4j 3Aiv1QsCQEhKt4fgddwMwj2wOMlgchY4H0ORpphmsZQ/0Nryn+2G0MLL+kvQYEdLiyJz E5aCafrMQDSUQzC+QBj5rav1XT5LKpmnAmMb+MKSejIIHbPBYQ05mx9C0iNIX7ifI20J sSCD/B036QxzhVzVPlseHjCBvmTUZnPwiP+7t9Bd4HNccVje2trEhwKtkdHgq5G9syb2 Qarg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819832; x=1717424632; 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=O7X6X7Xg0a7P3rLwok0YLujXGrmUyMxWDQ/9AezaVG8=; b=H7uhHYNE0K0A15behDILTnigPLtopslfRptXKAEn+sh2qtJnLZGp37hXK+o8cxiH+a Xz/8tI6WhmMkF+kykymdPEt9y69Wnv7FRofDdva4/H19r+cjZbRoZ70J9EkJUBB8g5OH +kae/JOHgX8yXoEOO4q58M3SrUbni+DqjUm/+kQibSbS6/PgeZKvTgxCkNKwzb9i52Eq QC/Y6uqCRkvK6/akrVi0p8cWsUU+b6cC2l+3VAkYsmX6tOcJnmpn0UEXIWvwRcjZLYqr +cnNh5ZOqZsNex9mwClaG7NRNlOKggSIDfGkPI6lqINKP8LPR504L3xjc62fFBcESsuh GRXg== X-Gm-Message-State: AOJu0YyuBhbbHihTZFZY+mF1RpDiLmikfbbOR59zpqImQC2sXZZdxTwQ X7zGebgFfn3RNW0Mvgd6HaQWcwy8JL0PCKLiu2zG5BSyRKW1dUbCa5MFeEtEfS8= X-Google-Smtp-Source: AGHT+IG27XneYYlxfnsTtGUnnHHJLVJw3XpHBmvzPjELzZgM4IPaUCPSYuo23gRJ69ondE1sRJxjlg== X-Received: by 2002:a05:6a00:2c94:b0:6ec:ebf4:3e8a with SMTP id d2e1a72fcca58-6f8f34ca63dmr10771339b3a.15.1716819832148; Mon, 27 May 2024 07:23:52 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3eb67sm5109895b3a.19.2024.05.27.07.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:23:51 -0700 (PDT) From: Jun Nie Date: Mon, 27 May 2024 22:21:50 +0800 Subject: [PATCH v5 4/6] drm/msm/dsi: set video mode widebus enable bit when widebus is enabled Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-4-f797ffba4682@linaro.org> References: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@linaro.org> In-Reply-To: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@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=1716819804; l=1644; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=myYBVxgRS2I/E3QUdyhnLOjWSeM7jzrWqz2ABozlocE=; b=KGkFKxznrl2L4qx7rg8Wv+F+s40+BieN1hHXytdmrRqouAatjjpJr4uDP8ac42S540r7BBQDB GPbVAfPkobRDtEz1BKE+9Ztglw7OwGo5V0hA5R+RnlgrZDYLNb5gAbT X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= From: Jonathan Marek The value returned by msm_dsi_wide_bus_enabled() doesn't match what the driver is doing in video mode. Fix that by actually enabling widebus for video mode. Fixes: efcbd6f9cdeb ("drm/msm/dsi: Enable widebus for DSI") Signed-off-by: Jonathan Marek Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Jessica Zhang Signed-off-by: Jun Nie --- drivers/gpu/drm/msm/dsi/dsi_host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index a50f4dda5941..47f5858334f6 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -754,6 +754,8 @@ static void dsi_ctrl_enable(struct msm_dsi_host *msm_host, data |= DSI_VID_CFG0_TRAFFIC_MODE(dsi_get_traffic_mode(flags)); data |= DSI_VID_CFG0_DST_FORMAT(dsi_get_vid_fmt(mipi_fmt)); data |= DSI_VID_CFG0_VIRT_CHANNEL(msm_host->channel); + if (msm_dsi_host_is_wide_bus_enabled(&msm_host->base)) + data |= DSI_VID_CFG0_DATABUS_WIDEN; dsi_write(msm_host, REG_DSI_VID_CFG0, data); /* Do not swap RGB colors */ @@ -778,7 +780,6 @@ static void dsi_ctrl_enable(struct msm_dsi_host *msm_host, if (cfg_hnd->minor >= MSM_DSI_6G_VER_MINOR_V1_3) data |= DSI_CMD_MODE_MDP_CTRL2_BURST_MODE; - /* TODO: Allow for video-mode support once tested/fixed */ if (msm_dsi_host_is_wide_bus_enabled(&msm_host->base)) data |= DSI_CMD_MODE_MDP_CTRL2_DATABUS_WIDEN; From patchwork Mon May 27 14:21:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 13675421 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 1DDB516F84C for ; Mon, 27 May 2024 14:23:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819841; cv=none; b=FlIyqki46d/mvXxQSkmbbOqevPN7FxBMxhIVF8RhqfaVRlNv/Lmgl+w9cnYpvt83QItJqrp5b7fooNwNjtWTWr4YiczqptyMjCZPLUg6GqTOhxYpaWidj40EHDzg+9i1km/sBfZpJNjbNqD1OpF69qLJDXT7aMs3b0Fxa1Dj9Y4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819841; c=relaxed/simple; bh=edX0EVhDlR3P74S/rdsu2HwqaRU9x7uNrFINA9VNrxk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FZZb/B/MEnrqytY0ckOrHO2XB0UoOJBooKI3udw9z7Gqgxm2AZSjGnUpsakge+FNeJKrDSwCHmvspkn1/DgLSrPMCn9gXKxRhR2JBxXd6ZFgBSTXM6TioTXB9ms3myFnAeCZdQJJkurVhELS1RltTX4a3x7kh5K5g3qsQYF6p0I= 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=nOAskF9p; arc=none smtp.client-ip=209.85.210.174 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nOAskF9p" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6f4ed9dc7beso3987024b3a.1 for ; Mon, 27 May 2024 07:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819839; x=1717424639; 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=1q/zNwiMaDEmdeMjqIrsYp4iIRvhgkioJMBpY2/fUh4=; b=nOAskF9p4zBfw6Uwh6EaRIG+hX4R/xd95HCNFNHQWGkIqxMY2dPovOSGuzI5flMpUS l1NkAhX3Y+WL7wQOz6iOUww6Hm4Wi91c4hE19TEVfgFfNfUsfkb016YS4VGdKqvwRdeL fuQc0c5ZCe3SPJg5dke93+3fwVTFiihNaiFo47CIYhL/DlOz6C4FoMkTC2jPTwn/vnC1 6iu39Jm+6rpI9XUnqRffq0b0NDoz/qvpccsE3thWMtCHFuLX/6Hs9PM46YpLJXikavGn IP6MaKl8AZ55jip2YAD/zoa/lkgOMUcxx7caZvP42Xejdv/bd4SXXvkhUVbOaBPKKqg+ LWjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819839; x=1717424639; 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=1q/zNwiMaDEmdeMjqIrsYp4iIRvhgkioJMBpY2/fUh4=; b=XvgKm3D7od9u7vW/hAW5zqcqFM+XDtPdq5cTP7pQuvmtWg+gG13RIlf6jOMo/faREi WGr4yHjz+GJ4E5Kb0WG7Yt2CUsDI27RZ/GESNCxipWvUjq8ova7MAgru2NUC/xgTygh8 rc0TAubN07x6t7SMsCwrCzUyx6LADrAGAsXAFqE4gxvhUy+ZtKtQ2rwLXpstkxU7UWY9 +HNyl5VI84mFN6+MBQYehvnwR/t29GyzRKRr6TR4SJ2cI2Mv3e7AdXXWrjz2MU14lXbZ I6wctDlyZk1TtOI3DQ4RanfcN5m2lRCBL3E87zvjynwtHZg6nYnnqkk62Bp1lp9G+Rx8 o0Ng== X-Gm-Message-State: AOJu0YwZXuom6rYEcouzVaJ9o/Qu3jhUepppfURKK3bk6Vo++UP9Byhx HF8by9FjS+lH5hX/aoeoH4OpjWPZhV+T64TsFQnHpsZ6f9XyOaigAF6j240QPAI= X-Google-Smtp-Source: AGHT+IGZUeImmFZRD7CnLeMPw/skw95bTK15ZusEaOjy940fGLqfHaFZVT0WKxGpOOOhS9SBld6T5w== X-Received: by 2002:a05:6a00:2c94:b0:6f8:c94f:578a with SMTP id d2e1a72fcca58-6f8e9fc10d2mr14002563b3a.12.1716819839415; Mon, 27 May 2024 07:23:59 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3eb67sm5109895b3a.19.2024.05.27.07.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:23:58 -0700 (PDT) From: Jun Nie Date: Mon, 27 May 2024 22:21:51 +0800 Subject: [PATCH v5 5/6] drm/msm/dsi: set VIDEO_COMPRESSION_MODE_CTRL_WC Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-5-f797ffba4682@linaro.org> References: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@linaro.org> In-Reply-To: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@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=1716819804; l=1725; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=kdfjO+qJ+tyWY/8kntVCewHf4UP39s93vNEdOjHmAf8=; b=WZK+fi9R1wzG9SG7mvTJ8kFWQ2CEBx+pPrg/R5DlNh/d01o6/7FKCZ/kIxSBneAYyg24Svub0 MwG+ROnBoCtCqjgeMdjLNXvNtdxbpy3X3umPH1oZ8zS7n1OuVD9mief X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= From: Jonathan Marek Video mode DSC won't work if this field is not set correctly. Set it to fix video mode DSC (for slice_per_pkt==1 cases at least). Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Jonathan Marek Reviewed-by: Dmitry Baryshkov Signed-off-by: Jun Nie Reviewed-by: Jessica Zhang --- drivers/gpu/drm/msm/dsi/dsi_host.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 47f5858334f6..7252d36687e6 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -857,6 +857,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod u32 slice_per_intf, total_bytes_per_intf; u32 pkt_per_line; u32 eol_byte_num; + u32 bytes_per_pkt; /* first calculate dsc parameters and then program * compress mode registers @@ -864,6 +865,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod slice_per_intf = msm_dsc_get_slices_per_intf(dsc, hdisplay); total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf; + bytes_per_pkt = dsc->slice_chunk_size; /* * slice_per_pkt; */ eol_byte_num = total_bytes_per_intf % 3; @@ -901,6 +903,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod dsi_write(msm_host, REG_DSI_COMMAND_COMPRESSION_MODE_CTRL, reg_ctrl); dsi_write(msm_host, REG_DSI_COMMAND_COMPRESSION_MODE_CTRL2, reg_ctrl2); } else { + reg |= DSI_VIDEO_COMPRESSION_MODE_CTRL_WC(bytes_per_pkt); dsi_write(msm_host, REG_DSI_VIDEO_COMPRESSION_MODE_CTRL, reg); } } From patchwork Mon May 27 14:21:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 13675422 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 F1FCB16F8F3 for ; Mon, 27 May 2024 14:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819848; cv=none; b=OlcUMFOygMw7108jjlE+odIm1OthvEjJ1/yFfigiH1YtL+QWf5XktOVwGqiIBSesF0o3wYWV6w8hE9pLC9nqu3xusRMeEtTUFc+HKtE0sBY9JW9cGXndSYNB3T1UzyZFPF5LiMAp/vBEAORzaBTtuT290Z+3Vn9qfclwHyDfpdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819848; c=relaxed/simple; bh=OWccy+nICEZUKQPwByjtML13iQY9e7N6XueMvybRfeI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t6B0MVOsrRYytI1q3WYUQ5cnzmQJgXwANZzMw5Mq5n5p8l0wYWa2BgMb1pmtktXTKsxMhgyY+GEkPOvNrboqNxueE+MfX7i1MvUUusdk2gOL3HsITkXqrEdzKbEeLsmW+QGVqi7DXhTPQqNeufkOkKgc1A0guqVAv22OPQfFlkY= 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=geZBSPNM; arc=none smtp.client-ip=209.85.210.174 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="geZBSPNM" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6f966840af7so2594142b3a.2 for ; Mon, 27 May 2024 07:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819846; x=1717424646; 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=Y7t4uYmRqlJLrpJDiHKBdOulRnB5HHZ6HHejKDBAJ1A=; b=geZBSPNM0L7z+LF+w4vMu3B3WY7AF2PO+By/1Ifp0qgg5iN1245+kM7nXmhoFleiKm Vpz8hEfwz4jho/HtEwTstgSK9WIPsZGUI1Tg1xYdKh23/zThArvtorBrWBgrp5DfizE/ s/O6Fv263DlWJgmyiQvlSfAWiGs4DUsV5c9WMYmeUgABxabXobrfVER4lw7CMcuj5POc rPGcwoJNC/T5ZSxQLIG8W7d0zmU5DdNxbA4HiDdwJ+bqX9M3JbMbefitjNtbR44WuLYP x+6DMVu/TTt7tgAkovfXB7lLJx2jCklNtC2o9sS0wRM0z1oVgSfL0YHWUxWFpr0ZRgYu E0xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819846; x=1717424646; 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=Y7t4uYmRqlJLrpJDiHKBdOulRnB5HHZ6HHejKDBAJ1A=; b=NpmibkpRdBc9WSf17VNrDb/vcoTPyWu5957k/GSBO9UDo3UU8aUcObqENkH8jbSmDF mIh8y5iSVu0lYhFSEzBQi2T/sJ3up6xVtu2+BGQI2nI56RABvlszWLqgabpW0a/ooHZH 2+KVcC/h1GgF7DTdBD/VSQSMUrAJoUahTkCT8b1AmC1fX4Qy/XkdCVRtCRa/MXY/+iqa at3HgwJq1gAZILmeVY+zecxvgD/kqk+plS9R/2wZZL7nC2064Txzh8rOs9Ed6QHLOP+e BnOIRBq8ldmVB2CeEcTVG0g4GcCRKR96qfalYmnOe/w1Ayo36AQ8gWinrTFP+ubap/Bj c+zg== X-Gm-Message-State: AOJu0YynqSzpZgtkb5hKEMcVdIGCeaVS66UB35jFH+18u1XRk8tKo59N /dsROm4+8GyCGhA/SzTkVlw11bVHJp+duBUGw+9wDXg/vSmuVWZPE6qgtrmlf+8= X-Google-Smtp-Source: AGHT+IHJ7Gus1KojOvbGG4MRVvDnQ0USYq7JfPcmCETBzGI3IuW+o9e/WGNMRkZQQAcHSiH5qpRc+Q== X-Received: by 2002:a05:6a20:5612:b0:1b0:24e7:5a35 with SMTP id adf61e73a8af0-1b212e5273emr8026076637.56.1716819846219; Mon, 27 May 2024 07:24:06 -0700 (PDT) Received: from [127.0.1.1] ([112.64.61.67]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3eb67sm5109895b3a.19.2024.05.27.07.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:24:05 -0700 (PDT) From: Jun Nie Date: Mon, 27 May 2024 22:21:52 +0800 Subject: [PATCH v5 6/6] drm/msm/dsi: add a comment to explain pkt_per_line encoding Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-6-f797ffba4682@linaro.org> References: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@linaro.org> In-Reply-To: <20240527-msm-drm-dsc-dsi-video-upstream-4-v5-0-f797ffba4682@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=1716819804; l=1190; i=jun.nie@linaro.org; s=20240403; h=from:subject:message-id; bh=hsA6cTh9A+abQ7dtFiITzQof1AHhT8P4eUkFfENrPaA=; b=DmbDrlVs3esyebwnhCPWbFsy+3uwdGxILFetgc/uTTqgEnXQ4scfPZdp9cpq2OPCVEMiCYALa kYkngMR3pH8CTp6Ev9lolCotIye0Vm+rDHwrPIy1FkaaCunqMdtsjC0 X-Developer-Key: i=jun.nie@linaro.org; a=ed25519; pk=MNiBt/faLPvo+iJoP1hodyY2x6ozVXL8QMptmsKg3cc= From: Jonathan Marek Make it clear why the pkt_per_line value is being "divided by 2". Signed-off-by: Jonathan Marek Reviewed-by: Dmitry Baryshkov Signed-off-by: Jun Nie Reviewed-by: Jessica Zhang --- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 7252d36687e6..4768cff08381 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -885,7 +885,11 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod /* DSI_VIDEO_COMPRESSION_MODE & DSI_COMMAND_COMPRESSION_MODE * registers have similar offsets, so for below common code use * DSI_VIDEO_COMPRESSION_MODE_XXXX for setting bits + * + * pkt_per_line is log2 encoded, >>1 works for supported values (1,2,4) */ + if (pkt_per_line > 4) + drm_warn_once(msm_host->dev, "pkt_per_line too big"); reg |= DSI_VIDEO_COMPRESSION_MODE_CTRL_PKT_PER_LINE(pkt_per_line >> 1); reg |= DSI_VIDEO_COMPRESSION_MODE_CTRL_EOL_BYTE_NUM(eol_byte_num); reg |= DSI_VIDEO_COMPRESSION_MODE_CTRL_EN;