[PATCH 3/4] wined3d: Keep track of whether a BO is persistently mapped in a per-BO field.

Zebediah Figura zfigura at codeweavers.com
Mon Jan 31 11:22:14 CST 2022


On 1/31/22 08:11, Henri Verbeet wrote:
> On Mon, 31 Jan 2022 at 04:05, Zebediah Figura <zfigura at codeweavers.com> wrote:
>> The ultimate idea being to set a cap on the amount of persistent BO memory, in
>> which case we need to arbitrarily mark BOs as persistent.
>>
> Could the "arbitrary" part be avoided? In particular, what would
> prevent us from unmapping less recently used mappings when we run into
> the cap?

Nothing, really. We could relatively easily use an LRU list, or 
periodically garbage-collect unused mappings, for two possibilities.

I think it's a bit orthogonal to this patch, though. No matter what 
criteria we use to determine whether a mapping is persistent in 
wined3d_bo_*_map(), or to possibly unmap it later, we'll at least want 
some of these users of bo->persistent.

I'm also inclined to argue there's no reason not to accept 4/4 now, and 
later (assuming we need to) implement a more complex and optimized 
scheme on top of that. Although it could probably do with a bit more 
factored out into the "adjust_mapped_memory" helpers.



More information about the wine-devel mailing list