From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 AA8371DE2B9 for ; Mon, 6 Jan 2025 14:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736172629; cv=none; b=Oj9rb9ixQBQ32J7+2/pjrxTgcEXmG/IgJQuh0lPMxQ38Necl5Jug1yDrE0EY9eYsQVYvsBA5ooPbHKrCVqcch1HWxWT/Srz7NFaPjpDFkhaSaXw1/wGjEjaIfLYXORvHnNtymM4zaEugsPrLxbbR6xs8ecvHp5lGuzcwDSKWkf0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736172629; c=relaxed/simple; bh=2kVyZ8Xtb5BLmSQ2vVubcNJwbo4Fx5dqIcM28DNGLyE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=o3djhAy/TaqUZbhcxncbCRRCCVtbecAbdl7DeVDZRMapjCMg4lapn1KuQBXV2sT25P5HaLHpSq1OJyNsnWjaWHClYn3v8Dx35rZ17SS1EPgV15rOhsu+kmX9Bdn+bM0pea6QuY9mEBJb2LCr3yKqu895n37fLOCqRL3jrBPSw6A= 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=HelyNMIx; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=WRdPCFNc; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=HelyNMIx; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=WRdPCFNc; arc=none smtp.client-ip=195.135.223.130 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="HelyNMIx"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="WRdPCFNc"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="HelyNMIx"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="WRdPCFNc" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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-out1.suse.de (Postfix) with ESMTPS id AC2852115D; Mon, 6 Jan 2025 14:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736172625; 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=De2f0n7HkbUbWwqJqOqDRVUUeul3Z2c9oNqi2ssPUOc=; b=HelyNMIxaBWze5R7sTCqWKff0Ugd8fwW4o4jcw4+kHsmCDqg4h3sWBAZg/kgy0l0rgaANU CWkCPl5WhsQHSVSBzVEs4/TH2Rj0gAKTmWroZotx+dee6/RENl7EDBOD+6/Z4Xwtr3cHwr 9+RhpzzyrQsBI4+7f4Vb2ynpMQpPYjs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736172625; 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=De2f0n7HkbUbWwqJqOqDRVUUeul3Z2c9oNqi2ssPUOc=; b=WRdPCFNc32Gn4oAdt7BCTIBxOGoaE907HS33bajlGXXejq5rZKFkxdti4EIvXh5Zh70E1F SyzN+X+Gr1UNdGCw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736172625; 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=De2f0n7HkbUbWwqJqOqDRVUUeul3Z2c9oNqi2ssPUOc=; b=HelyNMIxaBWze5R7sTCqWKff0Ugd8fwW4o4jcw4+kHsmCDqg4h3sWBAZg/kgy0l0rgaANU CWkCPl5WhsQHSVSBzVEs4/TH2Rj0gAKTmWroZotx+dee6/RENl7EDBOD+6/Z4Xwtr3cHwr 9+RhpzzyrQsBI4+7f4Vb2ynpMQpPYjs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736172625; 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=De2f0n7HkbUbWwqJqOqDRVUUeul3Z2c9oNqi2ssPUOc=; b=WRdPCFNc32Gn4oAdt7BCTIBxOGoaE907HS33bajlGXXejq5rZKFkxdti4EIvXh5Zh70E1F SyzN+X+Gr1UNdGCw== Received: from imap1.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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 45EC5137DA; Mon, 6 Jan 2025 14:10:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GA1fD1Hke2fPNQAAD6G6ig (envelope-from ); Mon, 06 Jan 2025 14:10:25 +0000 Message-ID: <392f855c-4474-4e12-8bdc-3baf43d34e13@suse.de> Date: Mon, 6 Jan 2025 15:10:24 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 3/4] drm/ls2kbmc: Add support for Loongson-2K BMC display To: Binbin Zhou Cc: Binbin Zhou , Huacai Chen , Lee Jones , Corey Minyard , Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter , Huacai Chen , linux-kernel@vger.kernel.org, openipmi-developer@lists.sourceforge.net, dri-devel@lists.freedesktop.org, Xuerui Wang , loongarch@lists.linux.dev, Chong Qiao References: <4d62076ee560b35c653a9fbced8d03ef3bdb3005.1735550269.git.zhoubinbin@loongson.cn> <3daaaff8-062a-4985-a5bc-8d228314b02e@suse.de> <390c14a5-44fe-4328-bcc4-2aa1384e3ad1@suse.de> Content-Language: en-US From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emlt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kl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[loongson.cn,kernel.org,acm.org,linux.intel.com,gmail.com,ffwll.ch,vger.kernel.org,lists.sourceforge.net,lists.freedesktop.org,xen0n.name,lists.linux.dev]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TAGGED_RCPT(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo] X-Spam-Flag: NO X-Spam-Level: Hi, Thanks for the info. Am 06.01.25 um 08:03 schrieb Binbin Zhou: [...] >> Could you point to the exact call that fails within simpledrm? > If we use simpledrm directly, the following error occurs: > > [ 8.289823] simple-framebuffer simple-framebuffer.0: [drm] *ERROR* > could not acquire memory range [mem 0xe0031200000-0xe00315fffff flags > 0x200]: -16 > [ 8.312681] simple-framebuffer simple-framebuffer.0: probe with > driver simple-framebuffer failed with error -16 > > The reason for the failure: overlapping resources. > > https://elixir.bootlin.com/linux/v6.12.6/source/drivers/video/aperture.c#L175 This error means that there's already an instance of simpledrm bound to the BMC framebuffer. So you already have a working display and some graphics under Linux without the new driver, right? If so, why do you need a new driver that does exactly the same as simpledrm? Best regards Thomas >>> Because although we register the driver in platform form, its memory >>> belongs to pci space and we can see the corresponding pci probe and >>> resource allocation in Patch-1. >> I don't understand. Graphics memory is often located on the PCI bus. >> What is so special about this one? >> >>> Therefore, we need to use aperture_remove_conflicting_pci_devices(). >> So there is already a device that represents the graphics card? That's >> what you'd remove here? If you only add that MFD device, who owns the >> framebuffer? If it's the PCI device from patch 1 ("ls2k-bmc"), why does >> aperture_remove_conflicting_pci_devices() not remove that device? I'm >> somewhat confused, because the logic in your driver mostly looks like it >> binds to a pre-configured framebuffer, but some of the code doesn't. > Perhaps the use of aperture_remove_conflicting_pci_devices() is wrong, > as there is only one display device for the LS2K BMC and there will be > no phase conflict. > > When I tried to use that API before, it was partly due to the error > above, and partly because I referenced that other display drivers via > pci_driver.probe() would have it, just in case I used it, which was > probably the wrong choice. > > The resources for pci bar0 are as follows: > BAR0: e0030000000/SZ_32M > > 0x0 0x600000 0xf00001c 16M 32M > +----+--------------+--------+-----------+---+-----------------+ > | 2M | simpldrm | | IPMI | | video env | > +-----------------------------------------------------------------+ > > The mfd driver registers the ls2kbmc-framebuffer and ls2k-ipmi-si > devices according to the resource allocation shown above. At the same > time, the ls2kbmc drm is bound to the pre-configured “simpldrm” > resource in the above figure, which is passed through the > ls2kbmc-framebuffer driver. In addition, the resolution is read from > “video env” for the time being, and the resolution adaption is planned > to be added later. > >> Best regards Thomas >> >>> Also, since we are using BMC display, the display will be disconnected >>> when BMC reset, at this time we need to push the display data (crtc, >>> connector, etc.) manually as shown in Patch-4. >>> >>> Probably it's not the most suitable way to implement it. >>> >>>> Best regards >>>> Thomas >>>> >>>>> + }, >>>>> + .probe = ls2kbmc_probe, >>>>> + .remove = ls2kbmc_remove, >>>>> +}; >>>>> + >>>>> +module_platform_driver(ls2kbmc_platform_driver); >>>>> + >>>>> +MODULE_DESCRIPTION("DRM driver for Loongson-2K BMC"); >>>>> +MODULE_LICENSE("GPL"); >>>> -- >>>> -- >>>> Thomas Zimmermann >>>> Graphics Driver Developer >>>> SUSE Software Solutions Germany GmbH >>>> Frankenstrasse 146, 90461 Nuernberg, Germany >>>> GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman >>>> HRB 36809 (AG Nuernberg) >>>> >> -- >> -- >> Thomas Zimmermann >> Graphics Driver Developer >> SUSE Software Solutions Germany GmbH >> Frankenstrasse 146, 90461 Nuernberg, Germany >> GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman >> HRB 36809 (AG Nuernberg) >> > > -- > Thanks. > Binbin -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)