lima: implement PLB PP stream cache
authorVasily Khoruzhick <anarsoul@gmail.com>
Sun, 16 Feb 2020 10:25:10 +0000 (02:25 -0800)
committerMarge Bot <eric+marge@anholt.net>
Fri, 21 Feb 2020 07:20:20 +0000 (07:20 +0000)
commit8021daeb1fb58415af5d0a779368dc6617af947e
tree52bf42112795cf87f4e6665405f487170ecf5a61
parent7edde3d26bb4119be44a2bdda2c5ca0d2f8adfe9
lima: implement PLB PP stream cache

Generating PLB PP stream is expensive. PLB PP stream content depends on
damage, and if damage consists of several rects it's impossible to come
up with a simple key.

Simplify damage to a single bounding box so we have a simple key
and cache PLB PP stream. Cache size is limited to 0.1% of system RAM and
once limit is reached least recently used entries are dropped.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3834>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3834>
src/gallium/drivers/lima/lima_context.c
src/gallium/drivers/lima/lima_context.h
src/gallium/drivers/lima/lima_job.c
src/gallium/drivers/lima/lima_resource.c
src/gallium/drivers/lima/lima_screen.c
src/gallium/drivers/lima/lima_screen.h