[PATCH 01/10] drm/ttm: allocate resource object instead of embedding it v2
Thomas Hellström (Intel)
thomas_os at shipmail.org
Mon Jun 7 17:58:40 UTC 2021
On 6/7/21 7:54 PM, Christian König wrote:
>
>
> Am 07.06.21 um 19:06 schrieb Thomas Hellström (Intel):
>>
>> On 6/7/21 6:40 PM, Thomas Hellström (Intel) wrote:
>>>
>>> On 6/2/21 12:09 PM, Christian König wrote:
>>> ...
>>>> @@ -728,14 +728,15 @@ static int ttm_bo_add_move_fence(struct
>>>> ttm_buffer_object *bo,
>>>> */
>>>> static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
>>>> const struct ttm_place *place,
>>>> - struct ttm_resource *mem,
>>>> + struct ttm_resource **mem,
>>>> struct ttm_operation_ctx *ctx)
>>>> {
>>>> struct ttm_device *bdev = bo->bdev;
>>>> - struct ttm_resource_manager *man = ttm_manager_type(bdev,
>>>> mem->mem_type);
>>>> + struct ttm_resource_manager *man;
>>>> struct ww_acquire_ctx *ticket;
>>>> int ret;
>>>> + man = ttm_manager_type(bdev, (*mem)->mem_type);
>>>
>>> Isn't (*mem) uninitialized here? Should be place->mem_type? Eviction
>>> is immediately sent to the bushes.
>>>
>>> Got at least one additional NULL pointer deref to track down in the
>>> eviction code, but could be a merge error of mine as well.
>>
>> Actually this last one was probably due to a bad temporary fix of the
>> above one.
>
> I've found one more warning during my testing now. But that is just a
> false positive.
>
> Apart from that I haven't seen any other fallout, but fingers crossed.
vmwgfx doesn't seem to happy. It works AFAICT., but warns in vmw_move()
about ttm_bo_assign_mem() replacing an existing resource.
/Thomas
>
> Christian.
>
>>
>> /Thomas
>>
>>>
>>>
More information about the dri-devel
mailing list