Commit 6b86a122 authored by Nirmoy Das's avatar Nirmoy Das Committed by Christian König

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: default avatarNirmoy Das <nirmoy.das@amd.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/372931/
parent 46642a7d
...@@ -29,16 +29,21 @@ static void bochs_plane_update(struct bochs_device *bochs, ...@@ -29,16 +29,21 @@ static void bochs_plane_update(struct bochs_device *bochs,
struct drm_plane_state *state) struct drm_plane_state *state)
{ {
struct drm_gem_vram_object *gbo; struct drm_gem_vram_object *gbo;
s64 gpu_addr;
if (!state->fb || !bochs->stride) if (!state->fb || !bochs->stride)
return; return;
gbo = drm_gem_vram_of_gem(state->fb->obj[0]); gbo = drm_gem_vram_of_gem(state->fb->obj[0]);
gpu_addr = drm_gem_vram_offset(gbo);
if (WARN_ON_ONCE(gpu_addr < 0))
return; /* Bug: we didn't pin the BO to VRAM in prepare_fb. */
bochs_hw_setbase(bochs, bochs_hw_setbase(bochs,
state->crtc_x, state->crtc_x,
state->crtc_y, state->crtc_y,
state->fb->pitches[0], state->fb->pitches[0],
state->fb->offsets[0] + gbo->bo.offset); state->fb->offsets[0] + gpu_addr);
bochs_hw_setformat(bochs, state->fb->format); bochs_hw_setformat(bochs, state->fb->format);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment