Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2322270lqb; Mon, 27 May 2024 16:12:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYd8XQ/gsntXGFpSdMeGfi36i/zxiPkca/1MYd1ynqYVTzYQkFfAAazvO8T1rbBWAL2Fsc+ayA/8YZmq6a0lXvcWzB3mMuq8IMWaj1Kg== X-Google-Smtp-Source: AGHT+IFp2bR2WqAVivYX73vtL5vxuDiTnUFBqKF9PbTRGK53LyJfUIgAXypqa3F9uIkw3wt9lf0b X-Received: by 2002:a05:620a:9369:b0:792:bf2e:2e55 with SMTP id af79cd13be357-794ab0f48e7mr1224138985a.47.1716851572870; Mon, 27 May 2024 16:12:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716851572; cv=pass; d=google.com; s=arc-20160816; b=tUxLSyn8UGZvzzJg6P7NU7bwJRpynclSH6RokoRvOAxzNt2fIBlYSs3tHkNAhZO78x r1+TBlLdEKtTeKLBfaDmgMLxQ6n27rsVV5hu2iRO1Gdo3x4Con5wsZpMmHf901YOHpEJ onKqb7CT0mk13Tf+ocRRiVu6bVGfmalNLFFs0rVzp2b0eX9fUXnKJZwa/JOQoZjVnZ0u nDYBTap40yCYPj65AU8JdDSDOQPEYW1Nk3Fhxx3WGuBWvmPjfr09JFoEeUFpnb0pY/9f GSKZg7GwQWQ76Q1A9fHjJt6PRVX81GF+ZJAZ05fk+5zyfGi9EdDnudyHZ2eEKzmqHPQY Lcdg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=NhJB2QVODdUA35I9pFEh6dmBBV56wUfJsZyxgaUD6Yc=; fh=AdaBBPtHq1hJfNUrtRjgwzsBAxIqbSrrY+zblAuuJd4=; b=L+RgVyw8k13ukm6EqXFTokI8hg/v1gRwTnWEtuQ+vjdNqGTxSb6Xfq835MiwZ3t2GY j7Wposu+R7acn3SnRi35x9J42+nevMU7Sqle6foKFv2GG8XCz0TnYEJuxwyE09m0sYHL Yr5VGqni6/eIF4F+CeYmsYtZ3CIPmAxCpyfLrEg47No6FknyNROyQ2dXsOYOAFiX2UgB GhoO7di9nc9Jx4m/v7OmJKZLwoK9mFWuenV7i2ibPIjkhCEeEb5ttRlMEGpAKT1xy093 1wd8YS4Xjq6Q8OVTQx/FqXESzluTOiaEIwCJhYaRJGbzNFKD4hE5AzUdSQVaWtgzWrj6 2URg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@packett.cool header.s=key1 header.b=V+rroTeF; arc=pass (i=1 spf=pass spfdomain=packett.cool dkim=pass dkdomain=packett.cool dmarc=pass fromdomain=packett.cool); spf=pass (google.com: domain of linux-kernel+bounces-191505-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191505-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=packett.cool Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abd142ccsi888292685a.326.2024.05.27.16.12.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 16:12:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191505-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; dkim=pass header.i=@packett.cool header.s=key1 header.b=V+rroTeF; arc=pass (i=1 spf=pass spfdomain=packett.cool dkim=pass dkdomain=packett.cool dmarc=pass fromdomain=packett.cool); spf=pass (google.com: domain of linux-kernel+bounces-191505-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191505-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=packett.cool 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 986501C21129 for ; Mon, 27 May 2024 23:12:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7624167293; Mon, 27 May 2024 23:12:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=packett.cool header.i=@packett.cool header.b="V+rroTeF" Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 81BE713AA37 for ; Mon, 27 May 2024 23:12:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716851566; cv=none; b=iFHMsjCjOc4deeMeOlTxLZsZCxSaUZIgVs8PshkMO8w7ZJ2cx6ZD/3GM82PW55395xmwDGoe1VSf4hg+kvYUNO/UWN7FH8NcSBOSRUUTnGsBofr9WBiJoYdKp2xG7EVpp3JWDx72l3JY8of9Xtq/R7xS+jCppfsTckN6UNWrcp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716851566; c=relaxed/simple; bh=0wmXGrXNl1JIddYv9SZqtoNICb7NDDFn9lXc8+3O4DQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bno0+w8o4ucw2SItynInhv+lpEc9DaPkFrzL2dIIIeQFO/nBRIIZO4LDiSivL73hqNfT2A8V6Uy7VQJB+eikyrD4Pkai2HGj6tP8bC0KWXM6Q1lCP6EgTL83PftqDQATltXiLdz3nRVmcYfNCwneiZguq7DSjnRXKkoCnFV9XZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=packett.cool; spf=pass smtp.mailfrom=packett.cool; dkim=pass (2048-bit key) header.d=packett.cool header.i=@packett.cool header.b=V+rroTeF; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=packett.cool Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=packett.cool X-Envelope-To: heiko@sntech.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=packett.cool; s=key1; t=1716851561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=NhJB2QVODdUA35I9pFEh6dmBBV56wUfJsZyxgaUD6Yc=; b=V+rroTeFfCggIU6g9FhwO+eUXGJJS0N0JEH51ksOYwRUE1xcX8iTW1M2Lz3MLIx3L8gEaE AMkJdPsStaC/7RR4woi4luZbmlVOy+Bd4AktN+ZMXGpthefQM4EVwhH+9IZCpRzwuU+lqQ wLNLgFWNkmVKrPD5uAScrjw0LRhXVUXb1PB2ovRXV7rOqnnUztJ+qUxrBfsrwFt7/g0L4b xLaL860E8FHpdok32JAMsdBjCjIvOUNAi0bqeHaCSFEBNpkapW4pBiZZorrZ+TbEjQx6AW BgB63Xzdtil7TkB9VqkaJG0js7plpSgPDkxcwaQXOsZnkv5QHfUWBKmX35mRdg== X-Envelope-To: val@packett.cool X-Envelope-To: stable@vger.kernel.org X-Envelope-To: hjc@rock-chips.com X-Envelope-To: andy.yan@rock-chips.com X-Envelope-To: maarten.lankhorst@linux.intel.com X-Envelope-To: mripard@kernel.org X-Envelope-To: tzimmermann@suse.de X-Envelope-To: airlied@gmail.com X-Envelope-To: daniel@ffwll.ch X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: linux-arm-kernel@lists.infradead.org X-Envelope-To: linux-rockchip@lists.infradead.org X-Envelope-To: linux-kernel@vger.kernel.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Val Packett To: =?UTF-8?q?Heiko=20St=C3=BCbner?= Cc: Val Packett , 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: [PATCH v3 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank on RK3066 Date: Mon, 27 May 2024 20:11:49 -0300 Message-ID: <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: 8bit X-Migadu-Flow: FLOW_OUT 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. So unless we clear it "between" frames, the RGB output only shows noise instead of the picture. vblank seems to be the most appropriate place to do it, since it indicates exactly that: that the hardware is done with the frame. This seems to be a redundant synchronization mechanism that was removed in later iterations of the VOP hardware block. 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(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 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); + 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); + } + if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending)) drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h index b33e5bdc2..0cf512cc1 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h @@ -122,6 +122,7 @@ struct vop_common { struct vop_reg lut_buffer_index; struct vop_reg gate_en; struct vop_reg mmu_en; + struct vop_reg dma_stop; struct vop_reg out_mode; struct vop_reg standby; }; diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index b9ee02061..9bcb40a64 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -466,6 +466,7 @@ static const struct vop_output rk3066_output = { }; static const struct vop_common rk3066_common = { + .dma_stop = VOP_REG(RK3066_SYS_CTRL0, 0x1, 0), .standby = VOP_REG(RK3066_SYS_CTRL0, 0x1, 1), .out_mode = VOP_REG(RK3066_DSP_CTRL0, 0xf, 0), .cfg_done = VOP_REG(RK3066_REG_CFG_DONE, 0x1, 0), -- 2.45.1