PM / sleep: Asynchronous threads for suspend_noirq
[linux/fpc-iii.git] / drivers / gpu / drm / msm / msm_gem_prime.c
blobd48f9fc5129bfbd1b8d8b60842c7272f72eadc5f
1 /*
2 * Copyright (C) 2013 Red Hat
3 * Author: Rob Clark <robdclark@gmail.com>
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.
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.
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/>.
18 #include "msm_drv.h"
19 #include "msm_gem.h"
22 struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
24 struct msm_gem_object *msm_obj = to_msm_bo(obj);
25 BUG_ON(!msm_obj->sgt); /* should have already pinned! */
26 return msm_obj->sgt;
29 void *msm_gem_prime_vmap(struct drm_gem_object *obj)
31 return msm_gem_vaddr(obj);
34 void msm_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
36 /* TODO msm_gem_vunmap() */
39 struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev,
40 size_t size, struct sg_table *sg)
42 return msm_gem_import(dev, size, sg);
45 int msm_gem_prime_pin(struct drm_gem_object *obj)
47 if (!obj->import_attach)
48 msm_gem_get_pages(obj);
49 return 0;
52 void msm_gem_prime_unpin(struct drm_gem_object *obj)
54 if (!obj->import_attach)
55 msm_gem_put_pages(obj);