Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp300723lqb; Tue, 16 Apr 2024 16:58:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWH3yfpNXzgdaSd8yQT92Jw5xHI+nuhTG+IPSiKDAO7qGJw63bWDsi0n89pNpqYoWFhi+TslV7/Tk8Brq3X6Q4gpvmgnnHdwtw81Dl0BA== X-Google-Smtp-Source: AGHT+IE1FxGtnHELBpBvWQXjZ/MOJZmRopxbQ0xInm76JywGOMgCONsLD9Q+gGQKTix6Lqvt/exG X-Received: by 2002:a17:90a:fa81:b0:2a0:8f31:a359 with SMTP id cu1-20020a17090afa8100b002a08f31a359mr13859820pjb.39.1713311882221; Tue, 16 Apr 2024 16:58:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713311882; cv=pass; d=google.com; s=arc-20160816; b=sa2BTVnOCcSrkWQSRICCc/IdalngsxMryxEwKpvCNsE2VGXMFvrAbKk47doMatTnFb rVcyVt3PDCYZ59dyrewVgE5Wl6AzNKkbVRQ315e0H5RWjRcfJ5L0Gm3sOb4diZySJBp4 Golabvxes6cp/vQPoFjpl/rQ11H/hQ+zCx0j9/i12t+kudfrNfYC0n6LYrPiuDImBxAc mnZxSwk636woWLx8dbAKH7vPXx5LLFm0dXX6IBVm57SN9PUPUDqEs3hxyJ7BfxTiRB4N Ei6TR/0X3Xr5xNksCLxjfBTaIwH5gDuwqtZTuadt/V1NEL7/hQNV21iE0zXEhIlW+DLa dDiQ== 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; bh=u5YpojU5aSsxb2G0XMP2aeu07DOSTWvk3t8a33X/rLA=; fh=EaVNV8gKHS73tSa0PfwfCJhAdPfizlMjT2zacFzFq/Y=; b=yPhFbf0UeM+irjcIcfm8VsdUL3/jjzsxm0WQNpX26wU+cChz8vu4MViKCDUspzkCGD NpxRAcCd0Gi42g+yRdOF0AE95ifud+d7vnB+b21dIBlOz250GfouoL6YzLGAtzhZBCBh qNmND/cgQ9/pw6E/x1HbMc3zx4lkK5W50pDSDI+ltGqpcjb5RQ1Q5BHYjbjiR7R+Y6Yu nMOpCXCIblOyToEzx2g3DqJ9BaSZP8gNSReM7zWbf4Dj3FU60v5feIYjMSagNyfqsSy7 WLebduQwQVAW6VNhwFUInlmFLOe3hD8+lr+vJcj9O2GT8tVBJhTyc4NABz0jGR9OpiNu 5YRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147771-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e33-20020a635461000000b005dc49a8cea8si10458960pgm.376.2024.04.16.16.58.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 16:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147771-linux.lists.archive=gmail.com@vger.kernel.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 C4DE9284C13 for ; Tue, 16 Apr 2024 23:58:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A886513AD20; Tue, 16 Apr 2024 23:57:50 +0000 (UTC) Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [5.144.164.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 857E713A890; Tue, 16 Apr 2024 23:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713311870; cv=none; b=ivxsKH5eNuDgn6L2I2V+LqSeFUXAe/YJnL98WBbzAH+spJNUxqM5LhquSLgMySfDISXY5EooSUTUFXztoDEnQ92ihXgLCe6cwOmYx4zPtF5PwAWfSdcHb34eYB0CNzYquBKH7VUrx5r3Mni9EC6gHQYwSpzcx0Nb0QoECeTRTrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713311870; c=relaxed/simple; bh=EdVhzTAQppDa6zO4jSvemRUuERn806FYYnZThpRKfao=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Muxl1ikOfzhIPdAElrQFFrVw1J7q0YkLNcEKMxKk4hK66I+hSJRRSMSckzY3TAowjoUTlscRZsK814ICLmDnrX0cdxn+k1UaEdBbp/bb/bFmACwm5Hy+x6ib94BBwqIVtRCXqwsR8To67Q/p/1VhSp2UA7PF7TZHnSUG0L+I9vI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.localdomain (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id CB12E3F00E; Wed, 17 Apr 2024 01:57:45 +0200 (CEST) From: Marijn Suijten Date: Wed, 17 Apr 2024 01:57:42 +0200 Subject: [PATCH 2/7] drm/msm/dsi: Pass bonded-DSI hdisplay/2 to DSC timing configuration 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: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-2-78ae3ee9a697@somainline.org> References: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> In-Reply-To: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Archit Taneja , Chandan Uddaraju , Vinod Koul , Sravanthi Kollukuduru Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jordan Crouse , Rajesh Yadav , Jeykumar Sankaran , ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten X-Mailer: b4 0.13.0 When configuring the timing of DSI hosts (interfaces) in dsi_timing_setup() all values written to registers are taking bonded DSI into account by dividing the original mode width by 2 (half the data is sent over each of the two DSI hosts), but the full width instead of the interface width is passed as hdisplay parameter to dsi_update_dsc_timing(). Currently only msm_dsc_get_slices_per_intf() is called within dsi_update_dsc_timing() with the `hdisplay` argument which clearly documents that it wants the width of a single interface (which, again, in bonded DSI mode is half the total width of the mode). Thus pass the bonded-mode-adjusted hdisplay parameter into dsi_update_dsc_timing() otherwise all values written to registers by this function (i.e. the number of slices per interface or packet, and derived from this the EOL byte number) are twice too large. Inversely the panel driver is expected to only set the slice width and number of slices for half the panel, i.e. what will be sent by each host individually, rather than fixing that up like hdisplay here. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Marijn Suijten --- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index c80be74cf10b..9d0c940dcb28 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -987,7 +987,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) if (msm_host->mode_flags & MIPI_DSI_MODE_VIDEO) { if (msm_host->dsc) - dsi_update_dsc_timing(msm_host, false, mode->hdisplay); + dsi_update_dsc_timing(msm_host, false, hdisplay); dsi_write(msm_host, REG_DSI_ACTIVE_H, DSI_ACTIVE_H_START(ha_start) | @@ -1008,7 +1008,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) DSI_ACTIVE_VSYNC_VPOS_END(vs_end)); } else { /* command mode */ if (msm_host->dsc) - dsi_update_dsc_timing(msm_host, true, mode->hdisplay); + dsi_update_dsc_timing(msm_host, true, hdisplay); /* image data and 1 byte write_memory_start cmd */ if (!msm_host->dsc) -- 2.44.0