Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-21 Thread Gerd Hoffmann
On Wed, Jan 20, 2021 at 10:52:11AM -0800, Yiwei Zhang wrote: > On Wed, Jan 20, 2021 at 5:33 AM Gerd Hoffmann wrote: > > > > Hi, > > > > > > > > > + select TRACE_GPU_MEM > > > > > > > > > +#ifdef CONFIG_TRACE_GPU_MEM > > > > That doesn't make sense btw. > > Do you recommend we just select

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-20 Thread Gerd Hoffmann
Hi, > > > > > + select TRACE_GPU_MEM > > > > > +#ifdef CONFIG_TRACE_GPU_MEM That doesn't make sense btw. > > > > > +#ifdef CONFIG_TRACE_GPU_MEM > > > > > +static inline void virtio_gpu_trace_total_mem(struct > > > > > virtio_gpu_device *vgdev, > > > > > +

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-20 Thread Daniel Vetter
On Wed, Jan 20, 2021 at 10:51 AM Yiwei Zhangā€ˇ wrote: > > On Wed, Jan 20, 2021 at 1:11 AM Daniel Vetter wrote: > > > > On Tue, Jan 19, 2021 at 11:08:12AM -0800, Yiwei Zhang wrote: > > > On Mon, Jan 18, 2021 at 11:03 PM Daniel Vetter wrote: > > > > > > > > On Tue, Jan 19, 2021 at 12:41 AM Yiwei

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-20 Thread Daniel Vetter
On Tue, Jan 19, 2021 at 11:08:12AM -0800, Yiwei Zhang wrote: > On Mon, Jan 18, 2021 at 11:03 PM Daniel Vetter wrote: > > > > On Tue, Jan 19, 2021 at 12:41 AM Yiwei Zhang wrote: > > > > > > On the success of virtio_gpu_object_create, add size of newly allocated > > > bo to the tracled total_mem.

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-18 Thread Daniel Vetter
On Tue, Jan 19, 2021 at 12:41 AM Yiwei Zhang wrote: > > On the success of virtio_gpu_object_create, add size of newly allocated > bo to the tracled total_mem. In drm_gem_object_funcs.free, after the gem > bo lost its last refcount, subtract the bo size from the tracked > total_mem if the original