From: Daniel Vetter <daniel@ffwll.ch>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: luben.tuikov@amd.com, heiko@sntech.de, airlied@linux.ie,
nouveau@lists.freedesktop.org, linus.walleij@linaro.org,
dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk,
melissa.srw@gmail.com, eric@anholt.net, ray.huang@amd.com,
kraxel@redhat.com, sam@ravnborg.org, sumit.semwal@linaro.org,
emil.velikov@collabora.com, robh@kernel.org,
linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com,
lima@lists.freedesktop.org, oleksandr_andrushchenko@epam.com,
krzk@kernel.org, steven.price@arm.com,
linux-rockchip@lists.infradead.org, kgene@kernel.org,
bskeggs@redhat.com, linux+etnaviv@armlinux.org.uk,
spice-devel@lists.freedesktop.org,
alyssa.rosenzweig@collabora.com,
maarten.lankhorst@linux.intel.com, etnaviv@lists.freedesktop.org,
mripard@kernel.org, inki.dae@samsung.com, hdegoede@redhat.com,
christian.gmeiner@gmail.com, xen-devel@lists.xenproject.org,
virtualization@lists.linux-foundation.org, sean@poorly.run,
apaneers@amd.com, linux-arm-kernel@lists.infradead.org,
linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org,
tomeu.vizoso@collabora.com, sw0312.kim@samsung.com,
hjc@rock-chips.com, kyungmin.park@samsung.com,
miaoqinglang@huawei.com, yuq825@gmail.com, daniel@ffwll.ch,
alexander.deucher@amd.com, linux-media@vger.kernel.org,
christian.koenig@amd.com, l.stach@pengutronix.de
Subject: Re: [PATCH v3 1/7] drm/vram-helper: Remove invariant parameters from internal kmap function
Date: Fri, 2 Oct 2020 11:48:00 +0200 [thread overview]
Message-ID: <20201002094800.GG438822@phenom.ffwll.local> (raw)
In-Reply-To: <20200929151437.19717-2-tzimmermann@suse.de>
On Tue, Sep 29, 2020 at 05:14:31PM +0200, Thomas Zimmermann wrote:
> The parameters map and is_iomem are always of the same value. Removed them
> to prepares the function for conversion to struct dma_buf_map.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_gem_vram_helper.c | 17 ++++++-----------
> 1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index 3fe4b326e18e..256b346664f2 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -382,16 +382,16 @@ int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo)
> }
> EXPORT_SYMBOL(drm_gem_vram_unpin);
>
> -static void *drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo,
> - bool map, bool *is_iomem)
> +static void *drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo)
> {
> int ret;
> struct ttm_bo_kmap_obj *kmap = &gbo->kmap;
> + bool is_iomem;
>
> if (gbo->kmap_use_count > 0)
> goto out;
>
> - if (kmap->virtual || !map)
> + if (kmap->virtual)
> goto out;
>
> ret = ttm_bo_kmap(&gbo->bo, 0, gbo->bo.num_pages, kmap);
> @@ -399,15 +399,10 @@ static void *drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo,
> return ERR_PTR(ret);
>
> out:
> - if (!kmap->virtual) {
> - if (is_iomem)
> - *is_iomem = false;
> + if (!kmap->virtual)
> return NULL; /* not mapped; don't increment ref */
> - }
> ++gbo->kmap_use_count;
> - if (is_iomem)
> - return ttm_kmap_obj_virtual(kmap, is_iomem);
> - return kmap->virtual;
> + return ttm_kmap_obj_virtual(kmap, &is_iomem);
> }
>
> static void drm_gem_vram_kunmap_locked(struct drm_gem_vram_object *gbo)
> @@ -452,7 +447,7 @@ void *drm_gem_vram_vmap(struct drm_gem_vram_object *gbo)
> ret = drm_gem_vram_pin_locked(gbo, 0);
> if (ret)
> goto err_ttm_bo_unreserve;
> - base = drm_gem_vram_kmap_locked(gbo, true, NULL);
> + base = drm_gem_vram_kmap_locked(gbo);
> if (IS_ERR(base)) {
> ret = PTR_ERR(base);
> goto err_drm_gem_vram_unpin_locked;
> --
> 2.28.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2020-10-02 9:48 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 15:14 [PATCH v3 0/7] Support GEM object mappings from I/O memory Thomas Zimmermann
2020-09-29 15:14 ` [PATCH v3 1/7] drm/vram-helper: Remove invariant parameters from internal kmap function Thomas Zimmermann
2020-10-02 9:48 ` Daniel Vetter [this message]
2020-09-29 15:14 ` [PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion Thomas Zimmermann
2020-09-29 15:35 ` Christian König
2020-09-29 15:44 ` Daniel Vetter
2020-09-29 17:49 ` Thomas Zimmermann
[not found] ` <8a84f62b-33f3-f44c-52af-c859a0e0d1fb@gmail.com>
2020-09-30 8:19 ` Thomas Zimmermann
[not found] ` <b569b7e3-68f0-edcc-c8f4-170e9042d348@gmail.com>
2020-09-30 9:47 ` Daniel Vetter
2020-09-30 12:34 ` Christian König
2020-09-30 12:51 ` Daniel Vetter
2020-10-02 9:58 ` Daniel Vetter
2020-10-02 11:30 ` Christian König
2020-10-02 12:21 ` Daniel Vetter
2020-10-07 12:57 ` Thomas Zimmermann
2020-10-07 13:10 ` Daniel Vetter
2020-10-07 13:20 ` Thomas Zimmermann
2020-10-07 13:24 ` Christian König
2020-10-07 14:30 ` Daniel Vetter
2020-10-08 9:00 ` Thomas Zimmermann
2020-09-29 15:14 ` [PATCH v3 3/7] drm/gem: Use struct dma_buf_map in GEM vmap ops and convert GEM backends Thomas Zimmermann
2020-10-02 13:02 ` Daniel Vetter
2020-09-29 15:14 ` [PATCH v3 4/7] drm/gem: Update internal GEM vmap/vunmap interfaces to use struct dma_buf_map Thomas Zimmermann
2020-10-02 13:04 ` Daniel Vetter
2020-09-29 15:14 ` [PATCH v3 5/7] drm/gem: Store client buffer mappings as " Thomas Zimmermann
2020-10-02 13:05 ` Daniel Vetter
2020-09-29 15:14 ` [PATCH v3 6/7] drm/fb_helper: Support framebuffers in I/O memory Thomas Zimmermann
2020-10-02 18:05 ` Daniel Vetter
2020-10-02 18:44 ` Daniel Vetter
2020-10-08 9:25 ` Thomas Zimmermann
2020-10-08 9:35 ` Daniel Vetter
2020-09-29 15:14 ` [PATCH v3 7/7] drm/todo: Update entries around struct dma_buf_map Thomas Zimmermann
2020-10-02 18:45 ` 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=20201002094800.GG438822@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=alyssa.rosenzweig@collabora.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=apaneers@amd.com \
--cc=bskeggs@redhat.com \
--cc=chris@chris-wilson.co.uk \
--cc=christian.gmeiner@gmail.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.velikov@collabora.com \
--cc=eric@anholt.net \
--cc=etnaviv@lists.freedesktop.org \
--cc=hdegoede@redhat.com \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=inki.dae@samsung.com \
--cc=jy0922.shim@samsung.com \
--cc=kgene@kernel.org \
--cc=kraxel@redhat.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=l.stach@pengutronix.de \
--cc=lima@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=luben.tuikov@amd.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=melissa.srw@gmail.com \
--cc=miaoqinglang@huawei.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=oleksandr_andrushchenko@epam.com \
--cc=ray.huang@amd.com \
--cc=robh@kernel.org \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
--cc=spice-devel@lists.freedesktop.org \
--cc=steven.price@arm.com \
--cc=sumit.semwal@linaro.org \
--cc=sw0312.kim@samsung.com \
--cc=tomeu.vizoso@collabora.com \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=xen-devel@lists.xenproject.org \
--cc=yuq825@gmail.com \
/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).