]> git.baikalelectronics.ru Git - kernel.git/commit
nouveau: simplify nouveau_dmem_migrate_to_ram
authorChristoph Hellwig <hch@lst.de>
Wed, 14 Aug 2019 07:59:24 +0000 (09:59 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 20 Aug 2019 12:35:03 +0000 (09:35 -0300)
commit6fe648a49abdc7a9cbc8f92f72f23769938177b8
tree6861ccf220f2c1e78903894c89a3528462430bc0
parente64750edd8ba23d49096bc437fd856d99bfc4d53
nouveau: simplify nouveau_dmem_migrate_to_ram

Factor the main copy page to ram routine out into a helper that acts on
a single page and which doesn't require the nouveau_dmem_fault
structure for argument passing.  Also remove the loop over multiple
pages as we only handle one at the moment, although the structure of
the main worker function makes it relatively easy to add multi page
support back if needed in the future.  But at least for now this avoid
the needed to dynamically allocate memory for the dma addresses in
what is essentially the page fault path.

Link: https://lore.kernel.org/r/20190814075928.23766-7-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Tested-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/gpu/drm/nouveau/nouveau_dmem.c