Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp101213lqp; Sat, 8 Jun 2024 07:50:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbbRoL+Gf5EN8pek331VL0L36k45o4Jo31N3HJICT6x4B9K1Kljzx7QFYgtfqZm/ogt3KKuZBiF9eIo5tjED3do1+PSmRVNzkDcJ92hw== X-Google-Smtp-Source: AGHT+IGBDqNJNiAriRxb2msRMtYL0fG1q048UYRYKXiVL9/TeCB9WeFzUbCibdiCB57oHKngV78Z X-Received: by 2002:ac8:72d8:0:b0:440:4e60:1b2a with SMTP id d75a77b69052e-4404e6020b0mr48034481cf.15.1717858222281; Sat, 08 Jun 2024 07:50:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717858222; cv=pass; d=google.com; s=arc-20160816; b=cpa8zSNQj1g6s7MlGIgnPj4TUA9GD5QFn5h+slzC15hyvxECskHjZBuMJsIsvsb+oO CXgjBeZ7KzCNxbp1ruAH1krIvg5njLGU2UDwp3/PgFp/SwIM61LFewOqWnceredcEOUn itxJ4hzQ5NEPscxPPEpa40ghJfIIlcPRxQc0bRGakBkRNqYUlqIF/Z9Whq3jZBeDWuPA wjVSO49z09kK/qyLmDJ2Adqh6K9I48by4dFjuVaxgLigJ3sLcFT+QoElyL8O3NA5f7YF dctMVI33PyxKJ0kbBba9dlXmLIy1r+qSsUCgIBAr2J2XK1BCvxYh9y3GDospyEC5R3Xm YXcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=GNQTZv6MwOGoCsjgiDoGfMXfHOySwXHJzPjIUg2VUes=; fh=WHnPnOFSbie62/8JOvm+vboJEYxq4XAZ1eXOYNHld7g=; b=hwLQidU92F6pdrRkYBwPAZEo1TVwi1BQA7XC2B3uBYpoH6aI0I97ai6TifFRjC3r7A 3KFamXJemll+VYT1zgxD0sTagylxNgcojxYlogZ+8LCVdwWElS/QXtr/DIwAy0+uUia4 Q7BZp5ShAb483jAKubRyuUFnVimq2EsZUjAx3svmOYiVn0oE+iKKTCP80wo47MoBSuXC E6pzfUgDHJx9G2bZtM62+YmU/DBM1x2DCSMgaRHwS6sa5EGY+y9H4tv7Ba1klsOR8WYZ LC7PDV6ujJP8iQuVCX0cPmxlmzmcBMUWe0rDQMISf8UNK1Eet097ZlTU7MhF8MqVP6fb 3jpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-207080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207080-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-44038a8731asi64400411cf.209.2024.06.08.07.50.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 07:50:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-207080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207080-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 063901C20A83 for ; Sat, 8 Jun 2024 14:50:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DBE815CD77; Sat, 8 Jun 2024 14:50:15 +0000 (UTC) Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (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 7C88D2557A; Sat, 8 Jun 2024 14:50:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717858214; cv=none; b=scrNWM3W8Q1aL44esjYwgO5TplHuomtBHTce53rQFhcJU7EWAckbQFlFS7PNBkCC3VoklmtHuu6IG1uLNJZld7STXO6BEPVrS7c6Ydxq5k+NrGKge0tHK2sfj637JP7C0o3h/yUZwdDL673KoBSGbxAS0CIjVtxdSlx1ZmmEo40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717858214; c=relaxed/simple; bh=gZ/+8nQSV1aK+OQQ8dc0w8T7Yf+mPiYoo+5hUXsRFpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Do7aNNkW+5XFrdLAR0ZuG8FPnWyS2d5/gqoxwpFnu9jG6zHXR/ufsCb7rSNlxh2wt54KxkmQFbvCIqEFtsmAeT38yMx2rHPsefiZhMJbkMxA1bG81EccMGeifjxzFj9fWLANWyuu8I9AccqmC14IZVrkOkzQoswxnFu6rn6GlIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Received: from [194.95.143.137] (helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFxOB-0000AO-Bf; Sat, 08 Jun 2024 16:49:51 +0200 From: Heiko Stuebner To: Val Packett Cc: stable@vger.kernel.org, Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank on RK3066 Date: Sat, 08 Jun 2024 16:49:50 +0200 Message-ID: <4253237.VLH7GnMWUR@phil> In-Reply-To: References: <20240527231202.23365-1-val@packett.cool> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Am Sonntag, 2. Juni 2024, 05:35:36 CEST schrieb Val Packett: >=20 > On Mon, May 27 2024 at 20:11:49 -03:00:00, Val Packett=20 > wrote: > > The RK3066 VOP sets a dma_stop bit when it's done scanning out a frame > > and needs the driver to acknowledge that by clearing the bit. > >=20 > > So unless we clear it "between" frames, the RGB output only shows=20 > > noise > > instead of the picture. vblank seems to be the most appropriate place=20 > > to > > do it, since it indicates exactly that: that the hardware is done > > with the frame. > >=20 > > This seems to be a redundant synchronization mechanism that was=20 > > removed > > in later iterations of the VOP hardware block. > >=20 > > Fixes: f4a6de8 ("drm: rockchip: vop: add rk3066 vop definitions") > > Cc: stable@vger.kernel.org > > Signed-off-by: Val Packett > > --- > > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 ++++++ > > drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1 + > > drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 + > > 3 files changed, 8 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c=20 > > b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > > index a13473b2d..2731fe2b2 100644 > > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > > @@ -1766,6 +1766,12 @@ static void vop_handle_vblank(struct vop *vop) > > } > > spin_unlock(&drm->event_lock); > >=20 > > + if (VOP_HAS_REG(vop, common, dma_stop)) { > > + spin_lock(&vop->reg_lock); > > + VOP_REG_SET(vop, common, dma_stop, 0); > > + spin_unlock(&vop->reg_lock); > > + } > > + >=20 > Oops=E2=80=A6 so doing it here actually causes deadlocks, unless we also= =20 > change all other reg_lock usages to be spin_lock_irq/spin_unlock_irq. >=20 > Not sure if doing that or going back to v1 would be better. then please go back to v1 (as v4) :-) . I.e. regular spinlock vs. spin_lock_irq will have performance implications and this "feature" is a one-time only thing used only on a more than 10 year old soc, so it really must not affect stuff coming after it. Heiko