Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2216476lqt; Mon, 22 Apr 2024 05:09:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWRH3SHrqOvJLBb7g0JCVvyIPuPlCNExGblHz/IAYry1z5ywmJP7oMUrR1TKgNlZpZq5Ocbiq+ffluDpwRJBKKCOnCkVK/tFCrmeMgNdQ== X-Google-Smtp-Source: AGHT+IF45g6sgJX+ceX8LqTGYwpmNbcFM9vLHfbg5nw6eKju/eJkuqeEgkrATiZONitwRa8mwK9d X-Received: by 2002:a17:903:292:b0:1e3:f923:e257 with SMTP id j18-20020a170903029200b001e3f923e257mr11198332plr.49.1713787776601; Mon, 22 Apr 2024 05:09:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713787776; cv=pass; d=google.com; s=arc-20160816; b=eyT/ZcVdBmHd9Fi/fX3XLxhbO3njMvKkIO1Gy+7939vuRIoyX+LpsOo7OqjXZSx+7o Srg+kSd+OSA3iUkYWUVMBfR5Db5y5iF+8+pcPZdZ+Gf4iMtU4GX5Z8rrgTuwFzvUuYQy tyhRrtQrgpTR8ZxNWi+HwplHW2ZGruEaecJo31NkF7U6EK/Pa0Gcnc7CDOjg3HymKi9m 9RvgnZOMqf7jlMdrd/XO7xoCUhqYMmM/TMKv3+8G0esu4GhS7vcnO7Wp3GRnWHlY+cSj x2ph5AvNGKGnqzbWNAz6WAyzRGb/gA3eeE888aPd72gA8VDs8CCvSnEWpkvuIjNoSGl3 8ngQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=nSYUfPUp3aHKYRSJHW3nsNdjnok3doEHFDPHNf1mUD8=; fh=MxmU+eagbcdwUiHD6lfd6gV+8lblvpDBNSoglHfGmCU=; b=LeT6f3vMHzrWpXBeKjJMtYhlX2pKgnfhZ2oM+Rp9JTGMM/IY3Hi8lgt9rxIbPGdDGV G874C7jeEx/j8mycOa3iEsdYqnC0uBztX7hmz/aNYQKaobILOcRwgjDF2fUKtXH9i/aD ccn75P4CUypTidipyFFQFzW/MYwJMO09rgQl78+7ysbiZ/FbQYtD5gNqixekqG/4PyxG wP3ZQnjJdFjwBdF/fPopw5qqt7lsoonaEFg1BDOUw/dPnaehAzCzVkKRgrAjcWo2yVXS xXlWS6yDr/+sW3/k8My100PQREsuTmwal1eJAujDduREt2WVyPN/VtPXQHOUbMKafpQV 57Cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aF1On4wJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-153321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153321-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l9-20020a170903120900b001e155021792si8028543plh.250.2024.04.22.05.09.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 05:09:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153321-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aF1On4wJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-153321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153321-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 C2DB6285B42 for ; Mon, 22 Apr 2024 12:09:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4962A1474A2; Mon, 22 Apr 2024 12:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aF1On4wJ" Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 0A23D524A0 for ; Mon, 22 Apr 2024 12:09:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713787768; cv=none; b=E03xsOpF470MKatZbWlxh685g0+KotTjhDJCVf37YQCl0FBpWYTCI0t0TCo6ExmVEBGwTZUM9uY6Otrbpn/pBMBG+JKCpExrRb+FaPghFUlaxtzIEHjHoAf7ztMzMBAJW1E1+lgAXXWsGxNoJ3JRG9y7/NIjSDcqX6UvDFicfZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713787768; c=relaxed/simple; bh=WZRTcgqw3YTcygUtLPr4jfj6baJcqU+HSij9Lwa5pnM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=kN4WqnALlMNRZicgukemOebNOoama3fofJQDur7y9omAZR4tO2bN54/kmAfI/z6D5kqX8hIXrw48wU2z2ulcBUR3sSmunNvYvTf9u2+hELg6xF1HptKHZr0cePTEv4VUY5DjBYIW8BFvBLOpDft5SdZc3N44kbkRr9OyWe2en5M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aF1On4wJ; arc=none smtp.client-ip=209.85.215.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-60275a82611so66982a12.1 for ; Mon, 22 Apr 2024 05:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713787766; x=1714392566; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nSYUfPUp3aHKYRSJHW3nsNdjnok3doEHFDPHNf1mUD8=; b=aF1On4wJU0oLdaJJyInKwREEYMe59LFs56L7FN+ogga2YJ+vUDz2U7OjCfn/rG4rxW E6XeTCGGh18cl89tVPRGXFBl6rbkvcwPyJRuvGuzM0fwOjnSNPaEryM18UWtiEqBZZZE AirfZRj6mJnORBRTrwkoT4yVFDDrYA4rdkhnV5Jjkad4F4Pp6ubKlTuKbjRmiULsKJ6c bWyfTYIxw8EuHI/b/sykY6RY6Nzc/2J/CxodmolPVWqSCEYcRlpA61WErI5A8jPlBm7Z YpD+bJVNb0yZ02i4HB06yszhW877cNCtPR+PU0SX73axi5P3OSG3V6cj0bKj1UuX9Rg+ gwuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713787766; x=1714392566; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nSYUfPUp3aHKYRSJHW3nsNdjnok3doEHFDPHNf1mUD8=; b=MFuNrM6cOavbGU/cE+dEFxOM8sfHiAnGQrJ3W8y+NRqx4eP5p3DW2Xo+LLXVvJgZYC hjJXrOzUlFcTdHbGQfylCe7wyfcWFIJ81PBhJzBuh1a/SahvA/r/XaTuLpz2PcWXGn+r PM4Dw33Rtwvaes69VYw0ee5Zu3kn9eEDKQ4qAvUNhJPZ1YaJf1L54zgT4xHE5cQ1QTd3 8YOk76+CQy2DZWGqyUxunxw4MNO0lZ0nPCbaFFedTQt7Zgxw2l/eruQmLLriELCB9Mdp 0R0epWls3fW/E5vmxPIvAA4KYSUQaBfq41V8SsQ+oZHGnjsx+FdzCSRe3DP+oyXWfh6G Afxg== X-Forwarded-Encrypted: i=1; AJvYcCWllIEPZpQsBqixpAwG8sAK3/5hzMQEaDEvEUmRMKyR+qN+gc3WfevfEt9xXB1RMpEavIhLe0tlRP0DQ0aC0pUkxteY4EmNo0NSmROi X-Gm-Message-State: AOJu0YyHNPJcC9u8lhX+VegPUl5G49woCIjxGzsSqgIz3FmdN9bu2XIB srOlVSZt3g6Ox0G1Yq43PCIKMmkDAYDgi4HbFSHfF+xjMRrSUgDN5IcozuVZb9tqfzbaLRL5wSO xvzx3al3KYUgF7CPeY7b1QlhRwHI= X-Received: by 2002:a17:90b:384d:b0:2ae:5bdb:1960 with SMTP id nl13-20020a17090b384d00b002ae5bdb1960mr550537pjb.3.1713787765992; Mon, 22 Apr 2024 05:09:25 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240211230931.188194-1-aford173@gmail.com> <20240211230931.188194-2-aford173@gmail.com> <6111fe04-4ecb-428e-9a0c-dc02cadfe3e7@denx.de> In-Reply-To: <6111fe04-4ecb-428e-9a0c-dc02cadfe3e7@denx.de> From: Adam Ford Date: Mon, 22 Apr 2024 07:09:13 -0500 Message-ID: Subject: Re: [PATCH V2 2/2] drm/bridge: samsung-dsim: Fix porch calcalcuation rounding To: Marek Vasut Cc: dri-devel@lists.freedesktop.org, aford@beaconembedded.com, Frieder Schrempf , Inki Dae , Jagan Teki , Marek Szyprowski , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Marco Felsch , Michael Tretter , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 21, 2024 at 9:36=E2=80=AFAM Marek Vasut wrote: > > On 2/12/24 12:09 AM, Adam Ford wrote: > > When using video sync pulses, the HFP, HBP, and HSA are divided between > > the available lanes if there is more than one lane. For certain > > timings and lane configurations, the HFP may not be evenly divisible. > > If the HFP is rounded down, it ends up being too small which can cause > > some monitors to not sync properly. In these instances, adjust htotal > > and hsync to round the HFP up, and recalculate the htotal. > > > > Tested-by: Frieder Schrempf # Kontron BL = i.MX8MM with HDMI monitor > > Signed-off-by: Adam Ford > > --- > > V2: No changes > > > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/br= idge/samsung-dsim.c > > index 8476650c477c..52939211fe93 100644 > > --- a/drivers/gpu/drm/bridge/samsung-dsim.c > > +++ b/drivers/gpu/drm/bridge/samsung-dsim.c > > @@ -1606,6 +1606,27 @@ static int samsung_dsim_atomic_check(struct drm_= bridge *bridge, > > adjusted_mode->flags |=3D (DRM_MODE_FLAG_PHSYNC | DRM_MOD= E_FLAG_PVSYNC); > > } > > > > + /* > > + * When using video sync pulses, the HFP, HBP, and HSA are divide= d between > > + * the available lanes if there is more than one lane. For certa= in > > + * timings and lane configurations, the HFP may not be evenly div= isible. > > + * If the HFP is rounded down, it ends up being too small which c= an cause > > + * some monitors to not sync properly. In these instances, adjust= htotal > > + * and hsync to round the HFP up, and recalculate the htotal. Thr= ough trial > > + * and error, it appears that the HBP and HSA do not appearto nee= d the same > > + * correction that HFP does. > > + */ > > + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE && dsi->lane= s > 1) { > > Does this also apply to mode with sync events (I suspect it does), so > the condition here should likely be if (!...burst mode) , right ? Thanks for the review! I was only able to test it with the DSI->ADV6535 bridge, and I'll admit I don't know a lot about DSI interface since I don't have a copy of the spec to read. Are you proposing this should be: if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) && dsi->lanes > 1) { I just want to make sure I understand what you're requesting. thanks adam