/* * Copyright(c) 2011-2016 Intel Corporation. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Ke Yu * Zhiyuan Lv <[email protected]> * * Contributors: * Terrence Xu <[email protected]> * Changbin Du <[email protected]> * Bing Niu <[email protected]> * Zhi Wang <[email protected]> * */ #include "i915_drv.h" #include "i915_reg.h" #include "gvt.h" #include "display/bxt_dpio_phy_regs.h" #include "display/i9xx_plane_regs.h" #include "display/intel_cursor_regs.h" #include "display/intel_display.h" #include "display/intel_dpio_phy.h" #include "display/intel_sprite_regs.h" static int get_edp_pipe(struct intel_vgpu *vgpu) { … } static int edp_pipe_is_enabled(struct intel_vgpu *vgpu) { … } int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) { … } static unsigned char virtual_dp_monitor_edid[GVT_EDID_NUM][EDID_SIZE] = …; #define DPCD_HEADER_SIZE … /* let the virtual display supports DP1.2 */ static u8 dpcd_fix_data[DPCD_HEADER_SIZE] = …; static void emulate_monitor_status_change(struct intel_vgpu *vgpu) { … } static void clean_virtual_dp_monitor(struct intel_vgpu *vgpu, int port_num) { … } static enum hrtimer_restart vblank_timer_fn(struct hrtimer *data) { … } static int setup_virtual_dp_monitor(struct intel_vgpu *vgpu, int port_num, int type, unsigned int resolution) { … } /** * vgpu_update_vblank_emulation - Update per-vGPU vblank_timer * @vgpu: vGPU operated * @turnon: Turn ON/OFF vblank_timer * * This function is used to turn on/off or update the per-vGPU vblank_timer * when TRANSCONF is enabled or disabled. vblank_timer period is also updated * if guest changed the refresh rate. * */ void vgpu_update_vblank_emulation(struct intel_vgpu *vgpu, bool turnon) { … } static void emulate_vblank_on_pipe(struct intel_vgpu *vgpu, int pipe) { … } void intel_vgpu_emulate_vblank(struct intel_vgpu *vgpu) { … } /** * intel_vgpu_emulate_hotplug - trigger hotplug event for vGPU * @vgpu: a vGPU * @connected: link state * * This function is used to trigger hotplug interrupt for vGPU * */ void intel_vgpu_emulate_hotplug(struct intel_vgpu *vgpu, bool connected) { … } /** * intel_vgpu_clean_display - clean vGPU virtual display emulation * @vgpu: a vGPU * * This function is used to clean vGPU virtual display emulation stuffs * */ void intel_vgpu_clean_display(struct intel_vgpu *vgpu) { … } /** * intel_vgpu_init_display- initialize vGPU virtual display emulation * @vgpu: a vGPU * @resolution: resolution index for intel_vgpu_edid * * This function is used to initialize vGPU virtual display emulation stuffs * * Returns: * Zero on success, negative error code if failed. * */ int intel_vgpu_init_display(struct intel_vgpu *vgpu, u64 resolution) { … } /** * intel_vgpu_reset_display- reset vGPU virtual display emulation * @vgpu: a vGPU * * This function is used to reset vGPU virtual display emulation stuffs * */ void intel_vgpu_reset_display(struct intel_vgpu *vgpu) { … }