Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2014 Canonical
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  * Authors: Andreas Pokorny
0023  */
0024 
0025 #include "qxl_drv.h"
0026 #include "qxl_object.h"
0027 
0028 /* Empty Implementations as there should not be any other driver for a virtual
0029  * device that might share buffers with qxl */
0030 
0031 int qxl_gem_prime_pin(struct drm_gem_object *obj)
0032 {
0033     struct qxl_bo *bo = gem_to_qxl_bo(obj);
0034 
0035     return qxl_bo_pin(bo);
0036 }
0037 
0038 void qxl_gem_prime_unpin(struct drm_gem_object *obj)
0039 {
0040     struct qxl_bo *bo = gem_to_qxl_bo(obj);
0041 
0042     qxl_bo_unpin(bo);
0043 }
0044 
0045 struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
0046 {
0047     return ERR_PTR(-ENOSYS);
0048 }
0049 
0050 struct drm_gem_object *qxl_gem_prime_import_sg_table(
0051     struct drm_device *dev, struct dma_buf_attachment *attach,
0052     struct sg_table *table)
0053 {
0054     return ERR_PTR(-ENOSYS);
0055 }
0056 
0057 int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
0058 {
0059     struct qxl_bo *bo = gem_to_qxl_bo(obj);
0060     int ret;
0061 
0062     ret = qxl_bo_vmap(bo, map);
0063     if (ret < 0)
0064         return ret;
0065 
0066     return 0;
0067 }
0068 
0069 void qxl_gem_prime_vunmap(struct drm_gem_object *obj,
0070               struct iosys_map *map)
0071 {
0072     struct qxl_bo *bo = gem_to_qxl_bo(obj);
0073 
0074     qxl_bo_vunmap(bo);
0075 }