Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright(c) 2011-2016 Intel Corporation. All rights reserved.
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 (including the next
0012  * paragraph) shall be included in all copies or substantial portions of the
0013  * Software.
0014  *
0015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0016  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0017  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0018  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0019  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0020  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0021  * SOFTWARE.
0022  */
0023 
0024 #ifndef _INTEL_GVT_H_
0025 #define _INTEL_GVT_H_
0026 
0027 #include <linux/types.h>
0028 
0029 struct drm_i915_private;
0030 
0031 #ifdef CONFIG_DRM_I915_GVT
0032 
0033 struct intel_gvt_mmio_table_iter {
0034     struct drm_i915_private *i915;
0035     void *data;
0036     int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter,
0037                   u32 offset, u32 size);
0038 };
0039 
0040 int intel_gvt_init(struct drm_i915_private *dev_priv);
0041 void intel_gvt_driver_remove(struct drm_i915_private *dev_priv);
0042 int intel_gvt_init_host(void);
0043 void intel_gvt_resume(struct drm_i915_private *dev_priv);
0044 int intel_gvt_iterate_mmio_table(struct intel_gvt_mmio_table_iter *iter);
0045 
0046 struct intel_vgpu_ops {
0047     int (*init_device)(struct drm_i915_private *dev_priv);
0048     void (*clean_device)(struct drm_i915_private *dev_priv);
0049     void (*pm_resume)(struct drm_i915_private *i915);
0050 };
0051 
0052 int intel_gvt_set_ops(const struct intel_vgpu_ops *ops);
0053 void intel_gvt_clear_ops(const struct intel_vgpu_ops *ops);
0054 
0055 #else
0056 static inline int intel_gvt_init(struct drm_i915_private *dev_priv)
0057 {
0058     return 0;
0059 }
0060 
0061 static inline void intel_gvt_driver_remove(struct drm_i915_private *dev_priv)
0062 {
0063 }
0064 
0065 static inline void intel_gvt_resume(struct drm_i915_private *dev_priv)
0066 {
0067 }
0068 
0069 struct intel_gvt_mmio_table_iter {
0070 };
0071 
0072 static inline int intel_gvt_iterate_mmio_table(struct intel_gvt_mmio_table_iter *iter)
0073 {
0074     return 0;
0075 }
0076 #endif
0077 
0078 #endif /* _INTEL_GVT_H_ */