]> Git Repo - J-linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
Merge tag 'kbuild-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[J-linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_object.c
index 425cebcc5cbff76d154ccb0d5a571573cbcd4955..010b0cb7693c9c3be5608f192cb19e583a285893 100644 (file)
@@ -220,9 +220,6 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
 
        placement->num_placement = c;
        placement->placement = places;
-
-       placement->num_busy_placement = c;
-       placement->busy_placement = places;
 }
 
 /**
@@ -1276,25 +1273,36 @@ void amdgpu_bo_get_memory(struct amdgpu_bo *bo,
                          struct amdgpu_mem_stats *stats)
 {
        uint64_t size = amdgpu_bo_size(bo);
+       struct drm_gem_object *obj;
        unsigned int domain;
+       bool shared;
 
        /* Abort if the BO doesn't currently have a backing store */
        if (!bo->tbo.resource)
                return;
 
+       obj = &bo->tbo.base;
+       shared = drm_gem_object_is_shared_for_memory_stats(obj);
+
        domain = amdgpu_mem_type_to_domain(bo->tbo.resource->mem_type);
        switch (domain) {
        case AMDGPU_GEM_DOMAIN_VRAM:
                stats->vram += size;
                if (amdgpu_bo_in_cpu_visible_vram(bo))
                        stats->visible_vram += size;
+               if (shared)
+                       stats->vram_shared += size;
                break;
        case AMDGPU_GEM_DOMAIN_GTT:
                stats->gtt += size;
+               if (shared)
+                       stats->gtt_shared += size;
                break;
        case AMDGPU_GEM_DOMAIN_CPU:
        default:
                stats->cpu += size;
+               if (shared)
+                       stats->cpu_shared += size;
                break;
        }
 
@@ -1397,8 +1405,7 @@ vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
                                        AMDGPU_GEM_DOMAIN_GTT);
 
        /* Avoid costly evictions; only set GTT as a busy placement */
-       abo->placement.num_busy_placement = 1;
-       abo->placement.busy_placement = &abo->placements[1];
+       abo->placements[0].flags |= TTM_PL_FLAG_DESIRED;
 
        r = ttm_bo_validate(bo, &abo->placement, &ctx);
        if (unlikely(r == -EBUSY || r == -ERESTARTSYS))
This page took 0.031859 seconds and 4 git commands to generate.