drm/hisilicon/hibmc: Use GEM VRAM's prepare_fb() and cleanup_fb() helpers
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 24 Oct 2019 08:14:03 +0000 (10:14 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 24 Oct 2019 14:12:36 +0000 (16:12 +0200)
commitecad80f0865d69c8de37c7415dbf66ba372f2ca1
treed0740c34701ee2861c286eaaed035a19e91142be
parenteddc0acfed094293a0ee5130cc8cd2b97be8ee84
drm/hisilicon/hibmc: Use GEM VRAM's prepare_fb() and cleanup_fb() helpers

This patch implements prepare_fb() and cleanup_fb() in hibmc with the
GEM VRAM helpers. In the current code, pinning the BO is performed by
hibmc_plane_atomic_update(), where the operation does not belong.

This patch also fixes a bug where the pinned BO was never unpinned.
Pinning multiple BOs would have exhaused the available VRAM and further
pin operations would have failed, leaving the display in a corrupt
state.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191024081404.6978-4-tzimmermann@suse.de
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c