From: Daniel Vetter <daniel@ffwll.ch>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: linux-fbdev@vger.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
David Airlie <airlied@linux.ie>,
amd-gfx@lists.freedesktop.org,
virtualization@lists.linux-foundation.org,
Alex Deucher <alexander.deucher@amd.com>,
Thierry Reding <thierry.reding@gmail.com>,
dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
Maxime Ripard <maxime.ripard@bootlin.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 02/12] fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
Date: Fri, 31 Aug 2018 10:56:56 +0200 [thread overview]
Message-ID: <20180831085656.GR21634@phenom.ffwll.local> (raw)
In-Reply-To: <7e3a48e397298b38d7ddc7f45d48226d1f5db3e4.1535656077.git.mirq-linux@rere.qmqm.pl>
On Thu, Aug 30, 2018 at 11:00:05PM +0200, Michał Mirosław wrote:
> Interpret (otherwise-invalid) NULL apertures argument to mean all-memory
> range. This will allow to remove several duplicates of this code from
> drivers in following patches.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> [for v1]
> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>
> ---
> v2: added kerneldoc to corresponding DRM helper
> ---
> drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
> include/drm/drm_fb_helper.h | 10 ++++++++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index 30a18d4c9de4..0df148eb4699 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
> const char *name, bool primary)
> {
> int ret;
> + bool do_free = false;
> +
> + if (!a) {
> + a = alloc_apertures(1);
> + if (!a)
> + return -ENOMEM;
> +
> + a->ranges[0].base = 0;
> + a->ranges[0].size = ~0;
> + do_free = true;
> + }
>
> mutex_lock(®istration_lock);
> ret = do_remove_conflicting_framebuffers(a, name, primary);
> mutex_unlock(®istration_lock);
>
> + if (do_free)
> + kfree(a);
> +
> return ret;
> }
> EXPORT_SYMBOL(remove_conflicting_framebuffers);
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b069433e7fc1..1c1e53abb25d 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -566,6 +566,16 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
>
> #endif
>
> +/**
> + * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers
> + * @a: memory range, users of which are to be removed
> + * @name: requesting driver name
> + * @primary: also kick vga16fb if present
> + *
> + * This function removes framebuffer devices (eg. initialized by firmware)
> + * which use memory range described by @a. If @a is NULL all such devices are
> + * removed.
> + */
This looks like misplaced copypasta. You only need this once I think.
-Daniel
> static inline int
> drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
> const char *name, bool primary)
> --
> 2.18.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2018-08-31 8:56 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-24 17:53 [PATCH 00/13] remove_conflicting_framebuffers() cleanup Michał Mirosław
2017-11-24 17:53 ` [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers() Michał Mirosław
[not found] ` <1738dbed0239bffc886f126fd3091daa39cd14c9.1511544782.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-11-27 10:27 ` Daniel Vetter
2017-11-27 20:52 ` Sudip Mukherjee
2017-11-28 10:22 ` Daniel Vetter
2017-11-28 11:32 ` Greg KH
2017-11-28 12:30 ` Sudip Mukherjee
2017-11-28 13:06 ` Greg KH
2017-11-29 9:56 ` Daniel Vetter
2017-11-30 23:49 ` Sudip Mukherjee
2017-12-01 7:19 ` Daniel Vetter
2017-12-01 14:10 ` Sudip Mukherjee
2017-12-01 14:40 ` Emil Velikov
2017-12-11 21:57 ` Sudip Mukherjee
[not found] ` <cover.1511544782.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-11-24 17:53 ` [PATCH 03/13] drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() Michał Mirosław
2017-11-27 15:27 ` Alex Deucher
2017-11-24 17:53 ` [PATCH 07/13] drm/radeon: " Michał Mirosław
2017-11-27 10:30 ` [PATCH 00/13] remove_conflicting_framebuffers() cleanup Daniel Vetter
[not found] ` <20171127103044.faakzch7ehlkc3or-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-11-27 10:33 ` Thierry Reding
2018-01-03 15:04 ` Bartlomiej Zolnierkiewicz
2018-08-30 21:00 ` [PATCH v2 00/12] " Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 02/12] fbdev: allow apertures == NULL in remove_conflicting_framebuffers() Michał Mirosław
2018-08-31 8:56 ` Daniel Vetter [this message]
[not found] ` <20180831085656.GR21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-08-31 9:01 ` Daniel Vetter
2018-08-30 21:00 ` [PATCH v2 01/12] fbdev: show fbdev number for debugging Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 04/12] drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 03/12] fbdev: add remove_conflicting_pci_framebuffers() Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 05/12] drm/bochs: use simpler remove_conflicting_pci_framebuffers() Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 06/12] drm/cirrus: " Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 08/12] drm/radeon: " Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 07/12] drm/mgag200: " Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 09/12] drm/virtio: " Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 10/12] drm/vc4: use simpler remove_conflicting_framebuffers(NULL) Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 11/12] drm/sun4i: " Michał Mirosław
2018-08-30 21:00 ` [PATCH v2 12/12] drm/tegra: kick out simplefb Michał Mirosław
2018-08-31 9:04 ` [PATCH v2 00/12] remove_conflicting_framebuffers() cleanup Daniel Vetter
[not found] ` <20180831090439.GT21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-08-31 9:07 ` Chris Wilson
2018-09-01 13:45 ` Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 00/13] " Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 02/13] fbdev: allow apertures == NULL in remove_conflicting_framebuffers() Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 01/13] fbdev: show fbdev number for debugging Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 04/13] fbdev: add remove_conflicting_pci_framebuffers() Michał Mirosław
2018-09-03 16:16 ` Daniel Vetter
2018-09-04 15:40 ` kbuild test robot
2018-09-01 14:08 ` [PATCH v3 03/13] fbdev: add kerneldoc do remove_conflicting_framebuffers() Michał Mirosław
[not found] ` <283fef19815b991700b56119d8d5874a2a8da44e.1535810304.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2018-09-05 11:02 ` Paul Menzel
2018-09-01 14:08 ` [PATCH v3 06/13] drm/bochs: use simpler remove_conflicting_pci_framebuffers() Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 05/13] drm/amdgpu: " Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 07/13] drm/cirrus: " Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 08/13] drm/mgag200: " Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 09/13] drm/radeon: " Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 10/13] drm/virtio: " Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 11/13] drm/vc4: use simpler remove_conflicting_framebuffers(NULL) Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 13/13] drm/tegra: kick out simplefb Michał Mirosław
2018-09-01 14:08 ` [PATCH v3 12/13] drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) Michał Mirosław
[not found] ` <cover.1535810304.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2018-09-03 7:43 ` [PATCH v3 00/13] remove_conflicting_framebuffers() cleanup Daniel Vetter
[not found] ` <20180903074315.GB21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-09-03 11:31 ` Bartlomiej Zolnierkiewicz
2018-09-03 16:26 ` Daniel Vetter
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=20180831085656.GR21634@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=thierry.reding@gmail.com \
--cc=virtualization@lists.linux-foundation.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