From: Jani Nikula <jani.nikula@intel.com>
To: "Noralf Trønnes" <noralf@tronnes.org>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 02/13] drm/fb-helper: don't preserve fb_ops across deferred IO use
Date: Thu, 28 Nov 2019 12:05:22 +0000 [thread overview]
Message-ID: <87lfs0mcjh.fsf@intel.com> (raw)
In-Reply-To: <f8292d00-5d62-cd3c-9d17-37a3feebd74b@tronnes.org>
On Thu, 28 Nov 2019, Noralf Trønnes <noralf@tronnes.org> wrote:
> Den 27.11.2019 17.31, skrev Jani Nikula:
>> Deferred IO now preserves the fb_ops.
>>
>> Cc: Noralf Trønnes <noralf@tronnes.org>
>> Cc: dri-devel@lists.freedesktop.org
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/drm_fb_helper.c | 18 ++----------------
>> 1 file changed, 2 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index 0c088ea70ad0..a5a2a538d085 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)
>> static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)
>> {
>> struct fb_info *fbi = fb_helper->fbdev;
>> - struct fb_ops *fbops = NULL;
>> void *shadow = NULL;
>>
>> if (!fb_helper->dev)
>> @@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)
>> if (fbi && fbi->fbdefio) {
>> fb_deferred_io_cleanup(fbi);
>> shadow = fbi->screen_buffer;
>> - fbops = fbi->fbops;
>> }
>>
>> drm_fb_helper_fini(fb_helper);
>>
>> - if (shadow) {
>> - vfree(shadow);
>> - kfree(fbops);
>> - }
>> + vfree(shadow);
>>
>> drm_client_framebuffer_delete(fb_helper->buffer);
>> }
>> @@ -2062,23 +2057,14 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
>> drm_fb_helper_fill_info(fbi, fb_helper, sizes);
>>
>> if (drm_fbdev_use_shadow_fb(fb_helper)) {
>> - struct fb_ops *fbops;
>> void *shadow;
>>
>> - /*
>> - * fb_deferred_io_cleanup() clears &fbops->fb_mmap so a per
>> - * instance version is necessary.
>> - */
>> - fbops = kzalloc(sizeof(*fbops), GFP_KERNEL);
>> shadow = vzalloc(fbi->screen_size);
>> - if (!fbops || !shadow) {
>> - kfree(fbops);
>> + if (!shadow) {
>> vfree(shadow);
>
> This vfree can is a no-op now and can be dropped. With that:
D'oh!
With that I think I'd also drop the shadow local variable and assign to
fbi->screen_buffer directly. Fine with that?
Thanks.
BR,
Jani.
>
> Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
>
>> return -ENOMEM;
>> }
>>
>> - *fbops = *fbi->fbops;
>> - fbi->fbops = fbops;
>> fbi->screen_buffer = shadow;
>> fbi->fbdefio = &drm_fbdev_defio;
>>
>>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2019-11-28 12:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 16:31 [PATCH 00/13] video, drm: constify fbops in struct fb_info Jani Nikula
2019-11-27 16:31 ` [PATCH 01/13] video: fb_defio: preserve user fb_ops Jani Nikula
2019-11-27 17:01 ` Ville Syrjälä
2019-11-27 18:09 ` [Intel-gfx] " Daniel Vetter
2019-11-27 18:17 ` Daniel Vetter
2019-11-27 18:21 ` Daniel Vetter
2019-11-28 9:09 ` Jani Nikula
2019-11-28 10:05 ` Daniel Vetter
2019-11-28 10:08 ` Daniel Vetter
2019-11-28 10:34 ` Jani Nikula
2019-11-27 16:31 ` [PATCH 02/13] drm/fb-helper: don't preserve fb_ops across deferred IO use Jani Nikula
2019-11-27 18:18 ` [Intel-gfx] " Daniel Vetter
2019-11-28 11:31 ` Noralf Trønnes
2019-11-28 12:05 ` Jani Nikula [this message]
2019-11-28 14:03 ` [Intel-gfx] " Noralf Trønnes
2019-11-27 16:31 ` [PATCH 03/13] video: smscufx: don't restore fb_mmap after deferred IO cleanup Jani Nikula
2019-11-27 18:20 ` [Intel-gfx] " Daniel Vetter
2019-11-27 16:32 ` [PATCH 04/13] video: udlfb: " Jani Nikula
2019-11-27 18:22 ` Daniel Vetter
2019-11-27 16:32 ` [PATCH 05/13] video: fbdev: vesafb: modify the static fb_ops directly Jani Nikula
2019-11-27 18:23 ` Daniel Vetter
2019-11-27 16:32 ` [PATCH 06/13] video: fbmem: use const pointer for fb_ops Jani Nikula
2019-11-27 16:32 ` [PATCH 07/13] video: omapfb: " Jani Nikula
2019-11-27 16:32 ` [PATCH 08/13] video: fbdev: make fbops member of struct fb_info a const pointer Jani Nikula
2019-11-28 9:36 ` kbuild test robot
2019-11-28 10:46 ` kbuild test robot
2019-11-27 16:32 ` [PATCH 09/13] drm: constify fb ops across all drivers Jani Nikula
2019-11-27 16:32 ` [PATCH 10/13] video: " Jani Nikula
2019-11-27 16:32 ` [PATCH 11/13] HID: picoLCD: constify fb ops Jani Nikula
2019-11-27 16:32 ` [PATCH 12/13] media: constify fb ops across all drivers Jani Nikula
2019-11-27 16:32 ` [PATCH 13/13] samples: vfio-mdev: constify fb ops Jani Nikula
2019-11-27 18:29 ` Daniel Vetter
2019-11-28 9:22 ` Jani Nikula
2019-11-28 10:11 ` Daniel Vetter
2019-11-28 8:31 ` Christophe de Dinechin
2019-11-28 10:35 ` Jani Nikula
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=87lfs0mcjh.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=noralf@tronnes.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;
as well as URLs for NNTP newsgroup(s).