Skip to content

Commit 6b86a12

Browse files
nirmoyChristianKoenigAMD
authored andcommitted
drm/bochs: use drm_gem_vram_offset to get bo offset v2
Switch over to GEM VRAM's implementation to retrieve bo->offset. Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/372931/
1 parent 46642a7 commit 6b86a12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpu/drm/bochs/bochs_kms.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,21 @@ static void bochs_plane_update(struct bochs_device *bochs,
2929
struct drm_plane_state *state)
3030
{
3131
struct drm_gem_vram_object *gbo;
32+
s64 gpu_addr;
3233

3334
if (!state->fb || !bochs->stride)
3435
return;
3536

3637
gbo = drm_gem_vram_of_gem(state->fb->obj[0]);
38+
gpu_addr = drm_gem_vram_offset(gbo);
39+
if (WARN_ON_ONCE(gpu_addr < 0))
40+
return; /* Bug: we didn't pin the BO to VRAM in prepare_fb. */
41+
3742
bochs_hw_setbase(bochs,
3843
state->crtc_x,
3944
state->crtc_y,
4045
state->fb->pitches[0],
41-
state->fb->offsets[0] + gbo->bo.offset);
46+
state->fb->offsets[0] + gpu_addr);
4247
bochs_hw_setformat(bochs, state->fb->format);
4348
}
4449

0 commit comments

Comments
 (0)