forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/msm/msm_gem_prime.c
....@@ -1,24 +1,15 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2013 Red Hat
34 * 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/>.
165 */
6
+
7
+#include <linux/dma-buf.h>
8
+
9
+#include <drm/drm_prime.h>
1710
1811 #include "msm_drv.h"
1912 #include "msm_gem.h"
20
-
21
-#include <linux/dma-buf.h>
2213
2314 struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
2415 {
....@@ -26,9 +17,9 @@
2617 int npages = obj->size >> PAGE_SHIFT;
2718
2819 if (WARN_ON(!msm_obj->pages)) /* should have already pinned! */
29
- return NULL;
20
+ return ERR_PTR(-ENOMEM);
3021
31
- return drm_prime_pages_to_sg(msm_obj->pages, npages);
22
+ return drm_prime_pages_to_sg(obj->dev, msm_obj->pages, npages);
3223 }
3324
3425 void *msm_gem_prime_vmap(struct drm_gem_object *obj)
....@@ -69,11 +60,4 @@
6960 {
7061 if (!obj->import_attach)
7162 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;
7963 }