From: Alex Deucher <alexdeucher@gmail.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Christian Zigotzky" <chzigotzky@xenosoft.de>,
"Wu Hoi Pok" <wuhoipok@gmail.com>
Cc: amd-gfx@lists.freedesktop.org, alexander.deucher@amd.com
Subject: Re: [PATCH] drm/radeon: always set GEM function pointer
Date: Mon, 7 Oct 2024 14:36:16 -0400 [thread overview]
Message-ID: <CADnq5_PpmkbYppJWR6QLzm7J_iR4GpSOYYQbTR2Ni21t++R34w@mail.gmail.com> (raw)
In-Reply-To: <20241007183241.1584-1-christian.koenig@amd.com>
Add a few people.
This should fix the radeon ttm gem conversion.
Alex
On Mon, Oct 7, 2024 at 2:33 PM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Make sure to always set the GEM function pointer even for in kernel
> allocations. This fixes a NULL pointer deref caused by switching to GEM
> references.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Fixes: fd69ef05029f ("drm/radeon: use GEM references instead of TTMs")
> ---
> drivers/gpu/drm/radeon/radeon_gem.c | 3 ---
> drivers/gpu/drm/radeon/radeon_object.c | 1 +
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index 9735f4968b86..bf2d4b16dc2a 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -44,8 +44,6 @@ struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj);
> int radeon_gem_prime_pin(struct drm_gem_object *obj);
> void radeon_gem_prime_unpin(struct drm_gem_object *obj);
>
> -const struct drm_gem_object_funcs radeon_gem_object_funcs;
> -
> static vm_fault_t radeon_gem_fault(struct vm_fault *vmf)
> {
> struct ttm_buffer_object *bo = vmf->vma->vm_private_data;
> @@ -132,7 +130,6 @@ int radeon_gem_object_create(struct radeon_device *rdev, unsigned long size,
> return r;
> }
> *obj = &robj->tbo.base;
> - (*obj)->funcs = &radeon_gem_object_funcs;
> robj->pid = task_pid_nr(current);
>
> mutex_lock(&rdev->gem.mutex);
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
> index d0e4b43d155c..7672404fdb29 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -151,6 +151,7 @@ int radeon_bo_create(struct radeon_device *rdev,
> if (bo == NULL)
> return -ENOMEM;
> drm_gem_private_object_init(rdev_to_drm(rdev), &bo->tbo.base, size);
> + bo->tbo.base.funcs = &radeon_gem_object_funcs;
> bo->rdev = rdev;
> bo->surface_reg = -1;
> INIT_LIST_HEAD(&bo->list);
> --
> 2.34.1
>
next prev parent reply other threads:[~2024-10-07 18:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 18:32 [PATCH] drm/radeon: always set GEM function pointer Christian König
2024-10-07 18:36 ` Alex Deucher [this message]
2024-10-08 8:59 ` Christian Zigotzky
2024-10-10 13:57 ` [PATCHES] drm/radeon issues Christian Zigotzky
2024-10-10 23:49 ` Jeff Johnson
2024-10-11 3:53 ` Christian Zigotzky
2024-10-14 12:59 ` Alex Deucher
2024-10-14 13:11 ` Christian Zigotzky
2024-10-15 3:57 ` Christian Zigotzky
2025-08-03 11:35 ` radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulaton Christian Zigotzky
2025-08-03 15:30 ` Christian Zigotzky
2025-08-04 8:11 ` radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulation Christian Zigotzky
2025-08-04 14:42 ` radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulaton Alex Deucher
2025-08-04 16:05 ` radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulation Christian Zigotzky
2025-08-04 16:26 ` mad skateman
2025-08-07 14:10 ` Christian Zigotzky
2025-08-07 14:20 ` Limonciello, Mario
2025-08-08 7:36 ` Christian Zigotzky
2025-08-08 11:23 ` Mario Limonciello
2025-08-08 11:47 ` Christian Zigotzky
2025-08-08 12:03 ` Mario Limonciello
2025-08-08 12:56 ` Alex Deucher
2025-08-08 13:30 ` Christian Zigotzky
2025-08-08 16:01 ` Damien Stewart
2025-08-08 19:38 ` Christian Zigotzky
2025-08-09 5:53 ` Damien Stewart
2024-10-08 11:21 ` [PATCH] drm/radeon: always set GEM function pointer Hans de Goede
2024-10-07 18:38 ` Alex Deucher
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=CADnq5_PpmkbYppJWR6QLzm7J_iR4GpSOYYQbTR2Ni21t++R34w@mail.gmail.com \
--to=alexdeucher@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chzigotzky@xenosoft.de \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=hdegoede@redhat.com \
--cc=wuhoipok@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).