spin_lock(&file->table_lock);
        idr_for_each_entry (&file->object_idr, obj, id) {
                enum drm_gem_object_status s = 0;
+               size_t add_size = (obj->funcs && obj->funcs->rss) ?
+                       obj->funcs->rss(obj) : obj->size;
 
                if (obj->funcs && obj->funcs->status) {
                        s = obj->funcs->status(obj);
                }
 
                if (s & DRM_GEM_OBJECT_RESIDENT) {
-                       status.resident += obj->size;
+                       status.resident += add_size;
                } else {
                        /* If already purged or not yet backed by pages, don't
                         * count it as purgeable:
                }
 
                if (!dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true))) {
-                       status.active += obj->size;
+                       status.active += add_size;
 
                        /* If still active, don't count as purgeable: */
                        s &= ~DRM_GEM_OBJECT_PURGEABLE;
                }
 
                if (s & DRM_GEM_OBJECT_PURGEABLE)
-                       status.purgeable += obj->size;
+                       status.purgeable += add_size;
        }
        spin_unlock(&file->table_lock);
 
 
         */
        enum drm_gem_object_status (*status)(struct drm_gem_object *obj);
 
+       /**
+        * @rss:
+        *
+        * Return resident size of the object in physical memory.
+        *
+        * Called by drm_show_memory_stats().
+        */
+       size_t (*rss)(struct drm_gem_object *obj);
+
        /**
         * @vm_ops:
         *