From: Thomas Zimmermann <tzimmermann@suse.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: freedreno@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org,
linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
javierm@redhat.com, dri-devel@lists.freedesktop.org,
linux-tegra@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 10/10] drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info'
Date: Tue, 24 Jan 2023 12:27:54 +0100 [thread overview]
Message-ID: <3f76ab52-a323-beeb-7653-7cae2e7090e0@suse.de> (raw)
In-Reply-To: <Y87zMk0sJc6EOG/6@ravnborg.org>
[-- Attachment #1.1: Type: text/plain, Size: 4724 bytes --]
Hi
Am 23.01.23 um 21:50 schrieb Sam Ravnborg:
> Hi Thomas,
>
> a quick drive-by comment.
>
> On Mon, Jan 23, 2023 at 11:05:59AM +0100, Thomas Zimmermann wrote:
>> The generic fbdev emulation names variables of type struct fb_info
>> both 'fbi' and 'info'. The latter seems to be more common in fbdev
>> code, so name fbi accordingly.
>>
>> Also replace the duplicate variable in drm_fbdev_fb_destroy().
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>> drivers/gpu/drm/drm_fbdev_generic.c | 49 ++++++++++++++---------------
>> 1 file changed, 24 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
>> index 49a0bba86ce7..7633da5c13c3 100644
>> --- a/drivers/gpu/drm/drm_fbdev_generic.c
>> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
>> @@ -46,17 +46,16 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)
>> static void drm_fbdev_fb_destroy(struct fb_info *info)
>> {
>> struct drm_fb_helper *fb_helper = info->par;
>> - struct fb_info *fbi = fb_helper->info;
>> void *shadow = NULL;
>>
>> if (!fb_helper->dev)
>> return;
>>
>> - if (fbi) {
>> - if (fbi->fbdefio)
>> - fb_deferred_io_cleanup(fbi);
>> + if (info) {
> As info is already used above to find fb_helper, this check is
> redundant.
Oh indeed; will fix. This change belongs to patch 8, which streamlines
the cleanup a bit.
Best regards
Thomas
>
> Sam
>
>> + if (info->fbdefio)
>> + fb_deferred_io_cleanup(info);
>> if (drm_fbdev_use_shadow_fb(fb_helper))
>> - shadow = fbi->screen_buffer;
>> + shadow = info->screen_buffer;
>> }
>>
>> drm_fb_helper_fini(fb_helper);
>> @@ -173,7 +172,7 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper,
>> struct drm_device *dev = fb_helper->dev;
>> struct drm_client_buffer *buffer;
>> struct drm_framebuffer *fb;
>> - struct fb_info *fbi;
>> + struct fb_info *info;
>> u32 format;
>> struct iosys_map map;
>> int ret;
>> @@ -192,35 +191,35 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper,
>> fb_helper->fb = buffer->fb;
>> fb = buffer->fb;
>>
>> - fbi = drm_fb_helper_alloc_info(fb_helper);
>> - if (IS_ERR(fbi))
>> - return PTR_ERR(fbi);
>> + info = drm_fb_helper_alloc_info(fb_helper);
>> + if (IS_ERR(info))
>> + return PTR_ERR(info);
>>
>> - fbi->fbops = &drm_fbdev_fb_ops;
>> - fbi->screen_size = sizes->surface_height * fb->pitches[0];
>> - fbi->fix.smem_len = fbi->screen_size;
>> - fbi->flags = FBINFO_DEFAULT;
>> + info->fbops = &drm_fbdev_fb_ops;
>> + info->screen_size = sizes->surface_height * fb->pitches[0];
>> + info->fix.smem_len = info->screen_size;
>> + info->flags = FBINFO_DEFAULT;
>>
>> - drm_fb_helper_fill_info(fbi, fb_helper, sizes);
>> + drm_fb_helper_fill_info(info, fb_helper, sizes);
>>
>> if (drm_fbdev_use_shadow_fb(fb_helper)) {
>> - fbi->screen_buffer = vzalloc(fbi->screen_size);
>> - if (!fbi->screen_buffer)
>> + info->screen_buffer = vzalloc(info->screen_size);
>> + if (!info->screen_buffer)
>> return -ENOMEM;
>> - fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
>> + info->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
>>
>> - fbi->fbdefio = &drm_fbdev_defio;
>> - fb_deferred_io_init(fbi);
>> + info->fbdefio = &drm_fbdev_defio;
>> + fb_deferred_io_init(info);
>> } else {
>> /* buffer is mapped for HW framebuffer */
>> ret = drm_client_buffer_vmap(fb_helper->buffer, &map);
>> if (ret)
>> return ret;
>> if (map.is_iomem) {
>> - fbi->screen_base = map.vaddr_iomem;
>> + info->screen_base = map.vaddr_iomem;
>> } else {
>> - fbi->screen_buffer = map.vaddr;
>> - fbi->flags |= FBINFO_VIRTFB;
>> + info->screen_buffer = map.vaddr;
>> + info->flags |= FBINFO_VIRTFB;
>> }
>>
>> /*
>> @@ -229,10 +228,10 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper,
>> * case.
>> */
>> #if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM)
>> - if (fb_helper->hint_leak_smem_start && fbi->fix.smem_start == 0 &&
>> + if (fb_helper->hint_leak_smem_start && info->fix.smem_start == 0 &&
>> !drm_WARN_ON_ONCE(dev, map.is_iomem))
>> - fbi->fix.smem_start =
>> - page_to_phys(virt_to_page(fbi->screen_buffer));
>> + info->fix.smem_start =
>> + page_to_phys(virt_to_page(info->screen_buffer));
>> #endif
>> }
>>
>> --
>> 2.39.0
--
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 --]
prev parent reply other threads:[~2023-01-24 11:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 10:05 [PATCH 00/10] drm/fb-helper: Various cleanups Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 01/10] drm/client: Test for connectors before sending hotplug event Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 02/10] drm/client: Add hotplug_failed flag Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 03/10] drm/fb-helper: Introduce drm_fb_helper_unprepare() Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 04/10] drm/fbdev-generic: Initialize fb-helper structure in generic setup Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 05/10] drm/fb-helper: Remove preferred_bpp parameter from fbdev internals Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 06/10] drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 07/10] drm/fbdev-generic: Minimize hotplug error handling Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 08/10] drm/fbdev-generic: Minimize client unregistering Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 09/10] drm/fbdev-generic: Inline clean-up helpers into drm_fbdev_fb_destroy() Thomas Zimmermann
2023-01-23 10:05 ` [PATCH 10/10] drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info' Thomas Zimmermann
2023-01-23 20:50 ` Sam Ravnborg
2023-01-24 11:27 ` Thomas Zimmermann [this message]
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=3f76ab52-a323-beeb-7653-7cae2e7090e0@suse.de \
--to=tzimmermann@suse.de \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=sam@ravnborg.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