Skip to content

Commit

Permalink
drm/radeon: Revert: "use GEM references instead of TTMs"
Browse files Browse the repository at this point in the history
Commit fd69ef0 ("drm/radeon: use GEM references instead of TTMs")
causes a black screen at boot instead of showing the GDM login screen
(the system is still alive).

dmesg shows the following oops (abbreviated) when this happens:

[   29.315203] BUG: kernel NULL pointer dereference, address: 0000000000000000
[   29.315209] #PF: supervisor read access in kernel mode
[   29.315213] #PF: error_code(0x0000) - not-present page
[   29.315215] PGD 0 P4D 0
[   29.315220] Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
[   29.315225] CPU: 0 UID: 42 PID: 2253 Comm: Xwayland Tainted: G                   6.12.0-rc1+ torvalds#159
[   29.315232] Hardware name: Micro-Star International Co., Ltd. MS-7C95/B550M PRO-VDH WIFI (MS-7C95), BIOS 2.L0 07/18/2024
[   29.315234] RIP: 0010:drm_gem_object_free+0xc/0x20
[   29.315272] Call Trace:
[   29.315274]  <TASK>
[   29.315305]  ? asm_exc_page_fault+0x22/0x30
[   29.315315]  ? drm_gem_object_free+0xc/0x20
[   29.315320]  radeon_bo_unref+0x50/0x60 [radeon]
[   29.315337]  radeon_vm_fini+0x1ca/0x350 [radeon]
[   29.315356]  radeon_driver_postclose_kms+0x16d/0x180 [radeon]
[   29.315370]  drm_file_free+0x229/0x280
[   29.315377]  drm_release+0x5f/0xe0
[   29.315381]  __fput+0xfc/0x2c0

Revert the change to restore things back to working order.

Fixes: fd69ef0 ("drm/radeon: use GEM references instead of TTMs")
Signed-off-by: Hans de Goede <[email protected]>
  • Loading branch information
jwrdegoede authored and intel-lab-lkp committed Oct 3, 2024
1 parent b2146ed commit 3a699a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/radeon_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void radeon_gem_object_free(struct drm_gem_object *gobj)

if (robj) {
radeon_mn_unregister(robj);
ttm_bo_put(&robj->tbo);
radeon_bo_unref(&robj);
}
}

Expand Down
7 changes: 5 additions & 2 deletions drivers/gpu/drm/radeon/radeon_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,18 @@ struct radeon_bo *radeon_bo_ref(struct radeon_bo *bo)
if (bo == NULL)
return NULL;

drm_gem_object_get(&bo->tbo.base);
ttm_bo_get(&bo->tbo);
return bo;
}

void radeon_bo_unref(struct radeon_bo **bo)
{
struct ttm_buffer_object *tbo;

if ((*bo) == NULL)
return;
drm_gem_object_put(&(*bo)->tbo.base);
tbo = &((*bo)->tbo);
ttm_bo_put(tbo);
*bo = NULL;
}

Expand Down

0 comments on commit 3a699a5

Please sign in to comment.