freedreno/drm: Add FD_BO_NOMAP hint
authorRob Clark <robdclark@chromium.org>
Fri, 4 Feb 2022 19:36:40 +0000 (11:36 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Mar 2022 02:03:30 +0000 (02:03 +0000)
commitf846181fe533da11598a1dfa38ff3c0241fcf20c
treea21c1caff1d9dfcca33ee0fa43c9e292df0317f6
parent598405c91f06d5347d909eabe33fc0a9d4bb510e
freedreno/drm: Add FD_BO_NOMAP hint

Add a hint for buffers that we won't need to mmap.  With the virtio
backend, virglrenderer needs to create a dmabuf fd for mapping into
the host, which we want to avoid when possible.

Low hanging fruit is to use this hint for anything tiled/ubwc.  There
are probably more bo's that can be flagged as such.

TODO add fd_bo_upload() for memcpy to bo.. this would be useful for
uploads, for example, shaders which we just write once and never touch
again.. for virtio this could be implemented with a TRANSFER_TO_HOST
ioctl.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
src/freedreno/drm/freedreno_bo.c
src/freedreno/drm/freedreno_drmif.h
src/gallium/drivers/freedreno/a5xx/fd5_resource.c
src/gallium/drivers/freedreno/a6xx/fd6_gmem.c
src/gallium/drivers/freedreno/a6xx/fd6_resource.c
src/gallium/drivers/freedreno/freedreno_resource.c