drm/msm: Add _NO_SHARE flag
Buffers that are not shared between contexts can share a single resv object. This way drm_gpuvm will not track them as external objects, and submit-time validating overhead will be O(1) for all N non-shared BOs, instead of O(n). Signed-off-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Tested-by: Antonino Maniscalco <antomani103@gmail.com> Reviewed-by: Antonino Maniscalco <antomani103@gmail.com> Patchwork: https://patchwork.freedesktop.org/patch/661497/
This commit is contained in:
@@ -140,6 +140,19 @@ struct drm_msm_param {
|
||||
|
||||
#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */
|
||||
#define MSM_BO_GPU_READONLY 0x00000002
|
||||
/* Private buffers do not need to be explicitly listed in the SUBMIT
|
||||
* ioctl, unless referenced by a drm_msm_gem_submit_cmd. Private
|
||||
* buffers may NOT be imported/exported or used for scanout (or any
|
||||
* other situation where buffers can be indefinitely pinned, but
|
||||
* cases other than scanout are all kernel owned BOs which are not
|
||||
* visible to userspace).
|
||||
*
|
||||
* In exchange for those constraints, all private BOs associated with
|
||||
* a single context (drm_file) share a single dma_resv, and if there
|
||||
* has been no eviction since the last submit, there are no per-BO
|
||||
* bookeeping to do, significantly cutting the SUBMIT overhead.
|
||||
*/
|
||||
#define MSM_BO_NO_SHARE 0x00000004
|
||||
#define MSM_BO_CACHE_MASK 0x000f0000
|
||||
/* cache modes */
|
||||
#define MSM_BO_CACHED 0x00010000
|
||||
@@ -149,6 +162,7 @@ struct drm_msm_param {
|
||||
|
||||
#define MSM_BO_FLAGS (MSM_BO_SCANOUT | \
|
||||
MSM_BO_GPU_READONLY | \
|
||||
MSM_BO_NO_SHARE | \
|
||||
MSM_BO_CACHE_MASK)
|
||||
|
||||
struct drm_msm_gem_new {
|
||||
|
||||
Reference in New Issue
Block a user