.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2013 Red Hat |
---|
3 | 4 | * Author: Rob Clark <robdclark@gmail.com> |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms of the GNU General Public License version 2 as published by |
---|
7 | | - * the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | | - * |
---|
14 | | - * You should have received a copy of the GNU General Public License along with |
---|
15 | | - * this program. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | 5 | */ |
---|
| 6 | + |
---|
| 7 | +#include <linux/dma-buf.h> |
---|
| 8 | + |
---|
| 9 | +#include <drm/drm_prime.h> |
---|
17 | 10 | |
---|
18 | 11 | #include "msm_drv.h" |
---|
19 | 12 | #include "msm_gem.h" |
---|
20 | | - |
---|
21 | | -#include <linux/dma-buf.h> |
---|
22 | 13 | |
---|
23 | 14 | struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj) |
---|
24 | 15 | { |
---|
.. | .. |
---|
26 | 17 | int npages = obj->size >> PAGE_SHIFT; |
---|
27 | 18 | |
---|
28 | 19 | if (WARN_ON(!msm_obj->pages)) /* should have already pinned! */ |
---|
29 | | - return NULL; |
---|
| 20 | + return ERR_PTR(-ENOMEM); |
---|
30 | 21 | |
---|
31 | | - return drm_prime_pages_to_sg(msm_obj->pages, npages); |
---|
| 22 | + return drm_prime_pages_to_sg(obj->dev, msm_obj->pages, npages); |
---|
32 | 23 | } |
---|
33 | 24 | |
---|
34 | 25 | void *msm_gem_prime_vmap(struct drm_gem_object *obj) |
---|
.. | .. |
---|
69 | 60 | { |
---|
70 | 61 | if (!obj->import_attach) |
---|
71 | 62 | msm_gem_put_pages(obj); |
---|
72 | | -} |
---|
73 | | - |
---|
74 | | -struct reservation_object *msm_gem_prime_res_obj(struct drm_gem_object *obj) |
---|
75 | | -{ |
---|
76 | | - struct msm_gem_object *msm_obj = to_msm_bo(obj); |
---|
77 | | - |
---|
78 | | - return msm_obj->resv; |
---|
79 | 63 | } |
---|