gem.c (6bde8ef51c917a657476310728d6cb3de6bac9e4) gem.c (707d561f77b5e2a6f90c9786bee44ee7a8dedc7e)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * NVIDIA Tegra DRM GEM helper functions
4 *
5 * Copyright (C) 2012 Sascha Hauer, Pengutronix
6 * Copyright (C) 2013-2015 NVIDIA CORPORATION, All rights reserved.
7 *
8 * Based on the GEM/CMA helpers

--- 270 unchanged lines hidden (view full) ---

279 int err;
280
281 bo->pages = drm_gem_get_pages(&bo->gem);
282 if (IS_ERR(bo->pages))
283 return PTR_ERR(bo->pages);
284
285 bo->num_pages = bo->gem.size >> PAGE_SHIFT;
286
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * NVIDIA Tegra DRM GEM helper functions
4 *
5 * Copyright (C) 2012 Sascha Hauer, Pengutronix
6 * Copyright (C) 2013-2015 NVIDIA CORPORATION, All rights reserved.
7 *
8 * Based on the GEM/CMA helpers

--- 270 unchanged lines hidden (view full) ---

279 int err;
280
281 bo->pages = drm_gem_get_pages(&bo->gem);
282 if (IS_ERR(bo->pages))
283 return PTR_ERR(bo->pages);
284
285 bo->num_pages = bo->gem.size >> PAGE_SHIFT;
286
287 bo->sgt = drm_prime_pages_to_sg(bo->pages, bo->num_pages);
287 bo->sgt = drm_prime_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages);
288 if (IS_ERR(bo->sgt)) {
289 err = PTR_ERR(bo->sgt);
290 goto put_pages;
291 }
292
293 err = dma_map_sg(drm->dev, bo->sgt->sgl, bo->sgt->nents,
294 DMA_FROM_DEVICE);
295 if (err == 0) {

--- 406 unchanged lines hidden ---
288 if (IS_ERR(bo->sgt)) {
289 err = PTR_ERR(bo->sgt);
290 goto put_pages;
291 }
292
293 err = dma_map_sg(drm->dev, bo->sgt->sgl, bo->sgt->nents,
294 DMA_FROM_DEVICE);
295 if (err == 0) {

--- 406 unchanged lines hidden ---