diff options
author | Eric Anholt <eric@anholt.net> | 2019-02-07 15:26:13 -0800 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-02-19 11:07:36 +0100 |
commit | cc3f60cfd4f2752f1bad7eaa3839855c15347abc (patch) | |
tree | 2aecaacb95d6469855dcbddd7743c95986e52062 /drivers/gpu/drm/v3d | |
parent | 6649a95d35d850e417f125821a803ca7889c713c (diff) | |
download | talos-op-linux-cc3f60cfd4f2752f1bad7eaa3839855c15347abc.tar.gz talos-op-linux-cc3f60cfd4f2752f1bad7eaa3839855c15347abc.zip |
drm/v3d: Fix BO stats accounting for dma-buf-imported buffers.
We always decrement at GEM free, so make sure we increment at GEM
creation for dma-bufs.
Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190207232613.24981-1-eric@anholt.net
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'drivers/gpu/drm/v3d')
-rw-r--r-- | drivers/gpu/drm/v3d/v3d_bo.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c index a08766d39eab..b1766f096c4b 100644 --- a/drivers/gpu/drm/v3d/v3d_bo.c +++ b/drivers/gpu/drm/v3d/v3d_bo.c @@ -282,6 +282,7 @@ v3d_prime_import_sg_table(struct drm_device *dev, struct dma_buf_attachment *attach, struct sg_table *sgt) { + struct v3d_dev *v3d = to_v3d_dev(dev); struct drm_gem_object *obj; struct v3d_bo *bo; @@ -296,6 +297,11 @@ v3d_prime_import_sg_table(struct drm_device *dev, obj->import_attach = attach; v3d_bo_get_pages(bo); + mutex_lock(&v3d->bo_lock); + v3d->bo_stats.num_allocated++; + v3d->bo_stats.pages_allocated += obj->size >> PAGE_SHIFT; + mutex_unlock(&v3d->bo_lock); + v3d_mmu_insert_ptes(bo); return obj; |