gem.c (5fe9cfbe44b6892e17f803125c4761221b0175c6) gem.c (04c0746663bd3ae3cce5e02d5b32c8ade2a833b8)
1/*
2 * NVIDIA Tegra DRM GEM helper functions
3 *
4 * Copyright (C) 2012 Sascha Hauer, Pengutronix
5 * Copyright (C) 2013-2015 NVIDIA CORPORATION, All rights reserved.
6 *
7 * Based on the GEM/CMA helpers
8 *

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

454}
455
456const struct vm_operations_struct tegra_bo_vm_ops = {
457 .fault = tegra_bo_fault,
458 .open = drm_gem_vm_open,
459 .close = drm_gem_vm_close,
460};
461
1/*
2 * NVIDIA Tegra DRM GEM helper functions
3 *
4 * Copyright (C) 2012 Sascha Hauer, Pengutronix
5 * Copyright (C) 2013-2015 NVIDIA CORPORATION, All rights reserved.
6 *
7 * Based on the GEM/CMA helpers
8 *

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

454}
455
456const struct vm_operations_struct tegra_bo_vm_ops = {
457 .fault = tegra_bo_fault,
458 .open = drm_gem_vm_open,
459 .close = drm_gem_vm_close,
460};
461
462static int tegra_gem_mmap(struct drm_gem_object *gem,
463 struct vm_area_struct *vma)
462int __tegra_gem_mmap(struct drm_gem_object *gem, struct vm_area_struct *vma)
464{
465 struct tegra_bo *bo = to_tegra_bo(gem);
466
467 if (!bo->pages) {
468 unsigned long vm_pgoff = vma->vm_pgoff;
469 int err;
470
471 /*

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

502 int err;
503
504 err = drm_gem_mmap(file, vma);
505 if (err < 0)
506 return err;
507
508 gem = vma->vm_private_data;
509
463{
464 struct tegra_bo *bo = to_tegra_bo(gem);
465
466 if (!bo->pages) {
467 unsigned long vm_pgoff = vma->vm_pgoff;
468 int err;
469
470 /*

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

501 int err;
502
503 err = drm_gem_mmap(file, vma);
504 if (err < 0)
505 return err;
506
507 gem = vma->vm_private_data;
508
510 return tegra_gem_mmap(gem, vma);
509 return __tegra_gem_mmap(gem, vma);
511}
512
513static struct sg_table *
514tegra_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
515 enum dma_data_direction dir)
516{
517 struct drm_gem_object *gem = attach->dmabuf->priv;
518 struct tegra_bo *bo = to_tegra_bo(gem);

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

595{
596 struct drm_gem_object *gem = buf->priv;
597 int err;
598
599 err = drm_gem_mmap_obj(gem, gem->size, vma);
600 if (err < 0)
601 return err;
602
510}
511
512static struct sg_table *
513tegra_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
514 enum dma_data_direction dir)
515{
516 struct drm_gem_object *gem = attach->dmabuf->priv;
517 struct tegra_bo *bo = to_tegra_bo(gem);

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

594{
595 struct drm_gem_object *gem = buf->priv;
596 int err;
597
598 err = drm_gem_mmap_obj(gem, gem->size, vma);
599 if (err < 0)
600 return err;
601
603 return tegra_gem_mmap(gem, vma);
602 return __tegra_gem_mmap(gem, vma);
604}
605
606static void *tegra_gem_prime_vmap(struct dma_buf *buf)
607{
608 struct drm_gem_object *gem = buf->priv;
609 struct tegra_bo *bo = to_tegra_bo(gem);
610
611 return bo->vaddr;

--- 53 unchanged lines hidden ---
603}
604
605static void *tegra_gem_prime_vmap(struct dma_buf *buf)
606{
607 struct drm_gem_object *gem = buf->priv;
608 struct tegra_bo *bo = to_tegra_bo(gem);
609
610 return bo->vaddr;

--- 53 unchanged lines hidden ---