[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 18/20] drm/xen: Introduce GEM object functions
- To: Thomas Zimmermann <tzimmermann@xxxxxxx>, "alexander.deucher@xxxxxxx" <alexander.deucher@xxxxxxx>, "christian.koenig@xxxxxxx" <christian.koenig@xxxxxxx>, "airlied@xxxxxxxx" <airlied@xxxxxxxx>, "daniel@xxxxxxxx" <daniel@xxxxxxxx>, "linux@xxxxxxxxxxxxxxx" <linux@xxxxxxxxxxxxxxx>, "maarten.lankhorst@xxxxxxxxxxxxxxx" <maarten.lankhorst@xxxxxxxxxxxxxxx>, "mripard@xxxxxxxxxx" <mripard@xxxxxxxxxx>, "l.stach@xxxxxxxxxxxxxx" <l.stach@xxxxxxxxxxxxxx>, "christian.gmeiner@xxxxxxxxx" <christian.gmeiner@xxxxxxxxx>, "inki.dae@xxxxxxxxxxx" <inki.dae@xxxxxxxxxxx>, "jy0922.shim@xxxxxxxxxxx" <jy0922.shim@xxxxxxxxxxx>, "sw0312.kim@xxxxxxxxxxx" <sw0312.kim@xxxxxxxxxxx>, "kyungmin.park@xxxxxxxxxxx" <kyungmin.park@xxxxxxxxxxx>, "kgene@xxxxxxxxxx" <kgene@xxxxxxxxxx>, "krzk@xxxxxxxxxx" <krzk@xxxxxxxxxx>, "patrik.r.jakobsson@xxxxxxxxx" <patrik.r.jakobsson@xxxxxxxxx>, "jani.nikula@xxxxxxxxxxxxxxx" <jani.nikula@xxxxxxxxxxxxxxx>, "joonas.lahtinen@xxxxxxxxxxxxxxx" <joonas.lahtinen@xxxxxxxxxxxxxxx>, "rodrigo.vivi@xxxxxxxxx" <rodrigo.vivi@xxxxxxxxx>, "chunkuang.hu@xxxxxxxxxx" <chunkuang.hu@xxxxxxxxxx>, "p.zabel@xxxxxxxxxxxxxx" <p.zabel@xxxxxxxxxxxxxx>, "matthias.bgg@xxxxxxxxx" <matthias.bgg@xxxxxxxxx>, "robdclark@xxxxxxxxx" <robdclark@xxxxxxxxx>, "sean@xxxxxxxxxx" <sean@xxxxxxxxxx>, "bskeggs@xxxxxxxxxx" <bskeggs@xxxxxxxxxx>, "tomi.valkeinen@xxxxxx" <tomi.valkeinen@xxxxxx>, "eric@xxxxxxxxxx" <eric@xxxxxxxxxx>, "hjc@xxxxxxxxxxxxxx" <hjc@xxxxxxxxxxxxxx>, "heiko@xxxxxxxxx" <heiko@xxxxxxxxx>, "thierry.reding@xxxxxxxxx" <thierry.reding@xxxxxxxxx>, "jonathanh@xxxxxxxxxx" <jonathanh@xxxxxxxxxx>, "rodrigosiqueiramelo@xxxxxxxxx" <rodrigosiqueiramelo@xxxxxxxxx>, "hamohammed.sa@xxxxxxxxx" <hamohammed.sa@xxxxxxxxx>, "hyun.kwon@xxxxxxxxxx" <hyun.kwon@xxxxxxxxxx>, "laurent.pinchart@xxxxxxxxxxxxxxxx" <laurent.pinchart@xxxxxxxxxxxxxxxx>, "michal.simek@xxxxxxxxxx" <michal.simek@xxxxxxxxxx>, "sumit.semwal@xxxxxxxxxx" <sumit.semwal@xxxxxxxxxx>, "evan.quan@xxxxxxx" <evan.quan@xxxxxxx>, "Hawking.Zhang@xxxxxxx" <Hawking.Zhang@xxxxxxx>, "tianci.yin@xxxxxxx" <tianci.yin@xxxxxxx>, "marek.olsak@xxxxxxx" <marek.olsak@xxxxxxx>, "hdegoede@xxxxxxxxxx" <hdegoede@xxxxxxxxxx>, "andrey.grodzovsky@xxxxxxx" <andrey.grodzovsky@xxxxxxx>, "Felix.Kuehling@xxxxxxx" <Felix.Kuehling@xxxxxxx>, "xinhui.pan@xxxxxxx" <xinhui.pan@xxxxxxx>, "aaron.liu@xxxxxxx" <aaron.liu@xxxxxxx>, "nirmoy.das@xxxxxxx" <nirmoy.das@xxxxxxx>, "chris@xxxxxxxxxxxxxxxxxx" <chris@xxxxxxxxxxxxxxxxxx>, "matthew.auld@xxxxxxxxx" <matthew.auld@xxxxxxxxx>, "abdiel.janulgue@xxxxxxxxxxxxxxx" <abdiel.janulgue@xxxxxxxxxxxxxxx>, "tvrtko.ursulin@xxxxxxxxxxxxxxx" <tvrtko.ursulin@xxxxxxxxxxxxxxx>, "andi.shyti@xxxxxxxxx" <andi.shyti@xxxxxxxxx>, "sam@xxxxxxxxxxxx" <sam@xxxxxxxxxxxx>, "miaoqinglang@xxxxxxxxxx" <miaoqinglang@xxxxxxxxxx>, "emil.velikov@xxxxxxxxxxxxx" <emil.velikov@xxxxxxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Thu, 13 Aug 2020 11:19:44 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fc8o5Gg9pCw3D3wzThNao2OARb2LAoDAO0TM8iReMrs=; b=FA7ZbC6kciQiDieES6zzXHbSBfxZUGb12XnTnuuuSTbWoHlcbY/pT+hwappdevHvqexWw/Bz8Q3o54YGu+tjl6vRVDeK78eNIKpH5yzt/n7WIoLrFXY4aV0JyWHJkdIoz2BQUJsh3tZzWwZ6bc5eQ+LCtWLgiIAm3lqIfD+rBIgFimrNgU9NILIddLJaOJBvfokjHR1rH9cCNDsdKqUQUYGUg4ozdb6KGT2+pO9RFz+mujUN/Rw1GEbte2Iy5nbG5oAd2Rp4R307KczLAP1co92UuESu2fqk5bXsxRQesZhQvPXAEpxgYTIwo/PJxqc4eIXw8dhpotVco9zVWZbrpg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ytoj84cGx07WDOAYCzIkNgAt5bJioV7W5YtrVQQAS/+DhksIreP6wUY2d7IxNw3e1dabLKO/joyhyWebgFQqE7U8FYMt8ZYhPnCqjE5ZIzWeJKfvh6OOtWmbCaoocBhxVDJghXveZhwrRLWUgpYJoUeJivPrrUx1cDSfoZ1X4Jed6KVCVnEtCywv0EJXptrjjIlxNbLZDgnkBtcViT9MIz5xfnuKWrBu18bowc9xWX03oicTJdWZ/BnK5NGg1irxdBljvs2qWsyrCW6lxrzabvSp8t9NDmP8axaAZebkUB8HE2VdtkyqacdQWdZWmR0DlAoyL5JuHkuQCowNN55twA==
- Authentication-results: suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=none action=none header.from=epam.com;
- Cc: "amd-gfx@xxxxxxxxxxxxxxxxxxxxx" <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, "dri-devel@xxxxxxxxxxxxxxxxxxxxx" <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, "etnaviv@xxxxxxxxxxxxxxxxxxxxx" <etnaviv@xxxxxxxxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-samsung-soc@xxxxxxxxxxxxxxx" <linux-samsung-soc@xxxxxxxxxxxxxxx>, "intel-gfx@xxxxxxxxxxxxxxxxxxxxx" <intel-gfx@xxxxxxxxxxxxxxxxxxxxx>, "linux-mediatek@xxxxxxxxxxxxxxxxxxx" <linux-mediatek@xxxxxxxxxxxxxxxxxxx>, "linux-arm-msm@xxxxxxxxxxxxxxx" <linux-arm-msm@xxxxxxxxxxxxxxx>, "freedreno@xxxxxxxxxxxxxxxxxxxxx" <freedreno@xxxxxxxxxxxxxxxxxxxxx>, "nouveau@xxxxxxxxxxxxxxxxxxxxx" <nouveau@xxxxxxxxxxxxxxxxxxxxx>, "linux-rockchip@xxxxxxxxxxxxxxxxxxx" <linux-rockchip@xxxxxxxxxxxxxxxxxxx>, "linux-tegra@xxxxxxxxxxxxxxx" <linux-tegra@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 13 Aug 2020 11:20:44 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHWcUzwRlAvqlodBUmjrM9igZrPiqk15K+A
- Thread-topic: [PATCH 18/20] drm/xen: Introduce GEM object functions
Hi,
On 8/13/20 11:36 AM, Thomas Zimmermann wrote:
> GEM object functions deprecate several similar callback interfaces in
> struct drm_driver. This patch replaces the per-driver callbacks with
> per-instance callbacks in xen. The only exception is gem_prime_mmap,
> which is non-trivial to convert.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
> ---
> drivers/gpu/drm/xen/xen_drm_front.c | 12 +-----------
> drivers/gpu/drm/xen/xen_drm_front.h | 2 ++
> drivers/gpu/drm/xen/xen_drm_front_gem.c | 15 +++++++++++++++
> 3 files changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/xen/xen_drm_front.c
> b/drivers/gpu/drm/xen/xen_drm_front.c
> index 3e660fb111b3..bd9af1875af1 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front.c
> @@ -433,7 +433,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp,
> return ret;
> }
>
> -static void xen_drm_drv_free_object_unlocked(struct drm_gem_object *obj)
> +void xen_drm_drv_free_object_unlocked(struct drm_gem_object *obj)
Can we please have naming consistent and name it as
xen_drm_front_drv_free_object_unlocked or any other name if this seems to be
too long,
but starting with xen_drm_front_ as the rest of exported functions?
With this,
Acked-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
Thank you,
Oleksandr
> {
> struct xen_drm_front_drm_info *drm_info = obj->dev->dev_private;
> int idx;
> @@ -481,22 +481,12 @@ static const struct file_operations xen_drm_dev_fops = {
> .mmap = xen_drm_front_gem_mmap,
> };
>
> -static const struct vm_operations_struct xen_drm_drv_vm_ops = {
> - .open = drm_gem_vm_open,
> - .close = drm_gem_vm_close,
> -};
> -
> static struct drm_driver xen_drm_driver = {
> .driver_features = DRIVER_GEM | DRIVER_MODESET |
> DRIVER_ATOMIC,
> .release = xen_drm_drv_release,
> - .gem_vm_ops = &xen_drm_drv_vm_ops,
> - .gem_free_object_unlocked = xen_drm_drv_free_object_unlocked,
> .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
> .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
> .gem_prime_import_sg_table = xen_drm_front_gem_import_sg_table,
> - .gem_prime_get_sg_table = xen_drm_front_gem_get_sg_table,
> - .gem_prime_vmap = xen_drm_front_gem_prime_vmap,
> - .gem_prime_vunmap = xen_drm_front_gem_prime_vunmap,
> .gem_prime_mmap = xen_drm_front_gem_prime_mmap,
> .dumb_create = xen_drm_drv_dumb_create,
> .fops = &xen_drm_dev_fops,
> diff --git a/drivers/gpu/drm/xen/xen_drm_front.h
> b/drivers/gpu/drm/xen/xen_drm_front.h
> index f92c258350ca..93e60c1db550 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front.h
> +++ b/drivers/gpu/drm/xen/xen_drm_front.h
> @@ -160,4 +160,6 @@ int xen_drm_front_page_flip(struct xen_drm_front_info
> *front_info,
> void xen_drm_front_on_frame_done(struct xen_drm_front_info *front_info,
> int conn_idx, u64 fb_cookie);
>
> +void xen_drm_drv_free_object_unlocked(struct drm_gem_object *obj);
> +
> #endif /* __XEN_DRM_FRONT_H_ */
> diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c
> b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> index f0b85e094111..7b315c08bcfc 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> @@ -56,6 +56,19 @@ static void gem_free_pages_array(struct xen_gem_object
> *xen_obj)
> xen_obj->pages = NULL;
> }
>
> +static const struct vm_operations_struct xen_drm_drv_vm_ops = {
> + .open = drm_gem_vm_open,
> + .close = drm_gem_vm_close,
> +};
> +
> +static const struct drm_gem_object_funcs xen_drm_front_gem_object_funcs = {
> + .free = xen_drm_drv_free_object_unlocked,
> + .get_sg_table = xen_drm_front_gem_get_sg_table,
> + .vmap = xen_drm_front_gem_prime_vmap,
> + .vunmap = xen_drm_front_gem_prime_vunmap,
> + .vm_ops = &xen_drm_drv_vm_ops,
> +};
> +
> static struct xen_gem_object *gem_create_obj(struct drm_device *dev,
> size_t size)
> {
> @@ -66,6 +79,8 @@ static struct xen_gem_object *gem_create_obj(struct
> drm_device *dev,
> if (!xen_obj)
> return ERR_PTR(-ENOMEM);
>
> + xen_obj->base.funcs = &xen_drm_front_gem_object_funcs;
> +
> ret = drm_gem_object_init(dev, &xen_obj->base, size);
> if (ret < 0) {
> kfree(xen_obj);
|