From patchwork Thu Jun 20 15:46:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13705738 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43ED1C2BA1A for ; Thu, 20 Jun 2024 15:46:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B03510EA89; Thu, 20 Jun 2024 15:46:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="XPXonM5H"; dkim-atps=neutral Received: from mail-wr1-f100.google.com (mail-wr1-f100.google.com [209.85.221.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id AEF2C10EA82 for ; Thu, 20 Jun 2024 15:46:43 +0000 (UTC) Received: by mail-wr1-f100.google.com with SMTP id ffacd0b85a97d-363826fbcdeso830634f8f.0 for ; Thu, 20 Jun 2024 08:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1718898402; x=1719503202; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4AjgM1lONumiIAH3nlA15QCd+ve3cOFFHpjhMZ1Fplo=; b=XPXonM5HyL6pMBhmjuEE8pjD6yxjx8D0A5nytLWN+27o9dD11HH/QlBXZEHT9oXXp5 UFIjqUEsIW4hmzWh2JBzt6joFwvY4M9VCK8HtE1Qdwlxmyo1v3P4X/RQB3KgpdqscczU efJlSmp/jE8Yaj5iCefrK2iy6YFOeo9lSTQIU1icXEyoxZwlpm4Qyw135BwV2nVGKbNU 1CAvQ1WkNbJ1XuZCi67ykc1UOyfGu7oIItQZKjtkQDtTmY0TE7C49TirWO2ZAY8xw5G/ e6a7LKRE18F56wQMs8JkyKacZ3PYH5L1Z2QLLfEVuCC+m+6BSfXNGifdpmrOKIgRNZyd qB8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718898402; x=1719503202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4AjgM1lONumiIAH3nlA15QCd+ve3cOFFHpjhMZ1Fplo=; b=rbNKRTw72nwPYU1fxYZWKrYyRWc0BdHlX85eLbPAIg/ovAwtzh1rLMafP+e6C03Pdc 79s+IC+SJSsYsAxFTtfE+ddJ8CzhwCtgx1kO6k6ZVlLBHgtv+hSqmXgkW1KHD5IcnPVX mOWg/bN4iGITvwbSQoi5cYPC4WRZBo3gcjNby67lHu6SgGL0e2CTPek+0QNd3wu17S6C AMpVSnmO7p/tXC+ziPGYNM7YOJsLfMxGlbJo7vYKAftNcey3elTWGC9XbqDseaFLlEVZ lAqxtSAg21oINSR+5lqP4957WW6KEGsGuYbPps8ddSyRjnx/ZdSSHGWJdsdqsMZhwexU UWUQ== X-Forwarded-Encrypted: i=1; AJvYcCUs+hd+/ngTt2quLm4/FOtaac2BTrCzDRoTnekmnE86drgc/+A0ZwWZ+JQ8J7ZCGCAuAsiFG7Lg+bBXn2f806l1cD/Uglc0BDOGUrO181Ou X-Gm-Message-State: AOJu0Yx6hqaAFAlkZlWAIMPb5daZvkYarZig9nlAngo42r1A9qZn4CsI oPeQClzcgK2/q9mEVqxf7pD+8hPgRC4ZOkuAUn/+BBq/MR6NsJivnZwdCr+UG5spukXfzgDXFFa hHtKjlNc6MER9D3cEwBF28nF2gUPfBoZA X-Google-Smtp-Source: AGHT+IEHBz/ums/0ewMJU/bFWShLAHuz8MX5XM3NcMHKojCTjWA7ncIaEMn7botiVJhYYKEkIX25AwbhwLDu X-Received: by 2002:a05:6000:1088:b0:360:9708:6820 with SMTP id ffacd0b85a97d-363170ec7f4mr4579894f8f.7.1718898401957; Thu, 20 Jun 2024 08:46:41 -0700 (PDT) Received: from raspberrypi.com ([188.39.149.98]) by smtp-relay.gmail.com with ESMTPS id ffacd0b85a97d-3607bd986a3sm755992f8f.104.2024.06.20.08.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 08:46:41 -0700 (PDT) X-Relaying-Domain: raspberrypi.com From: Dave Stevenson To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Cc: Dave Stevenson Subject: [PATCH 06/31] drm/vc4: Set AXI panic modes for the HVS Date: Thu, 20 Jun 2024 16:46:07 +0100 Message-Id: <20240620154632.4125308-7-dave.stevenson@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620154632.4125308-1-dave.stevenson@raspberrypi.com> References: <20240620154632.4125308-1-dave.stevenson@raspberrypi.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The HVS can change AXI request mode based on how full the COB FIFOs are. Until now the vc4 driver has been relying on the firmware to have set these to sensible values. With HVS channel 2 now being used for live video, change the panic mode for all channels to be explicitly set by the driver, and the same for all channels. Signed-off-by: Dave Stevenson --- drivers/gpu/drm/vc4/vc4_hvs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 04af672caacb..267c9fde7362 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -951,6 +951,17 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) SCALER_DISPCTRL_SCLEIRQ); + /* Set AXI panic mode. + * VC4 panics when < 2 lines in FIFO. + * VC5 panics when less than 1 line in the FIFO. + */ + dispctrl &= ~(SCALER_DISPCTRL_PANIC0_MASK | + SCALER_DISPCTRL_PANIC1_MASK | + SCALER_DISPCTRL_PANIC2_MASK); + dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC0); + dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC1); + dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC2); + /* Set AXI panic mode. * VC4 panics when < 2 lines in FIFO. * VC5 panics when less than 1 line in the FIFO.