From patchwork Wed Oct 2 15:06:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13819914 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 790B3CF6D2D for ; Wed, 2 Oct 2024 15:06:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA0FB10E633; Wed, 2 Oct 2024 15:06:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="F2x940EX"; dkim-atps=neutral Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F9E310E1D5 for ; Wed, 2 Oct 2024 15:06:53 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-37cdac05af9so4398000f8f.0 for ; Wed, 02 Oct 2024 08:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1727881611; x=1728486411; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3wuudxDZwL1ziyHfxVsUQH/I2F8ewPn5gbw+DbZPTKE=; b=F2x940EXglEIbiqIk+00mLfAOnXvp8vt4A/2yiuGRcAgErAaXhlkjVfQF0Pk2zfp1W IQvICGhOTTbKd/ozf6R1ORLuu3mW4Q13lZ05u0I4NeQ/5Y/tVOaq6Z+Wyux3nmHwsYeh Npru29FHpMzf7HHhNMqZcNJYhm32Ja04ADYvXFU2mdF1F65+rctm2S+bK1310TuL7UBu uiqMbfA7OxK8H14VQz0yT2tK7NYRuPoe/mQgRiCKGCi5Xf/vM8L/sx6yCejKhc2DckpF GdzNBPlGCsKy9/VWH1YVh3+2gBtpo76HntV1F6GYVfRVnUX5ReI+tDA2tpf/ET321COi uRVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727881611; x=1728486411; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3wuudxDZwL1ziyHfxVsUQH/I2F8ewPn5gbw+DbZPTKE=; b=hWO5Si/pKBkx6wrMLFTuB3eSA6arN56xcNBXXSF98/fDj/8rxed78ZKc07FpPjXB8q MBEwEx4E5d9H0g4zdXEFGszX4PrtyiPS9hYMX2O1334Tu/keWxpwj/DdGTpWXORrsHcC SsW3XpJUla6pS69c8mHJ1yeI1HaqzPS5cxUgrM4jrhR4rwtIE1LiEmjsAKdmcyOLF33e oXfkGqUM4TUbhmmYFarnJP1gklASHV93Ol16B/cmLXWiuk1+sBRWAK+6iQhZdhMMKgho TbKgSqs2HpY/m1yHPSAeoRdEAFvsV2lxjXFCYtCphFdczaw9/cMXTTQwDLLLCK6JSVIk UjVg== X-Gm-Message-State: AOJu0YwHRlMvOZDHX9VjZp2tqUEOV+fvZwMGqNB3+jUr40WlCpa4L9R5 mTIVhUAXk+QLi++Ek7iTKVBLQom/JgWl5EffQTht3mVioSRugbrouxI1FU8zFTU= X-Google-Smtp-Source: AGHT+IHWOP5x5OgGMlJLFrprCPz4xB9T/rqwZqubCZ2Ex7qOQhyYFFIozvlL0zfFLPyvvUeHBp07Mw== X-Received: by 2002:a5d:64a5:0:b0:37c:d53a:612e with SMTP id ffacd0b85a97d-37cfba189d3mr2738282f8f.51.1727881611322; Wed, 02 Oct 2024 08:06:51 -0700 (PDT) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42f79ec0a44sm20794485e9.17.2024.10.02.08.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:06:49 -0700 (PDT) From: Dave Stevenson Date: Wed, 02 Oct 2024 16:06:19 +0100 Subject: [PATCH 1/2] drm/vc4: Run default client setup for all variants. MIME-Version: 1.0 Message-Id: <20241002-vc4_fbdev_fix-v1-1-8737bd11b147@raspberrypi.com> References: <20241002-vc4_fbdev_fix-v1-0-8737bd11b147@raspberrypi.com> In-Reply-To: <20241002-vc4_fbdev_fix-v1-0-8737bd11b147@raspberrypi.com> To: Maxime Ripard , Raspberry Pi Kernel Maintenance , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Javier Martinez Canillas Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dave Stevenson X-Mailer: b4 0.14.1 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" Commit 45903624e9fc ("drm/vc4: Run DRM default client setup") only added DRM_FBDEV_DMA_DRIVER_OPS for the vc4 (Pi0-3) driver definition, which caused an issue on vc5 (Pi4) as there was no fbdev_probe function defined. Fixes: 45903624e9fc ("drm/vc4: Run DRM default client setup") Signed-off-by: Dave Stevenson --- drivers/gpu/drm/vc4/vc4_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 13a1ecddbca3..a238f76a6073 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -238,6 +238,7 @@ const struct drm_driver vc5_drm_driver = { #endif DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE(vc5_dumb_create), + DRM_FBDEV_DMA_DRIVER_OPS, .fops = &vc4_drm_fops, From patchwork Wed Oct 2 15:06:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13819915 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 39EEACF6D28 for ; Wed, 2 Oct 2024 15:06:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B5A8710E1D5; Wed, 2 Oct 2024 15:06:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="V4vWLW1E"; dkim-atps=neutral Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id E50A410E1D5 for ; Wed, 2 Oct 2024 15:06:54 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5398d171fa2so4641870e87.0 for ; Wed, 02 Oct 2024 08:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1727881613; x=1728486413; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0aaSKJint9BKAl1EBaxoQ2jVgmDuzxX5hASejfL2+k4=; b=V4vWLW1EgQA5NXiFtnR8JDCINjnNE2GYqfTSwMm4VT721LNzBrLNK/WVaIQBmUFgMx BeraeO9Zjan0M0kgyJxMDrhbTfSWmdJCT5PIh5vZzvSY/XfXxtUAR/DK9dK7r9ZNPZ53 zQWWgVMT4s+C8mrD3wmcHuXqqqWtlCfO0Zz6iiUFp1QT/ZL8e/vo1oIzyNxaEFc9RtJH ZEZ/hnPS1JY0sWd5SPAlM+fn8JHoMA35IlovVQMYPqbCaSf7p36i4Rv9DfK3VG9q+75z FTZtUMp55ke/ZBEmeZEs/ja3sk7Nx+9MTL0IC56NnI7PnTe883CBiWh0zO3baR2ZNdaj aG1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727881613; x=1728486413; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0aaSKJint9BKAl1EBaxoQ2jVgmDuzxX5hASejfL2+k4=; b=GISGUv3Nn2t1HJgKjzmaKFiN6i0b7Vy9jR1peakG1GoJmIopwEjNyG6n1dOot0mLCo G17puPuAMUFSxV9MO2dEn84J510Tc1hMpoA0E/ZfdtoRRSYGsIechxa/E37OUmbh6/ES eWgVOUKD6ly9vMpPPuZ3ptzw07xERCUCSiUUjSqOvjZU9CUi/g6FPelhB9kdOnR8KB44 7QYpld4tNUSG8t5WDHGqEaoe9bAfCJt59r9fNLtyZ1c1oDYamr/5JhRBdIWBalay3rQs BH5FhhkM37hxvhPX93BI7VKXKovLjODcDc7zPc6IysffAnBJB+ZzX8L1sQaVo+FdS1AD lcWA== X-Gm-Message-State: AOJu0Yz8vGnted61P0LYQSFV/PM29u6kYpJzKM1lSdYW9Js/JMmzmv5F I7br6/6z/FqQ0e3TkbCqxJ5+MAA7rW8AaE2ejnE+fdab9wMzH/30ua2TvXDUga0= X-Google-Smtp-Source: AGHT+IHRN0bivOMkxtd7P9Vwt5ImGLSLuu4E/375FOcRMlxCyc6JCW56eMN/xSM59wtgzA73gEK8MA== X-Received: by 2002:a05:6512:4011:b0:52e:9481:eaa1 with SMTP id 2adb3069b0e04-539a06656cemr2152474e87.23.1727881612849; Wed, 02 Oct 2024 08:06:52 -0700 (PDT) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42f79ec0a44sm20794485e9.17.2024.10.02.08.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:06:52 -0700 (PDT) From: Dave Stevenson Date: Wed, 02 Oct 2024 16:06:20 +0100 Subject: [PATCH 2/2] drm/fbdev: Ensure that one of the probe functions is defined MIME-Version: 1.0 Message-Id: <20241002-vc4_fbdev_fix-v1-2-8737bd11b147@raspberrypi.com> References: <20241002-vc4_fbdev_fix-v1-0-8737bd11b147@raspberrypi.com> In-Reply-To: <20241002-vc4_fbdev_fix-v1-0-8737bd11b147@raspberrypi.com> To: Maxime Ripard , Raspberry Pi Kernel Maintenance , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Javier Martinez Canillas Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dave Stevenson X-Mailer: b4 0.14.1 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" Commit 5d08c44e47b9 ("drm/fbdev: Add memory-agnostic fbdev client") added the newer probe function, but left a path where no probe function was called. fb_helper->fb would then be NULL and the strcpy would throw a NULL pointer exception. Handle that error case. Fixes: 5d08c44e47b9 ("drm/fbdev: Add memory-agnostic fbdev client") Signed-off-by: Dave Stevenson --- drivers/gpu/drm/drm_fb_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index d5e8994345bb..9c8868d7b9d3 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1635,6 +1635,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper) ret = dev->driver->fbdev_probe(fb_helper, &sizes); else if (fb_helper->funcs) ret = fb_helper->funcs->fb_probe(fb_helper, &sizes); + else + ret = -EINVAL; if (ret < 0) return ret;