Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp944000lqt; Fri, 19 Apr 2024 15:59:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZz60IErzxT+fjVKATw+QdO+rlbR6abWHdzPHrg5AOq7nDWJTLytNQJEiRs6FIn8XY7AZ7J2DkYAe0t83AspnRweiFVly/vAA8w3/8YA== X-Google-Smtp-Source: AGHT+IH7AO70B0V8dcSE2PJ6B8NEOsIj8qisXgaY33gxpHLt1xqgYRBXDuD16G/fccC6QyROf94q X-Received: by 2002:a17:906:840c:b0:a55:6f32:63b2 with SMTP id n12-20020a170906840c00b00a556f3263b2mr2326499ejx.5.1713567572373; Fri, 19 Apr 2024 15:59:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713567572; cv=pass; d=google.com; s=arc-20160816; b=deVAG1NLZpfaaSpm7s7jRWy97YmgFWIKVfsadsjPvf3cU0J9IMujCEYPsLN7QcmrRp Mw6nrDbL+WGM8/JbruvCBtSHu8qtCYuaObRuxWghP0AT8f1HgsL7Y21j56fSfFmAVBgV 1SpKKtVxKrNcaD3ulkn29HW8uqWJQjrpREdKABCrt1CTJ9wZytzGIqhqvbcwRryRMnnX aahsH1GZ3nIMzVvPp86ZEFlGBWpRzsTdf3Cr5/+Gvz10PKaKIN8gVIsXlGYJZnAhQp23 tu6gHUDAZbYcQCHuePzmwY0nuYhVFXJ/W+HGAjVihspbP8RivdY3K2oGn6dJEsH0KMqT TWGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y/pykJ+iNZaZvxsy5yVJ+QnkNtTRNc8ccYnjEfcauKg=; fh=Nex3uhxrnrOuQxqEZ8uiSoiQh0pIHDk8cDx20805GEU=; b=A9RxZAik7Jd+sSyV27FWcdnUq//Ppc6NjYgXhX8VO/6BBreZPxDB7T4Z/32gWPhoQt /CvE5mflOXIy7EciVRsoIESW2wZGR6+UDbxRQn9tF6ePx25n3Hi2GfJgWePoXhoyQyxr 1i5btLl94Fz528ZE8k4p4J+XEt7b1njARfFGtp+LE1q6bB/r8cbV3XE8kjrbA+0DL4fU AxFe9LOduNxiDXYIToyxQBo6JRM60JMhaDWHsi2hjT+j+sOBB3PYoN6hFgNX9tMY2ES6 Fx1iWiGlTq+hBiD9lS/VMV5DHBITE9F9yqFOSl9gwsE21RRq0AALjo7S9jv9GN5QrTrq tBFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ve1zoOjS; 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-152015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id he17-20020a1709073d9100b00a4a347e0896si2849561ejc.1024.2024.04.19.15.59.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 15:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ve1zoOjS; 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-152015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152015-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E925C1F21AA0 for ; Fri, 19 Apr 2024 22:59:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E19413D63A; Fri, 19 Apr 2024 22:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ve1zoOjS" Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 4EFD813D60C for ; Fri, 19 Apr 2024 22:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713567564; cv=none; b=adKtElXJBT8YteKbRrT/pfNxZ1R1Ik/h5k6xjAuBEr+Ny7P/pHJbJ17OrcMk9oLYiCWR6floO4D9PM3NEiBqXiuOIsM0wK5nmtTO6kJIpVfGUgvo2m7RhgBuEmYtKFmZlFbywJODkvXqGqiA81nEIKs/++Ij4cJVaM7PN9OttJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713567564; c=relaxed/simple; bh=dq66rNJndbQc60lsm/BjaeR3uKnAGkQCnG7ybzMIKnQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZHSdY4SiTDK3U5nZzLG4OA3cVcFrsmsYFpY98O7ZilREcOmoZJmTSm67JIvQbdfiqhsch2CoExh81WjMLjnkGSX4C1b+/sesK6Mr+yh4kJxIc1B2/YKoq5qYNMQjxtAg6tMn0AhHgAZhwyskIA0RuWBECbxwmDkl2b9tYFILM2Y= 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=Ve1zoOjS; arc=none smtp.client-ip=209.85.167.50 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-lf1-f50.google.com with SMTP id 2adb3069b0e04-516db2214e6so3392959e87.1 for ; Fri, 19 Apr 2024 15:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713567559; x=1714172359; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Y/pykJ+iNZaZvxsy5yVJ+QnkNtTRNc8ccYnjEfcauKg=; b=Ve1zoOjSG3xxakg5n72/UVdaXqdwP/tkldZ8KXQqaRdFWEba+Qv990rwKcTqst1Vi0 fSOV4RiX+nixGdu3VrVZC55daDW/HSv7rwz5nJg8eZI8r7q5aa/B4xoICw9xmQLT6rRG /SPWrX1duZIjJaIBNq6Sasge0M7MJZkDFEg6fRQRlXIrrlvdASlzkeSxLqHqCcbLN9d/ B8vSFC7vHBpG6s6bDGUT6BRl2PFngxEzRcDikBiQwCIYEnEwIbDd1M6pK6d39s04Fgce gxvd/vhNZPkouL2ojaxVkpFuW/ZWb0jW4jR7bTl7DRBZNLumNZwSEFsjoXzfZ3x5vCZu kfrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713567559; x=1714172359; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Y/pykJ+iNZaZvxsy5yVJ+QnkNtTRNc8ccYnjEfcauKg=; b=gdntl0wkhvRTwUxK6YfCt1XCwQa9YZhzRHCZaKqg7+uKWxJ33+D36u4auGrTRg7bQq 8LbgC1PNQn+Uc1YYAH1306fU14qQIaOH70QceqRhzI22VPwzIChtEl2tQV3LrIQdC5w/ MII+umsLPXoiwZR3aPHU4Q0dqhqzSkXyX2bZpGfqhcHQDr4OBwu8ZH0evdVcW3n9hipe LftqfhEt0F39wSm0vR1pMm7SjnsL3Jlofa+g6ALMaAlSGiCYxnvCvj2rsqrc6kfGNu9w qgsUhSgBP9RQPiwv1zglb0B5TMcGosarpVqZk40i4o6ff5ZWGehAm/Y/mn5YDaEouacw ItWw== X-Forwarded-Encrypted: i=1; AJvYcCWgmZWEdc8rL3O7Ou1j7IleQIh78k5q7M2okoQWbYOJBft2YKdC4F0OiXCFPXHspmT3FVBc0Z68Z/8H6Z+W6muosDYBQTbHBriC9bcw X-Gm-Message-State: AOJu0Yxcq1UqJvDAPT+xOexIdaWcr6suU0rZr7qdvduHuosAvONkbDJT 8HDMIQiv6TPPBoxgmMUDgy7TNwEiWs3c3S8NyEpz2G+FRbQtLOmuK63cdpiG0zU= X-Received: by 2002:ac2:58cd:0:b0:51a:bdd6:e718 with SMTP id u13-20020ac258cd000000b0051abdd6e718mr1877655lfo.31.1713567559098; Fri, 19 Apr 2024 15:59:19 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::8a5]) by smtp.gmail.com with ESMTPSA id s6-20020a197706000000b00518d7c38cb9sm913814lfc.284.2024.04.19.15.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 15:59:18 -0700 (PDT) Date: Sat, 20 Apr 2024 01:59:16 +0300 From: Dmitry Baryshkov To: Marijn Suijten Cc: Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Archit Taneja , Chandan Uddaraju , Vinod Koul , Sravanthi Kollukuduru , 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 Subject: Re: [PATCH 2/7] drm/msm/dsi: Pass bonded-DSI hdisplay/2 to DSC timing configuration Message-ID: References: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org> <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-2-78ae3ee9a697@somainline.org> <7fqwkryeumkt7zxsec6va7ys22nfs3tr4rrcz323extdz3f6zv@w4uu2lk4uh7v> 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=us-ascii Content-Disposition: inline In-Reply-To: <7fqwkryeumkt7zxsec6va7ys22nfs3tr4rrcz323extdz3f6zv@w4uu2lk4uh7v> On Sat, Apr 20, 2024 at 12:18:39AM +0200, Marijn Suijten wrote: > On 2024-04-17 14:58:25, Dmitry Baryshkov wrote: > > On Wed, 17 Apr 2024 at 02:57, Marijn Suijten > > wrote: > > > > > > 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(-) > > > > Reviewed-by: Dmitry Baryshkov > > Thanks, it seems this patch has already been picked up for 6.10 [1] to test at > least, but I'd advise you to drop it until I resend it in v2, as it no longer > performs as written in the title. Ok, dropping. > > When I wrote this patch in in June 2023, commit efcbd6f9cdeb ("drm/msm/ > dsi: Enable widebus for DSI") from August 2023 wasn't there yet. That patch > updates hdisplay (because it is unused after that point) with the number > of compressed bytes to be sent over each interface, which is effectively > hdisplay (based on slice_count * slice_width, so as explained in the commit > message that corresponds to half the panel width), divided by a compression > ratio of 3 or 6 depending on widebus, thus passing a way too low value into > dsi_update_dsc_timing(). > > As a result this patch regresses the DSC panel on my SM8150 Sony Xperia 1, and > likely also explains why it was quite hard to get the porches "just right" on > the Xperia 1 III with its dual-DSI dual-DSC 4k@120Hz panel (that these patches > are specifically for). > > I'm still thinking of how to best fix that: probably introducing a new separate > local variable, though dsi_update_dsc_timing() only uses it to calculate > the number of slices per interface, which again as written in the commit > description, is currently required to already be for one interface (in other > words, the Xperia 1 with only a single intf sets slice_count=2, but the Xperia 1 > III with 2 bonded DSI interfaces sets slice_count=1). Which means that this is > always equivalent to slice_per_intf = dsc->slice_count. > > Let me know which approach is preferred. > > - Marijn > > [1]: https://gitlab.freedesktop.org/drm/msm/-/merge_requests/110 -- With best wishes Dmitry