[PATCH v3] drm/i915/gvt: Add support for opregion virtualization

Zhang, Xiaolin xiaolin.zhang at intel.com
Fri Sep 8 05:45:24 UTC 2017


On 09/08/2017 10:42 AM, Zhenyu Wang wrote:
> On 2017.09.08 02:27:07 +0000, Zhang, Xiaolin wrote:
>> On 09/07/2017 11:22 AM, Zhenyu Wang wrote:
>>> On 2017.09.07 00:00:22 +0800, Xiaolin Zhang wrote:
>>>> opregion emulated with a copy from host which leads to some display
>>>> bugs such as guest resolution adjustment failure due to host opregion
>>>> fail to claim port D support. with a fake opregion table provided
>>>> to fully emulate opregion to meet guest port requirement.
>>>>
>>>> v1 - initial patch
>>>> v2 - reforamt opregion arrary with 0x02x output
>>>> v3 - opregion array removed with opregion generation on host initizaiton
>>>>
>>> How about testing result of this? Looks much promising to me. Thanks.
>> thanks your review. I conducted the test with SKL and BDW NUC with linux
>> and windows guest, all passed.
>> BTW, this patch is against tip of stable 4.12 branch. I will submit
>> another version patch
>> against staging branch for review.
> Good!
>
>>>> diff --git a/drivers/gpu/drm/i915/gvt/opregion.c b/drivers/gpu/drm/i915/gvt/opregion.c
>>>> index 3225c34..d2ec7c9 100644
>>>> --- a/drivers/gpu/drm/i915/gvt/opregion.c
>>>> +++ b/drivers/gpu/drm/i915/gvt/opregion.c
>>>> @@ -26,9 +26,129 @@
>>>>  #include "i915_drv.h"
>>>>  #include "gvt.h"
>>>>  
>>>> +#define _INTEL_BIOS_PRIVATE
>>>> +#include "intel_vbt_defs.h"
> Asked Jani about this. He agreed to include this for gvt usage,
> but pls add a comment to say this is an exception, e.g
>
> /* Note: Only for GVT-g virtual VBT generation, other usage must
>    not do like this. */
added in v4 patch. thanks for you information.
>
>>>> +
>>>> +#define OPREGION_SIGNATURE "IntelGraphicsMem"
>>>> +#define MBOX_VBT      (1<<3)
>>>> +
>>>> +/* device handle */
>>>> +#define DEVICE_TYPE_CRT 	0x01
>>>> +#define DEVICE_TYPE_EFP1	0x04
>>>> +#define DEVICE_TYPE_EFP2	0x40
>>>> +#define DEVICE_TYPE_EFP3	0x20
>>>> +#define DEVICE_TYPE_EFP4	0x10
>>>> +
>>>> +#define DEV_SIZE	38
>>>> +
>>>> +struct opregion_header {
>>>> +	u8 signature[16];
>>>> +	u32 size;
>>>> +	u32 opregion_ver;
>>>> +	u8 bios_ver[32];
>>>> +	u8 vbios_ver[16];
>>>> +	u8 driver_ver[16];
>>>> +	u32 mboxes;
>>>> +	u32 driver_model;
>>>> +	u32 pcon;
>>>> +	u8 dver[32];
>>>> +	u8 rsvd[124];
>>>> +} __packed;
>>>> +
>>>> +struct bdb_data_header {
>>>> +	uint8_t id;
>>>> +	uint16_t size; /* data size */
> Just align to use kernel type, u8, u16.
correction done in v4 patch.
>



More information about the intel-gvt-dev mailing list