Lines Matching +full:edid +full:- +full:emulation
2 * Copyright(c) 2011-2016 Intel Corporation. All rights reserved.
42 int pipe = -1; in get_edp_pipe()
61 struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915; in edp_pipe_is_enabled()
73 struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915; in pipe_is_enabled()
75 if (drm_WARN_ON(&dev_priv->drm, in pipe_is_enabled()
77 return -EINVAL; in pipe_is_enabled()
90 /* EDID with 1024x768 as its resolution */
124 /* EDID with 1920x1200 as its resolution */
173 struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915; in emulate_monitor_status_change()
253 * 24 bpp, 4 lanes, 154000 pixel clk (from virtual EDID), in emulate_monitor_status_change()
254 * DP link clk 1620 MHz and non-constant_n. in emulate_monitor_status_change()
263 /* Enable per-DDI/PORT vreg */ in emulate_monitor_status_change()
387 * 24 bpp, 4 lanes, 154000 pixel clk (from virtual EDID), in emulate_monitor_status_change()
388 * DP link clk 1620 MHz and non-constant_n. in emulate_monitor_status_change()
513 kfree(port->edid); in clean_virtual_dp_monitor()
514 port->edid = NULL; in clean_virtual_dp_monitor()
516 kfree(port->dpcd); in clean_virtual_dp_monitor()
517 port->dpcd = NULL; in clean_virtual_dp_monitor()
528 /* Set vblank emulation request per-vGPU bit */ in vblank_timer_fn()
529 intel_gvt_request_service(vgpu->gvt, in vblank_timer_fn()
530 INTEL_GVT_REQUEST_EMULATE_VBLANK + vgpu->id); in vblank_timer_fn()
531 hrtimer_add_expires_ns(&vblank_timer->timer, vblank_timer->period); in vblank_timer_fn()
538 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; in setup_virtual_dp_monitor()
540 struct intel_vgpu_vblank_timer *vblank_timer = &vgpu->vblank_timer; in setup_virtual_dp_monitor()
542 if (drm_WARN_ON(&i915->drm, resolution >= GVT_EDID_NUM)) in setup_virtual_dp_monitor()
543 return -EINVAL; in setup_virtual_dp_monitor()
545 port->edid = kzalloc(sizeof(*(port->edid)), GFP_KERNEL); in setup_virtual_dp_monitor()
546 if (!port->edid) in setup_virtual_dp_monitor()
547 return -ENOMEM; in setup_virtual_dp_monitor()
549 port->dpcd = kzalloc(sizeof(*(port->dpcd)), GFP_KERNEL); in setup_virtual_dp_monitor()
550 if (!port->dpcd) { in setup_virtual_dp_monitor()
551 kfree(port->edid); in setup_virtual_dp_monitor()
552 return -ENOMEM; in setup_virtual_dp_monitor()
555 memcpy(port->edid->edid_block, virtual_dp_monitor_edid[resolution], in setup_virtual_dp_monitor()
557 port->edid->data_valid = true; in setup_virtual_dp_monitor()
559 memcpy(port->dpcd->data, dpcd_fix_data, DPCD_HEADER_SIZE); in setup_virtual_dp_monitor()
560 port->dpcd->data_valid = true; in setup_virtual_dp_monitor()
561 port->dpcd->data[DPCD_SINK_COUNT] = 0x1; in setup_virtual_dp_monitor()
562 port->type = type; in setup_virtual_dp_monitor()
563 port->id = resolution; in setup_virtual_dp_monitor()
564 port->vrefresh_k = GVT_DEFAULT_REFRESH_RATE * MSEC_PER_SEC; in setup_virtual_dp_monitor()
565 vgpu->display.port_num = port_num; in setup_virtual_dp_monitor()
568 hrtimer_init(&vblank_timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); in setup_virtual_dp_monitor()
569 vblank_timer->timer.function = vblank_timer_fn; in setup_virtual_dp_monitor()
570 vblank_timer->vrefresh_k = port->vrefresh_k; in setup_virtual_dp_monitor()
571 …vblank_timer->period = DIV64_U64_ROUND_CLOSEST(NSEC_PER_SEC * MSEC_PER_SEC, vblank_timer->vrefresh… in setup_virtual_dp_monitor()
579 * vgpu_update_vblank_emulation - Update per-vGPU vblank_timer
583 * This function is used to turn on/off or update the per-vGPU vblank_timer
590 struct intel_vgpu_vblank_timer *vblank_timer = &vgpu->vblank_timer; in vgpu_update_vblank_emulation()
592 intel_vgpu_port(vgpu, vgpu->display.port_num); in vgpu_update_vblank_emulation()
596 * Skip the re-enable if already active and vrefresh unchanged. in vgpu_update_vblank_emulation()
600 if (vblank_timer->vrefresh_k != port->vrefresh_k || in vgpu_update_vblank_emulation()
601 !hrtimer_active(&vblank_timer->timer)) { in vgpu_update_vblank_emulation()
603 if (hrtimer_active(&vblank_timer->timer)) in vgpu_update_vblank_emulation()
604 hrtimer_cancel(&vblank_timer->timer); in vgpu_update_vblank_emulation()
607 vblank_timer->vrefresh_k = port->vrefresh_k; in vgpu_update_vblank_emulation()
608 …vblank_timer->period = DIV64_U64_ROUND_CLOSEST(NSEC_PER_SEC * MSEC_PER_SEC, vblank_timer->vrefresh… in vgpu_update_vblank_emulation()
609 hrtimer_start(&vblank_timer->timer, in vgpu_update_vblank_emulation()
610 ktime_add_ns(ktime_get(), vblank_timer->period), in vgpu_update_vblank_emulation()
615 hrtimer_cancel(&vblank_timer->timer); in vgpu_update_vblank_emulation()
621 struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915; in emulate_vblank_on_pipe()
622 struct intel_vgpu_irq *irq = &vgpu->irq; in emulate_vblank_on_pipe()
633 for_each_set_bit(event, irq->flip_done_event[pipe], in emulate_vblank_on_pipe()
635 clear_bit(event, irq->flip_done_event[pipe]); in emulate_vblank_on_pipe()
652 mutex_lock(&vgpu->vgpu_lock); in intel_vgpu_emulate_vblank()
653 for_each_pipe(vgpu->gvt->gt->i915, pipe) in intel_vgpu_emulate_vblank()
655 mutex_unlock(&vgpu->vgpu_lock); in intel_vgpu_emulate_vblank()
659 * intel_vgpu_emulate_hotplug - trigger hotplug event for vGPU
668 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; in intel_vgpu_emulate_hotplug()
749 * intel_vgpu_clean_display - clean vGPU virtual display emulation
752 * This function is used to clean vGPU virtual display emulation stuffs
757 struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915; in intel_vgpu_clean_display()
771 * intel_vgpu_init_display- initialize vGPU virtual display emulation
775 * This function is used to initialize vGPU virtual display emulation stuffs
783 struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915; in intel_vgpu_init_display()
799 * intel_vgpu_reset_display- reset vGPU virtual display emulation
802 * This function is used to reset vGPU virtual display emulation stuffs