From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
linux-kernel@vger.kernel.org
Cc: David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [RFC PATCH v4 02/11] drm/fb-helper: Set FBINFO_MISC_FIRMWARE flag for DRIVER_FIRMWARE fb
Date: Fri, 29 Apr 2022 12:20:11 +0200 [thread overview]
Message-ID: <82dc11b4-d8da-e9e9-8181-5695fbd806de@suse.de> (raw)
In-Reply-To: <476d57e5-69dd-94b5-779f-230e091ae62f@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 3232 bytes --]
Hi Javier
Am 29.04.22 um 11:23 schrieb Javier Martinez Canillas:
> Hello Thomas,
>
> On 4/29/22 11:14, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 29.04.22 um 10:42 schrieb Javier Martinez Canillas:
>>> The DRIVER_FIRMWARE flag denotes that a DRM driver uses a framebuffer
>>> that was initialized and provided by the system firmware for scanout.
>>>
>>> Indicate to the fbdev subsystem that the registered framebuffer is a
>>> FBINFO_MISC_FIRMWARE, so that it can handle accordingly. For example,
>>> wold hot-unplug the associated device if asked to remove conflicting
>>> framebuffers.
>>>
>>> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>>> ---
>>>
>>> (no changes since v1)
>>>
>>> drivers/gpu/drm/drm_fb_helper.c | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>>> index d265a73313c9..76dd11888621 100644
>>> --- a/drivers/gpu/drm/drm_fb_helper.c
>>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>>> @@ -1891,6 +1891,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,
>>> /* don't leak any physical addresses to userspace */
>>> info->flags |= FBINFO_HIDE_SMEM_START;
>>>
>>> + /* Indicate that the framebuffer is provided by the firmware */
>>> + if (drm_core_check_feature(dev, DRIVER_FIRMWARE))
>>> + info->flags |= FBINFO_MISC_FIRMWARE;
>>> +
>>
>> Patches 1 to 3 should be squashed into one before landing.
>>
>
> I actually considered this but then decided to go with the each change
> goes into its own patch approach. But I'll squash it in next revisions.
>
>> We can do this with DRIVER_FIRMWARE. Alternatively, I'd suggest to we
>> could also used the existing final parameter of
>> drm_fbdev_generic_setup() to pass a flag that designates a firmware device.
>>
>
> By existing final parameter you mean @preferred_bpp ? That doesn't seem
> correct. I also like that by using DRIVER_FIRMWARE it is completely data
> driven and transparent to the DRM driver.
DRIVER_FIRMWARE is an indirection and only used here. (Just like
FBINFO_MISC_FIRMWARE is a bad interface for marking framebuffers that
can be unplugged.) If a driver supports hot-unplugging, it should simply
register itself with aperture helpers, regardless of whether it's a
firmware framebuffer or not.
Of preferred_bpp, we really only use the lowest byte. All other bits are
up for grabbing. The argument is a workaround for handling
mode_config.prefered_depth correctly.
Eventually, preferred_depth should be replaced by something like
'preferred_format', which will hold the driver's preferred format in
4CC. We won't need preferred_bpp then. So we could turn preferred_bpp
into a flags argument.
Best regards
Thomas
>
> Or do you envision a case where a driver would be DRIVER_FIRMWARE but we
> wouldn't want the emulated fbdev to also be FBINFO_MISC_FIRMWARE ?
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2022-04-29 10:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 8:42 [RFC PATCH v4 00/11] Fix some race between sysfb device registration and drivers probe Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 01/11] drm: Add a capability flag for simple framebuffer drivers Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 02/11] drm/fb-helper: Set FBINFO_MISC_FIRMWARE flag for DRIVER_FIRMWARE fb Javier Martinez Canillas
2022-04-29 9:14 ` Thomas Zimmermann
2022-04-29 9:23 ` Javier Martinez Canillas
2022-04-29 10:20 ` Thomas Zimmermann [this message]
2022-04-29 10:50 ` Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 03/11] drm/simpledrm: Set the DRM_FIRMWARE capability Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 04/11] firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 05/11] firmware: sysfb: Add helpers to unregister a pdev and disable registration Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 06/11] fbdev: Restart conflicting fb removal loop when unregistering devices Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 07/11] fbdev: Make sysfb to unregister its own registered devices Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 08/11] fbdev: Fix race between sysfb and framebuffer devices registration Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 09/11] drm: Fix race between sysfb and DRM " Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 10/11] Revert "fbdev: Prevent probing generic drivers if a FB is already registered" Javier Martinez Canillas
2022-04-29 8:42 ` [RFC PATCH v4 11/11] fbdev: Make registered_fb[] private to fbmem.c Javier Martinez Canillas
2022-04-29 15:02 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82dc11b4-d8da-e9e9-8181-5695fbd806de@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@linux.ie \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®