From: Yu Zhang <yu.c.zhang@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 5/8] drm/i915: Add the display switch logic for vgpu in i915 driver
Date: Fri, 17 Oct 2014 13:37:16 +0800 [thread overview]
Message-ID: <1413524239-8614-6-git-send-email-yu.c.zhang@linux.intel.com> (raw)
In-Reply-To: <1413524239-8614-1-git-send-email-yu.c.zhang@linux.intel.com>
Display switch logic is added to notify the vgt mediator that
current vgpu have a valid surface to show. It does so by writing
the display_ready field in PV INFO page, and then will be handled
in vgt mediator. This is useful to avoid trickiness when the VM's
framebuffer is being accessed in the middle of VM modesetting,
e.g. compositing the framebuffer in the host side.
v2:
- move the notification code outside the 'else' in load sequence
- remove the notification code in intel_crtc_set_config()
Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
Signed-off-by: Jike Song <jike.song@intel.com>
Signed-off-by: Zhiyuan Lv <zhiyuan.lv@intel.com>
---
drivers/gpu/drm/i915/i915_dma.c | 11 +++++++++++
drivers/gpu/drm/i915/i915_vgt_if.h | 8 ++++++++
2 files changed, 19 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 85d14e1..3a42b11 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -35,6 +35,7 @@
#include <drm/drm_legacy.h>
#include "intel_drv.h"
#include <drm/i915_drm.h>
+#include "i915_vgt_if.h"
#include "i915_drv.h"
#include "i915_trace.h"
#include <linux/pci.h>
@@ -1780,6 +1781,16 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
dev_priv->ums.mm_suspended = 1;
}
+ if (intel_vgpu_active(dev)) {
+ /*
+ * Notify a valid surface after modesetting,
+ * when running inside a VM.
+ */
+ struct drm_i915_private *dev_priv = to_i915(dev);
+
+ I915_WRITE(vgtif_reg(display_ready), VGT_DRV_DISPLAY_READY);
+ }
+
i915_setup_sysfs(dev);
if (INTEL_INFO(dev)->num_pipes) {
diff --git a/drivers/gpu/drm/i915/i915_vgt_if.h b/drivers/gpu/drm/i915/i915_vgt_if.h
index fa45d28..633f98a 100644
--- a/drivers/gpu/drm/i915/i915_vgt_if.h
+++ b/drivers/gpu/drm/i915/i915_vgt_if.h
@@ -82,4 +82,12 @@ struct vgt_if {
#define vgtif_reg(x) \
(VGT_PVINFO_PAGE + (long)&((struct vgt_if *) NULL)->x)
+/*
+ * The information set by the guest gfx driver, through the display_ready field
+ */
+enum vgt_display_status {
+ VGT_DRV_DISPLAY_NOT_READY = 0,
+ VGT_DRV_DISPLAY_READY, /* ready for display switch */
+};
+
#endif /* _I915_VGT_IF_H_ */
--
1.9.1
next prev parent reply other threads:[~2014-10-17 6:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-17 5:37 [PATCH v2 0/8] Add enlightenments for vGPU Yu Zhang
2014-10-17 5:37 ` [PATCH v2 1/8] drm/i915: Introduce a PV INFO page structure for Intel GVT-g Yu Zhang
2014-10-17 5:37 ` [PATCH v2 2/8] drm/i915: Adds graphic address space ballooning logic Yu Zhang
2014-10-17 5:37 ` [PATCH v2 3/8] drm/i915: Partition the fence registers for vgpu in i915 driver Yu Zhang
2014-10-17 5:37 ` [PATCH v2 4/8] drm/i915: Disable framebuffer compression for i915 driver in VM Yu Zhang
2014-10-17 5:37 ` Yu Zhang [this message]
2014-10-17 5:37 ` [PATCH v2 6/8] drm/i915: Disable power management " Yu Zhang
2014-10-17 5:37 ` [PATCH v2 7/8] drm/i915: Create vgpu specific write MMIO to reduce traps Yu Zhang
2014-10-17 5:37 ` [PATCH v2 8/8] drm/i915: Support alias ppgtt in VM if ppgtt is enabled Yu Zhang
2014-10-21 16:16 ` [PATCH v2 0/8] Add enlightenments for vGPU Daniel Vetter
2014-10-21 16:51 ` Daniel Vetter
2014-10-22 7:03 ` Yu, Zhang
2014-10-22 10:27 ` Daniel Vetter
2014-10-22 6:56 ` Yu, Zhang
-- strict thread matches above, loose matches on Subject: below --
2014-10-16 6:24 Yu Zhang
2014-10-16 6:24 ` [PATCH v2 5/8] drm/i915: Add the display switch logic for vgpu in i915 driver Yu Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1413524239-8614-6-git-send-email-yu.c.zhang@linux.intel.com \
--to=yu.c.zhang@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox