From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 627BE3FBB0 for ; Thu, 28 Mar 2024 13:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711632786; cv=none; b=GZKTkNIUlzG96JybjOEV7ZxFXSLzXJG+j3l8lhOhFUUJ71fcPW1QTbJ2ID4VUGQrDgdADCwOxwFUpdN48lvL6eC6So6VSoFT7BTm0wqaoZmbVyXLprJ6s5aHAcq3TFAosh0k+dtNyKf9Xrsetzyv9xH9C+WwVcm4L3zDwaJuWMg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711632786; c=relaxed/simple; bh=0VOtzpy98TzNv5BuOB20s1D/nQBFwVg0RHpkpFtpbD8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OIXqXa9gNRF1CgDdzDwvMtgy0XnbsrNoi44/DMECHNz3snbCW3kDDEkC+UGiu5W+sQf9vaQdy7H6lOXxUrR3CI1CbEknxQtrH5Srfj5otoLCxlIzbVWzKmFlt9b8SWB+k/aUMF3M49w+VhON4s0Dpdp7eXuEaJ8zoodkE8qol0c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=nU601w+V; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=NeVwDz/G; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=nU601w+V; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=NeVwDz/G; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="nU601w+V"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NeVwDz/G"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="nU601w+V"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NeVwDz/G" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8FE112096C; Thu, 28 Mar 2024 13:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711632781; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ij2Otxna5to9v4ar/0Ig3hfIGSPyVYpp2GAwK6pFXjo=; b=nU601w+VZiETEH2DUUyN8B+NOXK2DOFjM7pT0QDYAezrSyT2xtDvuWT8dLZJwqU9yxX1YH oJA12PF8zSozLVgqHSw3Mrw6rtZ6R//iazl8ybyeAXtE+jwEDZvy/OQ4udp9dmofWXS58h de0oa0HRcnsxPQgMV7hdW+6wBTM8a4k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711632781; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ij2Otxna5to9v4ar/0Ig3hfIGSPyVYpp2GAwK6pFXjo=; b=NeVwDz/G52UQg/ByogZOv/vscgDN6XzKAszac/EFVBGZ6RUuvX+H46iVtshHhXZtH6Fg/u QHZywQcMcz3BSkBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711632781; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ij2Otxna5to9v4ar/0Ig3hfIGSPyVYpp2GAwK6pFXjo=; b=nU601w+VZiETEH2DUUyN8B+NOXK2DOFjM7pT0QDYAezrSyT2xtDvuWT8dLZJwqU9yxX1YH oJA12PF8zSozLVgqHSw3Mrw6rtZ6R//iazl8ybyeAXtE+jwEDZvy/OQ4udp9dmofWXS58h de0oa0HRcnsxPQgMV7hdW+6wBTM8a4k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711632781; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ij2Otxna5to9v4ar/0Ig3hfIGSPyVYpp2GAwK6pFXjo=; b=NeVwDz/G52UQg/ByogZOv/vscgDN6XzKAszac/EFVBGZ6RUuvX+H46iVtshHhXZtH6Fg/u QHZywQcMcz3BSkBA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 8C9EE13AF7; Thu, 28 Mar 2024 13:33:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id n0koIIxxBWZ4QAAAn2gu4w (envelope-from ); Thu, 28 Mar 2024 13:33:00 +0000 Message-ID: <9db306b2-b102-4bf5-a120-e1d279269fe9@suse.de> Date: Thu, 28 Mar 2024 14:33:00 +0100 Precedence: bulk X-Mailing-List: linux-m68k@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] arch: Remove struct fb_info from video helpers Content-Language: en-US To: Helge Deller , arnd@arndb.de, javierm@redhat.com, sui.jingfeng@linux.dev Cc: linux-arch@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, sparclinux@vger.kernel.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org, linux-m68k@lists.linux-m68k.org, loongarch@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , "David S. Miller" , Andreas Larsson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" References: <20240327204450.14914-1-tzimmermann@suse.de> <20240327204450.14914-3-tzimmermann@suse.de> From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFi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hxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -4.29 X-Spamd-Result: default: False [-4.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; BAYES_HAM(-3.00)[100.00%]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.995]; RCPT_COUNT_TWELVE(0.00)[26]; FREEMAIL_TO(0.00)[gmx.de,arndb.de,redhat.com,linux.dev]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Spam-Flag: NO Hi Am 28.03.24 um 12:04 schrieb Helge Deller: > On 3/27/24 21:41, Thomas Zimmermann wrote: >> The per-architecture video helpers do not depend on struct fb_info >> or anything else from fbdev. Remove it from the interface and replace >> fb_is_primary_device() with video_is_primary_device(). The new helper > > Since you rename this function, wouldn't something similar to > > device_is_primary_display() >     or > device_is_primary_console() >     or > is_primary_graphics_device() >     or > is_primary_display_device() > > be a better name? The video_ prefix is there to signal that the code is part of the video subsystem. But there's too much code that tried to figure out a default video device. So I actually have different plans for this function. I'd like to replace it with a helper that returns the default device instead of just testing for it. Sample code for x86 is already in vgaarb.c. [1] The function's name would then be video_default_device() and return the appropriate struct device*. video_is_primary device() will be removed. This rename here is the easiest step towards the new helper. Ok? Best regards Thomas [1] https://elixir.bootlin.com/linux/v6.8/source/drivers/pci/vgaarb.c#L559 > > Helge > >> is similar in functionality, but can operate on non-fbdev devices. >> >> Signed-off-by: Thomas Zimmermann >> Cc: "James E.J. Bottomley" >> Cc: Helge Deller >> Cc: "David S. Miller" >> Cc: Andreas Larsson >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: Borislav Petkov >> Cc: Dave Hansen >> Cc: x86@kernel.org >> Cc: "H. Peter Anvin" >> --- >>   arch/parisc/include/asm/fb.h     |  8 +++++--- >>   arch/parisc/video/fbdev.c        |  9 +++++---- >>   arch/sparc/include/asm/fb.h      |  7 ++++--- >>   arch/sparc/video/fbdev.c         | 17 ++++++++--------- >>   arch/x86/include/asm/fb.h        |  8 +++++--- >>   arch/x86/video/fbdev.c           | 18 +++++++----------- >>   drivers/video/fbdev/core/fbcon.c |  2 +- >>   include/asm-generic/fb.h         | 11 ++++++----- >>   8 files changed, 41 insertions(+), 39 deletions(-) >> >> diff --git a/arch/parisc/include/asm/fb.h b/arch/parisc/include/asm/fb.h >> index 658a8a7dc5312..ed2a195a3e762 100644 >> --- a/arch/parisc/include/asm/fb.h >> +++ b/arch/parisc/include/asm/fb.h >> @@ -2,11 +2,13 @@ >>   #ifndef _ASM_FB_H_ >>   #define _ASM_FB_H_ >> >> -struct fb_info; >> +#include >> + >> +struct device; >> >>   #if defined(CONFIG_STI_CORE) >> -int fb_is_primary_device(struct fb_info *info); >> -#define fb_is_primary_device fb_is_primary_device >> +bool video_is_primary_device(struct device *dev); >> +#define video_is_primary_device video_is_primary_device >>   #endif >> >>   #include >> diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/fbdev.c >> index e4f8ac99fc9e0..540fa0c919d59 100644 >> --- a/arch/parisc/video/fbdev.c >> +++ b/arch/parisc/video/fbdev.c >> @@ -5,12 +5,13 @@ >>    * Copyright (C) 2001-2002 Thomas Bogendoerfer >> >>    */ >> >> -#include >>   #include >> >>   #include