[Nouveau] BO page shift?

Patrick Baggett baggett.patrick at gmail.com
Mon Apr 21 13:17:16 PDT 2014


I'm looking at nouveau_bo.c in nouveau_bo_new() and I see some code like:

line 230:

nvbo->bo.mem.num_pages = size >> PAGE_SHIFT;


and

line 236

ret = ttm_bo_init(&drm->ttm.bdev, &nvbo->bo, size,
			  type, &nvbo->placement,
			  align >> PAGE_SHIFT, false, NULL, acc_size, sg,
			  nouveau_bo_del_ttm);


It doesn't seem to handle the case that {value} >> PAGE_SHIFT could
result in 0. I think "size >> PAGE_SHIFT" may be OK, but I'm not so
sure about "align >> PAGE_SHIFT".



Shouldn't these have something like MIN( ... ,1), i.e. it must be at
least one page of memory? Is there something else that is going on
that I'm missing?


Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20140421/c672cd50/attachment.html>


More information about the Nouveau mailing list