drm/ast: Keep cursor HW BOs mapped
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 2 Jul 2020 11:50:24 +0000 (13:50 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 7 Jul 2020 09:11:47 +0000 (11:11 +0200)
commit0d384eec10ea723f39df9736a04966e047850cfb
tree0e95d07c18625aa6feb0899c36f0bc46f03fd930
parentc91eadd110463f4455483ab7bc5c5e7cea28a906
drm/ast: Keep cursor HW BOs mapped

Updating the image in a cursor's HW BO requires a mapping of the BO's
buffer in the kernel's address space. Cursor image updates can happen
frequently and create CPU overhead.

As cursor HW BOs are small and never move, they are now map exactly
once during the initialization and the mapping is used throughout the
driver's lifetime.

This change also removes a possible source of failures from
ast_cursor_show(). As the helper does not establish mappings, it cannot
fail. As a result, the cursor plane's atomic-update helper does not
call any failable interfaces. All failures are detected before trying
to update the cursor plane.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200702115029.5281-10-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_cursor.c
drivers/gpu/drm/ast/ast_drv.h