Message ID | 20230130120636.63765-3-matthew.auld@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2,1/6] drm/i915/ttm: fix sparse warning | expand |
On 1/30/2023 1:06 PM, Matthew Auld wrote: > In the next few patches, when initially creating a ttm BO, the > bo->resource is NULL, and the driver is then expected to handle the > initial dummy move. However, if this is created as a system resource > the first ttm_tt we create will always have the clear value set to > false. Previously the initial ttm_tt would be created in > ttm_bo_validate() with the clear parameter always set to true. > > Signed-off-by: Matthew Auld <matthew.auld@intel.com> > Cc: Christian König <ckoenig.leichtzumerken@gmail.com> > Reviewed-by: Christian König <ckoenig.leichtzumerken@gmail.com> Acked-by: Nirmoy Das <nirmoy.das@intel.com> > --- > drivers/gpu/drm/ttm/ttm_bo.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index 326a3d13a829..773080f48864 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -120,8 +120,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, > bool old_use_tt, new_use_tt; > int ret; > > - old_use_tt = bo->resource && > - ttm_manager_type(bdev, bo->resource->mem_type)->use_tt; > + old_use_tt = !bo->resource || ttm_manager_type(bdev, bo->resource->mem_type)->use_tt; > new_use_tt = ttm_manager_type(bdev, mem->mem_type)->use_tt; > > ttm_bo_unmap_virtual(bo);
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 326a3d13a829..773080f48864 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -120,8 +120,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, bool old_use_tt, new_use_tt; int ret; - old_use_tt = bo->resource && - ttm_manager_type(bdev, bo->resource->mem_type)->use_tt; + old_use_tt = !bo->resource || ttm_manager_type(bdev, bo->resource->mem_type)->use_tt; new_use_tt = ttm_manager_type(bdev, mem->mem_type)->use_tt; ttm_bo_unmap_virtual(bo);