diff options
author | Nirmoy Das <nirmoy.aiemd@gmail.com> | 2020-06-24 21:26:47 +0300 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2020-06-25 12:59:43 +0300 |
commit | 6b86a1224af8b369d34a41b0954d9eeabd6f35ef (patch) | |
tree | 804dd2c5247e1172de4191798db5b1c9194f5a66 | |
parent | 46642a7d4d80588c1f50d06885386f0c2e00fe36 (diff) | |
download | linux-6b86a1224af8b369d34a41b0954d9eeabd6f35ef.tar.xz |
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 <nirmoy.das@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/372931/
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_kms.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index 05d8373888e8..853081d186d5 100644 --- a/drivers/gpu/drm/bochs/bochs_kms.c +++ b/drivers/gpu/drm/bochs/bochs_kms.c @@ -29,16 +29,21 @@ static void bochs_plane_update(struct bochs_device *bochs, struct drm_plane_state *state) { struct drm_gem_vram_object *gbo; + s64 gpu_addr; if (!state->fb || !bochs->stride) return; 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, state->crtc_x, state->crtc_y, state->fb->pitches[0], - state->fb->offsets[0] + gbo->bo.offset); + state->fb->offsets[0] + gpu_addr); bochs_hw_setformat(bochs, state->fb->format); } |