public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Yu, Zhang" <yu.c.zhang@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 5/8] drm/i915: Add the display switch logic for vGPU in i915 driver
Date: Wed, 17 Dec 2014 11:17:37 +0800	[thread overview]
Message-ID: <5490F5D1.5050404@linux.intel.com> (raw)
In-Reply-To: <20141215081629.GU27182@phenom.ffwll.local>



On 12/15/2014 4:16 PM, Daniel Vetter wrote:
> On Thu, Nov 13, 2014 at 08:02:46PM +0800, Yu Zhang wrote:
>> Display switch logic is added to notify the host side 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 the host side. 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_vgpu.h |  7 +++++++
>>   2 files changed, 18 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
>> index 9a73533..06daa5c 100644
>> --- a/drivers/gpu/drm/i915/i915_dma.c
>> +++ b/drivers/gpu/drm/i915/i915_dma.c
>> @@ -36,6 +36,7 @@
>>   #include "intel_drv.h"
>>   #include <drm/i915_drm.h>
>>   #include "i915_drv.h"
>> +#include "i915_vgpu.h"
>>   #include "i915_trace.h"
>>   #include <linux/pci.h>
>>   #include <linux/console.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_vgpu.h b/drivers/gpu/drm/i915/i915_vgpu.h
>> index f538b18..9d35fb8 100644
>> --- a/drivers/gpu/drm/i915/i915_vgpu.h
>> +++ b/drivers/gpu/drm/i915/i915_vgpu.h
>> @@ -80,6 +80,13 @@ struct vgt_if {
>>   #define vgtif_reg(x) \
>>   	(VGT_PVINFO_PAGE + (long)&((struct vgt_if *) NULL)->x)
>>
>> +/* vGPU display status to be used by the host side */
>> +enum vgt_display_status {
>> +	VGT_DRV_DISPLAY_NOT_READY = 0,
>> +	VGT_DRV_DISPLAY_READY,  /* ready for display switch */
>> +};
>
> Nitpick: Since this is a virtual register I prefer we use plain #defines
> with explicit codes for everything instead of enums. Makes it clearer
> which values are used and all that.
> -Daniel
Got it. #define will be used. And I will rebase this patch.
>
Thanks
Yu
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-12-17  3:19 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 12:02 [PATCH v3 0/8] Add enlightenments for vGPU Yu Zhang
2014-11-13 12:02 ` [PATCH v3 1/8] drm/i915: Introduce a PV INFO page structure for Intel GVT-g Yu Zhang
2014-12-11 17:33   ` Tvrtko Ursulin
2014-12-15  8:12     ` Daniel Vetter
2014-12-16 12:51     ` Yu, Zhang
2014-12-16 13:19       ` Tvrtko Ursulin
2014-12-17  2:49         ` Yu, Zhang
2014-12-17  5:04           ` Tian, Kevin
2014-11-13 12:02 ` [PATCH v3 2/8] drm/i915: Adds graphic address space ballooning logic Yu Zhang
2014-11-14 10:16   ` Daniel Vetter
2014-11-14 12:00     ` Yu, Zhang
2014-12-12 13:00   ` Tvrtko Ursulin
2014-12-16 13:22     ` Yu, Zhang
2014-12-16 13:41       ` Tvrtko Ursulin
2014-12-16 14:39         ` Gerd Hoffmann
2014-12-16 15:15           ` Tvrtko Ursulin
2014-12-17  3:10             ` Yu, Zhang
2014-12-17  5:20               ` Tian, Kevin
2014-12-17 10:06                 ` Tvrtko Ursulin
2014-12-17  5:57     ` Tian, Kevin
2014-11-13 12:02 ` [PATCH v3 3/8] drm/i915: Partition the fence registers for vGPU in i915 driver Yu Zhang
2014-12-12 13:07   ` Tvrtko Ursulin
2014-12-16 13:32     ` Yu, Zhang
2014-12-16 13:44       ` Tvrtko Ursulin
2014-12-16 14:41         ` Gerd Hoffmann
2014-12-16 15:01           ` Tvrtko Ursulin
2014-12-17  7:33             ` Gerd Hoffmann
2014-12-17  9:59               ` Tvrtko Ursulin
2014-12-17 11:06                 ` Gerd Hoffmann
2014-12-17 11:25                   ` Yu, Zhang
2014-12-17 11:50                     ` Tvrtko Ursulin
2014-12-17 17:10                       ` Daniel Vetter
2014-12-17 17:11                         ` Daniel Vetter
2014-12-18  0:36                         ` Tian, Kevin
2014-12-18  8:08                           ` Daniel Vetter
2014-12-18  8:39                             ` Tian, Kevin
2014-12-17  4:58         ` Tian, Kevin
2014-11-13 12:02 ` [PATCH v3 4/8] drm/i915: Disable framebuffer compression for i915 driver in VM Yu Zhang
2014-12-12 13:13   ` Tvrtko Ursulin
2014-12-17  3:15     ` Yu, Zhang
2014-11-13 12:02 ` [PATCH v3 5/8] drm/i915: Add the display switch logic for vGPU in i915 driver Yu Zhang
2014-12-12 13:18   ` Tvrtko Ursulin
2014-12-15  8:16   ` Daniel Vetter
2014-12-17  3:17     ` Yu, Zhang [this message]
2014-11-13 12:02 ` [PATCH v3 6/8] drm/i915: Disable power management for i915 driver in VM Yu Zhang
2014-12-12 13:27   ` Tvrtko Ursulin
2014-12-17  3:25     ` Yu, Zhang
2014-11-13 12:02 ` [PATCH v3 7/8] drm/i915: Create vGPU specific write MMIO to reduce traps Yu Zhang
2014-12-12 13:31   ` Tvrtko Ursulin
2014-12-17  7:28     ` Yu, Zhang
2014-11-13 12:02 ` [PATCH v3 8/8] drm/i915: Support alias ppgtt in VM if ppgtt is enabled Yu Zhang
2014-11-14  0:29   ` [PATCH v3 8/8] drm/i915: Support alias ppgtt in VM if shuang.he
2014-12-12 13:37   ` [PATCH v3 8/8] drm/i915: Support alias ppgtt in VM if ppgtt is enabled Tvrtko Ursulin
2014-11-14 10:17 ` [PATCH v3 0/8] Add enlightenments for vGPU Daniel Vetter
2014-11-14 12:01   ` Yu, Zhang
2014-12-11 17:03 ` Tvrtko Ursulin
2014-12-15  8:18   ` Daniel Vetter
2014-12-15  9:16     ` Jani Nikula

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=5490F5D1.5050404@linux.intel.com \
    --to=yu.c.zhang@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    /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