diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-05-16 18:27:46 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-05-17 13:14:11 +0200 |
commit | 5b24f715042da2a7f3fd059f15cc5a6fbd4f4ec6 (patch) | |
tree | 10786a77f38388273e4a631717232ba30cd3557c /drivers/gpu/drm/mgag200 | |
parent | 82ff2fb5d184e95c7877c58359cef4f5d43df9c1 (diff) | |
download | linux-5b24f715042da2a7f3fd059f15cc5a6fbd4f4ec6.tar.gz linux-5b24f715042da2a7f3fd059f15cc5a6fbd4f4ec6.tar.bz2 linux-5b24f715042da2a7f3fd059f15cc5a6fbd4f4ec6.zip |
drm: Reserve/unreserve GEM VRAM BOs from within pin/unpin functions
The original bochs and vbox implementations of pin and unpin functions
automatically reserved BOs during validation. This functionality got lost
while converting the code to a generic implementation. This may result
in validating unlocked TTM BOs.
Adding the reserve and unreserve operations to GEM VRAM's pin and unpin
functions fixes the bochs and vbox drivers. Additionally the patch changes
the mgag200, ast and hibmc drivers to not reserve BOs by themselves.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: kernel test robot <lkp@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20190516162746.11636-3-tzimmermann@suse.de
Fixes: a3232987fdbf ("drm/bochs: Convert bochs driver to |struct drm_gem_vram_object|")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/mgag200')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_mode.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 3098bf5c1744..e79872c968bf 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -877,24 +877,16 @@ static int mga_crtc_do_set_base(struct drm_crtc *crtc, mga_fb = to_mga_framebuffer(fb); obj = mga_fb->obj; gbo = drm_gem_vram_of_gem(obj); - ret = drm_gem_vram_reserve(gbo, false); - if (ret) - return ret; drm_gem_vram_push_to_system(gbo); - drm_gem_vram_unreserve(gbo); } mga_fb = to_mga_framebuffer(crtc->primary->fb); obj = mga_fb->obj; gbo = drm_gem_vram_of_gem(obj); - ret = drm_gem_vram_reserve(gbo, false); - if (ret) - return ret; - ret = drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM); if (ret) - goto err_drm_gem_vram_unreserve; + return ret; gpu_addr = drm_gem_vram_offset(gbo); if (gpu_addr < 0) { ret = (int)gpu_addr; @@ -910,16 +902,12 @@ static int mga_crtc_do_set_base(struct drm_crtc *crtc, } } - drm_gem_vram_unreserve(gbo); - mga_set_start_address(crtc, (u32)gpu_addr); return 0; err_drm_gem_vram_unpin: drm_gem_vram_unpin(gbo); -err_drm_gem_vram_unreserve: - drm_gem_vram_unreserve(gbo); return ret; } @@ -1434,7 +1422,6 @@ static void mga_crtc_destroy(struct drm_crtc *crtc) static void mga_crtc_disable(struct drm_crtc *crtc) { - int ret; DRM_DEBUG_KMS("\n"); mga_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); if (crtc->primary->fb) { @@ -1442,11 +1429,7 @@ static void mga_crtc_disable(struct drm_crtc *crtc) struct drm_gem_object *obj = mga_fb->obj; struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(obj); - ret = drm_gem_vram_reserve(gbo, false); - if (ret) - return; drm_gem_vram_push_to_system(gbo); - drm_gem_vram_unreserve(gbo); } crtc->primary->fb = NULL; } |