@@ -955,6 +955,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,
obj->import_attach = attach;
obj->resv = dma_buf->resv;
+ drm_gem_trace_gpu_mem_total(dev, obj->size, true);
return obj;
@@ -1055,6 +1056,7 @@ void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg)
struct dma_buf_attachment *attach;
struct dma_buf *dma_buf;
+ drm_gem_trace_gpu_mem_total(obj->dev, -obj->size, true);
attach = obj->import_attach;
if (sg)
dma_buf_unmap_attachment(attach, sg, DMA_BIDIRECTIONAL);
- drm_gem_prime_import_dev increases the per-device import memory counter * Most drivers use it. * drivers that have a (*gem_prime_import) callback will need additional changes, which can be done if everyone likes the overall RFC. - drm_prime_gem_destroy decreases the per-device import memory counter. * All drivers seem to use it? Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org> --- drivers/gpu/drm/drm_prime.c | 2 ++ 1 file changed, 2 insertions(+)