| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* exynos_drm_gem.h |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. |
|---|
| 4 | 5 | * Authoer: Inki Dae <inki.dae@samsung.com> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 8 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 9 | | - * option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #ifndef _EXYNOS_DRM_GEM_H_ |
|---|
| .. | .. |
|---|
| 25 | 21 | * @base: a gem object. |
|---|
| 26 | 22 | * - a new handle to this gem object would be created |
|---|
| 27 | 23 | * by drm_gem_handle_create(). |
|---|
| 28 | | - * @buffer: a pointer to exynos_drm_gem_buffer object. |
|---|
| 29 | | - * - contain the information to memory region allocated |
|---|
| 30 | | - * by user request or at framebuffer creation. |
|---|
| 31 | | - * continuous memory region allocated by user request |
|---|
| 32 | | - * or at framebuffer creation. |
|---|
| 33 | 24 | * @flags: indicate memory type to allocated buffer and cache attruibute. |
|---|
| 34 | 25 | * @size: size requested from user, in bytes and this size is aligned |
|---|
| 35 | 26 | * in page unit. |
|---|
| 36 | 27 | * @cookie: cookie returned by dma_alloc_attrs |
|---|
| 37 | | - * @kvaddr: kernel virtual address to allocated memory region. |
|---|
| 28 | + * @kvaddr: kernel virtual address to allocated memory region (for fbdev) |
|---|
| 38 | 29 | * @dma_addr: bus address(accessed by dma) to allocated memory region. |
|---|
| 39 | 30 | * - this address could be physical address without IOMMU and |
|---|
| 40 | 31 | * device address with IOMMU. |
|---|
| 41 | | - * @pages: Array of backing pages. |
|---|
| 32 | + * @dma_attrs: attrs passed dma mapping framework |
|---|
| 42 | 33 | * @sgt: Imported sg_table. |
|---|
| 43 | 34 | * |
|---|
| 44 | 35 | * P.S. this object would be transferred to user as kms_bo.handle so |
|---|
| .. | .. |
|---|
| 49 | 40 | unsigned int flags; |
|---|
| 50 | 41 | unsigned long size; |
|---|
| 51 | 42 | void *cookie; |
|---|
| 52 | | - void __iomem *kvaddr; |
|---|
| 43 | + void *kvaddr; |
|---|
| 53 | 44 | dma_addr_t dma_addr; |
|---|
| 54 | 45 | unsigned long dma_attrs; |
|---|
| 55 | | - struct page **pages; |
|---|
| 56 | 46 | struct sg_table *sgt; |
|---|
| 57 | 47 | }; |
|---|
| 58 | 48 | |
|---|
| .. | .. |
|---|
| 62 | 52 | /* create a new buffer with gem object */ |
|---|
| 63 | 53 | struct exynos_drm_gem *exynos_drm_gem_create(struct drm_device *dev, |
|---|
| 64 | 54 | unsigned int flags, |
|---|
| 65 | | - unsigned long size); |
|---|
| 55 | + unsigned long size, |
|---|
| 56 | + bool kvmap); |
|---|
| 66 | 57 | |
|---|
| 67 | 58 | /* |
|---|
| 68 | 59 | * request gem object creation and buffer allocation as the size |
|---|
| .. | .. |
|---|
| 90 | 81 | */ |
|---|
| 91 | 82 | static inline void exynos_drm_gem_put(struct exynos_drm_gem *exynos_gem) |
|---|
| 92 | 83 | { |
|---|
| 93 | | - drm_gem_object_put_unlocked(&exynos_gem->base); |
|---|
| 84 | + drm_gem_object_put(&exynos_gem->base); |
|---|
| 94 | 85 | } |
|---|
| 95 | 86 | |
|---|
| 96 | 87 | /* get buffer information to memory region allocated by gem. */ |
|---|
| .. | .. |
|---|
| 104 | 95 | int exynos_drm_gem_dumb_create(struct drm_file *file_priv, |
|---|
| 105 | 96 | struct drm_device *dev, |
|---|
| 106 | 97 | struct drm_mode_create_dumb *args); |
|---|
| 107 | | - |
|---|
| 108 | | -/* page fault handler and mmap fault address(virtual) to physical memory. */ |
|---|
| 109 | | -vm_fault_t exynos_drm_gem_fault(struct vm_fault *vmf); |
|---|
| 110 | 98 | |
|---|
| 111 | 99 | /* set vm_flags and we can change the vm attribute to other one at here. */ |
|---|
| 112 | 100 | int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); |
|---|