Date   

[PATCH v2 1/3] dm: vdisplay: Remove modes filter in EDID generation

Sun, Peng
 

From: Sun Peng <peng.p.sun@...>

All the modes that vdisplay supported should be reported to driver,
then driver should select the modes which report to OS.

Tracked-On: #7507
Signed-off-by: Sun Peng <peng.p.sun@...>
---
devicemodel/hw/vdisplay_sdl.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/devicemodel/hw/vdisplay_sdl.c b/devicemodel/hw/vdisplay_sdl.c
index 1e83bc7ba..cc7a2a9ea 100644
--- a/devicemodel/hw/vdisplay_sdl.c
+++ b/devicemodel/hw/vdisplay_sdl.c
@@ -142,8 +142,6 @@ typedef struct frame_param{
typedef struct base_param{
uint32_t h_pixel; // pixels
uint32_t v_pixel; // lines
- uint32_t h_pixelmax;
- uint32_t v_pixelmax;
uint32_t rate; // Hz
uint32_t width; // mm
uint32_t height; // mm
@@ -161,8 +159,6 @@ vdpy_edid_set_baseparam(base_param *b_param, uint32_t width, uint32_t height)
{
b_param->h_pixel = width;
b_param->v_pixel = height;
- b_param->h_pixelmax = 0;
- b_param->v_pixelmax = 0;
b_param->rate = 60;
b_param->width = width;
b_param->height = height;
@@ -252,24 +248,21 @@ vdpy_edid_set_timing(uint8_t *addr, const base_param *b_param, TIMING_MODE mode)
size = sizeof(timings) / sizeof(timings[0]);
for(; idx < size; idx++){
timing = timings + idx;
- if ((b_param->h_pixelmax && b_param->h_pixelmax < timing->hpixel) ||
- (b_param->v_pixelmax && b_param->v_pixelmax < timing->vpixel)) {
- continue;
- }
+
switch(mode){
case ESTT: // Established Timings I & II
if(timing->byte) {
addr[timing->byte] |= (1 << timing->bit);
break;
} else {
- return;
+ continue;
}
case ESTT3: // Established Timings III
if(timing->byte_t3){
addr[timing->byte_t3] |= (1 << timing->bit);
break;
} else {
- return;
+ continue;
}
case STDT: // Standard Timings
if(stdcnt < 8 && timing->is_std) {
@@ -311,7 +304,7 @@ vdpy_edid_set_timing(uint8_t *addr, const base_param *b_param, TIMING_MODE mode)
}
break;
default:
- return;
+ continue;
}
}
while(mode == STDT && stdcnt < 8){
--
2.25.1


[PATCH v2 0/3] Fix patches to acrn-8899

Sun, Peng
 

From: Sun Peng <peng.p.sun@...>

v2: Split into 3 patches.

Sun Peng (3):
dm: vdisplay: Remove modes filter in EDID generation
dm: vdisplay: Remove 1280x720 resolution
dm: vdisplay: add modes supported by Windows virtio-gpu driver

devicemodel/hw/vdisplay_sdl.c | 48 +++++++++++++++--------------------
1 file changed, 21 insertions(+), 27 deletions(-)

--
2.25.1


Re: [RFC PATCH] misc: Add new acrn:widget-options: ui-applicable-vms

Junjie Mao
 

<yifan1.liu@...> writes:

From: Yifan Liu <yifan1.liu@...>

In some cases we would like the "acrn:applicable-vms" property to be
effective only in UI. E.g., we would like to hide cpu affinity
configurations from Service VM, but acrn:applicable-vms would prevent
from configuring via XML too.
The cpu_affinity settings of the service VM have no effect today no
matter they are configured by the configurator or by editing the
scenario XML directly. Today a user who wants to further restrict the
service VM cores does so by explicitly offlining some cores from the
service VM.

In that case, why not simply drop the cpu_affinity items under a
service VM in the XML schema for now? We can bring it back later when
explicit offlining is no longer needed.

--
Best Regards
Junjie Mao

This patch adds support for a new option 'ui-applicable-vms' under
acrn:widget-option, with the same usage as acrn:applicable-vms.

Signed-off-by: Yifan Liu <yifan1.liu@...>
---
.../configurator/pyodide/loadBoard.py | 23 ++++++++++++++++++-
misc/config_tools/schema/config.xsd | 2 +-
2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/misc/config_tools/configurator/pyodide/loadBoard.py b/misc/config_tools/configurator/pyodide/loadBoard.py
index 41441bf88..46220c23e 100644
--- a/misc/config_tools/configurator/pyodide/loadBoard.py
+++ b/misc/config_tools/configurator/pyodide/loadBoard.py
@@ -58,6 +58,21 @@ def get_dynamic_scenario(board):
obj['enum'] = dynamic_enum(**enum_setting)
return obj

+ def ui_element_slicer(obj, vm_type, config_type):
+ def is_element_needed(ele):
+ if isinstance(ele, dict) and 'ui:options' in ele.keys():
+ if isinstance(ele['ui:options'], dict) and 'ui-applicable-vms' in ele['ui:options']:
+ if vm_type not in [t.strip() for t in ele['ui:options']['ui-applicable-vms'].split(',')]:
+ return False
+ return True
+
+ if isinstance(obj, list):
+ return [ui_element_slicer(e, vm_type, config_type) for e in obj if is_element_needed(e)]
+ elif isinstance(obj, dict):
+ return {k: ui_element_slicer(v, vm_type, config_type) for k, v in obj.items() if is_element_needed(v)}
+ else:
+ return obj
+
data = json.loads(scenario_json_schema, object_hook=dynamic_enum_apply)

form_schemas = {}
@@ -70,7 +85,13 @@ def get_dynamic_scenario(board):
current_form_type_schema_obj = form_schema['definitions'][f'{tab_type}{form_type}']
for key in ['type', 'required', 'properties']:
form_schema[key] = current_form_type_schema_obj[key]
- form_schemas[tab_type][form_type] = form_schema
+ vm_type = {
+ 'HV': 'HV',
+ 'PreLaunchedVM': 'pre-launched',
+ 'ServiceVM': 'service-vm',
+ 'PostLaunchedVM': 'post-launched',
+ }[tab_type]
+ form_schemas[tab_type][form_type] = ui_element_slicer(form_schema, vm_type, form_type)

return form_schemas

diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index efebaa863..5ae93fc8c 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -377,7 +377,7 @@ Refer to :ref:`vuart_config` for detailed vUART settings.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="cpu_affinity" type="CPUAffinityConfigurations" minOccurs="0">
- <xs:annotation acrn:title="Physical CPU affinity" acrn:views="basic">
+ <xs:annotation acrn:title="Physical CPU affinity" acrn:views="basic" acrn:widget-options="'ui-applicable-vms': 'pre-launched, post-launched'">
<xs:documentation>Select a subset of physical CPUs that this VM can use. More than one can be selected.</xs:documentation>
</xs:annotation>
</xs:element>


Re: [PATCH v2] config_tools: hide tty and sock in UI

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

For virtio console, in order to hide tty and sock backend types,
change "xs:sequence" to "xs:all" in the XML schema
to slice the backend type list and update backend type to
"BasicVirtioConsoleBackendType" to call the sliced value.

v1-->v2:
1. change "xs:sequence" to "xs:all" in the XML schema
to slice the backend type list.
2. update the commit message.

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@...>
Reviewed-by: Junjie Mao <junjie.mao@...>

--
Best Regards
Junjie Mao

---
.../pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/schema/VMtypes.xsd | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index bf4943cdd..f75ff9bc0 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -96,7 +96,7 @@ export default {
data() {
return {
ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
- ConsoleBackendType: this.rootSchema.definitions['VirtioConsoleBackendType']['enum'],
+ ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
},
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index 91fd76cd6..ea612e144 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -362,7 +362,7 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
</xs:simpleType>

<xs:complexType name="VirtioConsoleConfiguration">
- <xs:sequence>
+ <xs:all>
<xs:element name="use_type" type="VirtioConsoleUseType" minOccurs="0">
<xs:annotation acrn:title="Use type">
<xs:documentation>Specify device type in guest, ether HVC console when user config it as virtio console or /dev/vportXpY
@@ -389,7 +389,7 @@ device file when user config it as virtio serial port, which can be read and wri
<xs:documentation>The device path for the tty backend type.</xs:documentation>
</xs:annotation>
</xs:element>
- </xs:sequence>
+ </xs:all>
</xs:complexType>

<xs:complexType name="VirtioInputConfiguration">


[RFC PATCH] misc: Add new acrn:widget-options: ui-applicable-vms

Liu, Yifan1
 

From: Yifan Liu <yifan1.liu@...>

In some cases we would like the "acrn:applicable-vms" property to be
effective only in UI. E.g., we would like to hide cpu affinity
configurations from Service VM, but acrn:applicable-vms would prevent
from configuring via XML too.

This patch adds support for a new option 'ui-applicable-vms' under
acrn:widget-option, with the same usage as acrn:applicable-vms.

Signed-off-by: Yifan Liu <yifan1.liu@...>
---
.../configurator/pyodide/loadBoard.py | 23 ++++++++++++++++++-
misc/config_tools/schema/config.xsd | 2 +-
2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/misc/config_tools/configurator/pyodide/loadBoard.py b/misc/config_tools/configurator/pyodide/loadBoard.py
index 41441bf88..46220c23e 100644
--- a/misc/config_tools/configurator/pyodide/loadBoard.py
+++ b/misc/config_tools/configurator/pyodide/loadBoard.py
@@ -58,6 +58,21 @@ def get_dynamic_scenario(board):
obj['enum'] = dynamic_enum(**enum_setting)
return obj

+ def ui_element_slicer(obj, vm_type, config_type):
+ def is_element_needed(ele):
+ if isinstance(ele, dict) and 'ui:options' in ele.keys():
+ if isinstance(ele['ui:options'], dict) and 'ui-applicable-vms' in ele['ui:options']:
+ if vm_type not in [t.strip() for t in ele['ui:options']['ui-applicable-vms'].split(',')]:
+ return False
+ return True
+
+ if isinstance(obj, list):
+ return [ui_element_slicer(e, vm_type, config_type) for e in obj if is_element_needed(e)]
+ elif isinstance(obj, dict):
+ return {k: ui_element_slicer(v, vm_type, config_type) for k, v in obj.items() if is_element_needed(v)}
+ else:
+ return obj
+
data = json.loads(scenario_json_schema, object_hook=dynamic_enum_apply)

form_schemas = {}
@@ -70,7 +85,13 @@ def get_dynamic_scenario(board):
current_form_type_schema_obj = form_schema['definitions'][f'{tab_type}{form_type}']
for key in ['type', 'required', 'properties']:
form_schema[key] = current_form_type_schema_obj[key]
- form_schemas[tab_type][form_type] = form_schema
+ vm_type = {
+ 'HV': 'HV',
+ 'PreLaunchedVM': 'pre-launched',
+ 'ServiceVM': 'service-vm',
+ 'PostLaunchedVM': 'post-launched',
+ }[tab_type]
+ form_schemas[tab_type][form_type] = ui_element_slicer(form_schema, vm_type, form_type)

return form_schemas

diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index efebaa863..5ae93fc8c 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -377,7 +377,7 @@ Refer to :ref:`vuart_config` for detailed vUART settings.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="cpu_affinity" type="CPUAffinityConfigurations" minOccurs="0">
- <xs:annotation acrn:title="Physical CPU affinity" acrn:views="basic">
+ <xs:annotation acrn:title="Physical CPU affinity" acrn:views="basic" acrn:widget-options="'ui-applicable-vms': 'pre-launched, post-launched'">
<xs:documentation>Select a subset of physical CPUs that this VM can use. More than one can be selected.</xs:documentation>
</xs:annotation>
</xs:element>
--
2.32.0.windows.2


[PATCH v2] config_tools: hide tty and sock in UI

Kunhui Li
 

For virtio console, in order to hide tty and sock backend types,
change "xs:sequence" to "xs:all" in the XML schema
to slice the backend type list and update backend type to
"BasicVirtioConsoleBackendType" to call the sliced value.

v1-->v2:
1. change "xs:sequence" to "xs:all" in the XML schema
to slice the backend type list.
2. update the commit message.

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/schema/VMtypes.xsd | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index bf4943cdd..f75ff9bc0 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -96,7 +96,7 @@ export default {
data() {
return {
ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
- ConsoleBackendType: this.rootSchema.definitions['VirtioConsoleBackendType']['enum'],
+ ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
},
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index 91fd76cd6..ea612e144 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -362,7 +362,7 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
</xs:simpleType>

<xs:complexType name="VirtioConsoleConfiguration">
- <xs:sequence>
+ <xs:all>
<xs:element name="use_type" type="VirtioConsoleUseType" minOccurs="0">
<xs:annotation acrn:title="Use type">
<xs:documentation>Specify device type in guest, ether HVC console when user config it as virtio console or /dev/vportXpY
@@ -389,7 +389,7 @@ device file when user config it as virtio serial port, which can be read and wri
<xs:documentation>The device path for the tty backend type.</xs:documentation>
</xs:annotation>
</xs:element>
- </xs:sequence>
+ </xs:all>
</xs:complexType>

<xs:complexType name="VirtioInputConfiguration">
--
2.25.1


Re: [PATCH 1/2] config_tools: hide tty and sock in UI

Kunhui Li
 

-----Original Message-----
From: Mao, Junjie <junjie.mao@...>
Sent: Monday, May 23, 2022 8:06 AM
To: Li, KunhuiX <kunhuix.li@...>
Cc: acrn-dev@...; Xie, Nanlin <nanlin.xie@...>; Feng, WeiyiX <weiyix.feng@...>
Subject: Re: [PATCH 1/2] config_tools: hide tty and sock in UI

Kunhui-Li <kunhuix.li@...> writes:

1. update schema_slicer.py to slice xs:sequence elements.
2. update backend type to "BasicVirtioConsoleBackendType" to call the
sliced value.

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/scenario_config/schema_slicer.py | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index bf4943cdd..f75ff9bc0 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -96,7 +96,7 @@ export default {
data() {
return {
ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
- ConsoleBackendType: this.rootSchema.definitions['VirtioConsoleBackendType']['enum'],
+ ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
},
diff --git a/misc/config_tools/scenario_config/schema_slicer.py b/misc/config_tools/scenario_config/schema_slicer.py
index 26f29fed8..a7232b659 100755
--- a/misc/config_tools/scenario_config/schema_slicer.py
+++ b/misc/config_tools/scenario_config/schema_slicer.py
@@ -107,6 +107,10 @@ class SchemaTypeSlicer:
if element_list_node is not None:
sliced = self.slice_element_list(element_list_node, new_nodes)

+ element_list_node = self.get_node(new_type_node, "xs:sequence")
+ if element_list_node is not None:
+ sliced = self.slice_element_list(element_list_node, new_nodes)
+
The slicing algorithm is designed not to touch sequences because they
are ordered lists of nodes and the removal of some in the middle creates
a different list which is not compatible with the original.

Change "xs:sequence" to "xs:all" in the XML schema for lists you want to
slice instead.
Will update.

--
Best Regards
Junjie Mao

restriction_node = self.get_node(new_type_node, "xs:restriction")
if restriction_node is not None:
sliced = self.slice_restriction(restriction_node)


Re: [PATCH v1] dm: vdisplay: add modes supported by Windows virtio-gpu driver

Yu Wang
 

On Fri, May 20, 2022 at 04:41:20PM +0800, Sun, Peng wrote:
On Fri, 2022-05-20 at 15:32 +0800, Yu Wang wrote:
On Wed, May 18, 2022 at 04:31:18PM +0800,
peng.p.sun@... wrote:
From: Sun Peng <peng.p.sun@...>

Add 1280x1024@75, 1024x768@75, 1600x1200@60, 1600x900@60 modes.
Also you have removed 720p and changed the default one, right?

Please update the commit message.
[Sun, Peng] Correct, I remove it. I will update the commit message in
next version.


Tracked-On: #7507
Signed-off-by: Sun Peng <peng.p.sun@...>
---
 devicemodel/hw/vdisplay_sdl.c | 48 +++++++++++++++++--------------
----
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/devicemodel/hw/vdisplay_sdl.c
b/devicemodel/hw/vdisplay_sdl.c
index 1e83bc7ba..5944ac73a 100644
--- a/devicemodel/hw/vdisplay_sdl.c
+++ b/devicemodel/hw/vdisplay_sdl.c
@@ -27,13 +27,13 @@
 
 #define VDPY_MAX_WIDTH 1920
 #define VDPY_MAX_HEIGHT 1080
-#define VDPY_DEFAULT_WIDTH 1280
-#define VDPY_DEFAULT_HEIGHT 720
+#define VDPY_DEFAULT_WIDTH 1024
+#define VDPY_DEFAULT_HEIGHT 768
 #define VDPY_MIN_WIDTH 640
 #define VDPY_MIN_HEIGHT 480
 #define transto_10bits(color) (uint16_t)(color * 1024 + 0.5)
 
-static unsigned char default_raw_argb[640 * 480 * 4];
+static unsigned char default_raw_argb[VDPY_DEFAULT_WIDTH *
VDPY_DEFAULT_HEIGHT * 4];
 
 struct state {
        bool is_ui_realized;
@@ -108,15 +108,18 @@ static const struct timing_entry {
        bool    is_std; // the flag of standard mode
 } timings[] = {
        /* Established Timings I & II (all @ 60Hz) */
+       { .hpixel = 1280, .vpixel = 1024, .byte  = 36, .bit = 0,
.hz = 75},
+       { .hpixel = 1024, .vpixel =  768, .byte  = 36, .bit = 1,
.hz = 75},
        { .hpixel = 1024, .vpixel =  768, .byte  = 36, .bit = 3,
.hz = 60},
        { .hpixel =  800, .vpixel =  600, .byte  = 35, .bit = 0,
.hz = 60 },
        { .hpixel =  640, .vpixel =  480, .byte  = 35, .bit = 5,
.hz = 60 },
 
        /* Standard Timings */
        { .hpixel = 1920, .vpixel = 1080, .hz = 60,  .is_std = true
},
-       { .hpixel = 1280, .vpixel =  720, .hz = 60,  .is_std = true
},
+       { .hpixel = 1680, .vpixel = 1050, .hz = 60,  .is_std = true
},
+       { .hpixel = 1600, .vpixel = 1200, .hz = 60,  .is_std = true
},
+       { .hpixel = 1600, .vpixel =  900, .hz = 60,  .is_std = true
},
        { .hpixel = 1440, .vpixel =  900, .hz = 60,  .is_std = true
},
-       { .hpixel = 1680, .vpixel =  1050, .hz = 60, .is_std = true
},
 };
 
 typedef struct frame_param{
@@ -161,8 +164,8 @@ vdpy_edid_set_baseparam(base_param *b_param,
uint32_t width, uint32_t height)
 {
        b_param->h_pixel = width;
        b_param->v_pixel = height;
-       b_param->h_pixelmax = 0;
-       b_param->v_pixelmax = 0;
+       b_param->h_pixelmax = width;
+       b_param->v_pixelmax = height;
        b_param->rate = 60;
        b_param->width = width;
        b_param->height = height;
@@ -252,24 +255,21 @@ vdpy_edid_set_timing(uint8_t *addr, const
base_param *b_param, TIMING_MODE mode)
        size = sizeof(timings) / sizeof(timings[0]);
        for(; idx < size; idx++){
                timing = timings + idx;
-               if ((b_param->h_pixelmax && b_param->h_pixelmax <
timing->hpixel) ||
-                   (b_param->v_pixelmax && b_param->v_pixelmax <
timing->vpixel)) {
-                       continue;
After remove these 3 lines, the h_pixelmax, v_pixelmax and b_param
are
meaningless, right?
[Sun, Peng] Yes.
Then please remove these useless varaibles.


BTW, what is this logic for? If it is another logic, please submit
another patch.
[Sun, Peng] We don't want user use the resolutions which bigger than
window size for simple. But HSPE's UMD driver allow this behavior. Our
limitation will be meanless. So, I remove these lines.
Please submit another patch for this logic.


-               }
+
                switch(mode){
                case ESTT: // Established Timings I & II
                        if(timing->byte) {
                                addr[timing->byte] |= (1 << timing-
bit);
                                break;
                        } else {
-                               return;
+                               continue;
                        }
                case ESTT3: // Established Timings III
                        if(timing->byte_t3){
                                addr[timing->byte_t3] |= (1 <<
timing->bit);
                                break;
                        } else {
-                               return;
+                               continue;
                        }
                case STDT: // Standard Timings
                        if(stdcnt < 8 && timing->is_std) {
@@ -311,7 +311,7 @@ vdpy_edid_set_timing(uint8_t *addr, const
base_param *b_param, TIMING_MODE mode)
                        }
                        break;
                default:
-                       return;
+                       continue;
                }
        }
        while(mode == STDT && stdcnt < 8){
@@ -429,7 +429,7 @@ vdpy_edid_generate(uint8_t *edid, size_t size,
struct edid_info *info)
        uint16_t id_product;
        uint32_t serial;
        uint8_t *desc;
-       base_param b_param, c_param;
+       base_param b_param;
 
        vdpy_edid_set_baseparam(&b_param, info->prefx, info-
prefy);
@@ -493,14 +493,12 @@ vdpy_edid_generate(uint8_t *edid, size_t
size, struct edid_info *info)
        vdpy_edid_set_timing(edid, &b_param, STDT);
 
        /* edid[125:54], Detailed Timing Descriptor - 18 bytes x 4
*/
-       // Detailed Timing Descriptor 1
+       // Preferred Timing Mode
        desc = edid + 54;
-       vdpy_edid_set_baseparam(&c_param, VDPY_MAX_WIDTH,
VDPY_MAX_HEIGHT);
-       vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
-       // Detailed Timing Descriptor 2
+       vdpy_edid_set_descripter(desc, 0x1, 0, &b_param);
+       // iDisplay Range Limits & Additional Timing Descriptor
(tag #FDh)
        desc += 18;
-       vdpy_edid_set_baseparam(&c_param, VDPY_DEFAULT_WIDTH,
VDPY_DEFAULT_HEIGHT);
-       vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
+       vdpy_edid_set_descripter(desc, 0, 0xfd, &b_param);
        // Display Product Name (ASCII) String Descriptor (tag
#FCh)
        desc += 18;
        vdpy_edid_set_descripter(desc, 0, 0xfc, &b_param);
@@ -526,10 +524,10 @@ vdpy_get_edid(int handle, uint8_t *edid,
size_t size)
                edid_info.maxx = VDPY_MAX_WIDTH;
                edid_info.maxy = VDPY_MAX_HEIGHT;
        } else {
-               edid_info.prefx = 0;
-               edid_info.prefy = 0;
-               edid_info.maxx = 0;
-               edid_info.maxy = 0;
+               edid_info.prefx = VDPY_DEFAULT_WIDTH;
+               edid_info.prefy = VDPY_DEFAULT_HEIGHT;
+               edid_info.maxx = VDPY_MAX_WIDTH;
+               edid_info.maxy = VDPY_MAX_HEIGHT;
        }
        edid_info.refresh_rate = 0;
        edid_info.vendor = NULL;
--
2.25.1



--
Sun Peng <peng.p.sun@...>
SSE/ACRN Upstream





Re: [PATCH] misc: fix the physical memory segmentation UI issue

Junjie Mao
 

"chenli.wei" <chenli.wei@...> writes:

Current physical memory segmentation UI have an redundant title when
user select the advance mode, so we set the MemoryInfo element title
to NULL to fix this issue.

Signed-off-by: Chenli Wei <chenli.wei@...>
Reviewed-by: Junjie Mao <junjie.mao@...>

--
Best Regards
Junjie Mao

---
misc/config_tools/schema/config.xsd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index 006a5ad9f..499b19fbd 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -393,7 +393,7 @@ Refer SDM 17.19.2 for details, and use with caution.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="memory" type="MemoryInfo" minOccurs="0">
- <xs:annotation acrn:title="Memory allocation" acrn:views="basic, advanced" acrn:applicable-vms="pre-launched, post-launched">
+ <xs:annotation acrn:title="" acrn:views="basic, advanced" acrn:applicable-vms="pre-launched, post-launched">
</xs:annotation>
</xs:element>
<xs:element name="priority" type="PriorityType" default="PRIO_LOW">


Re: [PATCH 2/2] config_tools: add restriction for Maximum Virtual CLOS configuration

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

Add restriction for Maximum Virtual CLOS configuration that don't allow
negative numbers.

Tracked-On: #7530
Signed-off-by: Kunhui-Li <kunhuix.li@...>
Reviewed-by: Junjie Mao <junjie.mao@...>

--
Best Regards
Junjie Mao

---
misc/config_tools/schema/config.xsd | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index 006a5ad9f..02367ba6d 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -351,10 +351,18 @@ Refer to :ref:`vuart_config` for detailed vUART settings.</xs:documentation>
<xs:documentation>Enable nested virtualization for KVM.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="virtual_cat_number" type="xs:integer" default="0" minOccurs="0">
+ <xs:element name="virtual_cat_number" default="0" minOccurs="0">
<xs:annotation acrn:title="Maximum virtual CLOS" acrn:applicable-vms="pre-launched, post-launched" acrn:views="advanced">
<xs:documentation>Max number of virtual CLOS MASK</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>Integer value is not below zero.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="0" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:element>
<xs:element name="virtual_cat_support" type="Boolean" default="n" minOccurs="0">
<xs:annotation acrn:title="VM Virtual Cache Allocation Tech" acrn:applicable-vms="pre-launched, post-launched" acrn:views="advanced">


Re: [PATCH 1/2] config_tools: hide tty and sock in UI

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

1. update schema_slicer.py to slice xs:sequence elements.
2. update backend type to "BasicVirtioConsoleBackendType" to call the
sliced value.

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/scenario_config/schema_slicer.py | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index bf4943cdd..f75ff9bc0 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -96,7 +96,7 @@ export default {
data() {
return {
ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
- ConsoleBackendType: this.rootSchema.definitions['VirtioConsoleBackendType']['enum'],
+ ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
},
diff --git a/misc/config_tools/scenario_config/schema_slicer.py b/misc/config_tools/scenario_config/schema_slicer.py
index 26f29fed8..a7232b659 100755
--- a/misc/config_tools/scenario_config/schema_slicer.py
+++ b/misc/config_tools/scenario_config/schema_slicer.py
@@ -107,6 +107,10 @@ class SchemaTypeSlicer:
if element_list_node is not None:
sliced = self.slice_element_list(element_list_node, new_nodes)

+ element_list_node = self.get_node(new_type_node, "xs:sequence")
+ if element_list_node is not None:
+ sliced = self.slice_element_list(element_list_node, new_nodes)
+
The slicing algorithm is designed not to touch sequences because they
are ordered lists of nodes and the removal of some in the middle creates
a different list which is not compatible with the original.

Change "xs:sequence" to "xs:all" in the XML schema for lists you want to
slice instead.

--
Best Regards
Junjie Mao

restriction_node = self.get_node(new_type_node, "xs:restriction")
if restriction_node is not None:
sliced = self.slice_restriction(restriction_node)


[PATCH] misc: fix the physical memory segmentation UI issue

chenli.wei
 

Current physical memory segmentation UI have an redundant title when
user select the advance mode, so we set the MemoryInfo element title
to NULL to fix this issue.

Signed-off-by: Chenli Wei <chenli.wei@...>
---
misc/config_tools/schema/config.xsd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index 006a5ad9f..499b19fbd 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -393,7 +393,7 @@ Refer SDM 17.19.2 for details, and use with caution.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="memory" type="MemoryInfo" minOccurs="0">
- <xs:annotation acrn:title="Memory allocation" acrn:views="basic, advanced" acrn:applicable-vms="pre-launched, post-launched">
+ <xs:annotation acrn:title="" acrn:views="basic, advanced" acrn:applicable-vms="pre-launched, post-launched">
</xs:annotation>
</xs:element>
<xs:element name="priority" type="PriorityType" default="PRIO_LOW">
--
2.17.1


[PATCH 2/2] config_tools: add restriction for Maximum Virtual CLOS configuration

Kunhui Li
 

Add restriction for Maximum Virtual CLOS configuration that don't allow
negative numbers.

Tracked-On: #7530
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
misc/config_tools/schema/config.xsd | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index 006a5ad9f..02367ba6d 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -351,10 +351,18 @@ Refer to :ref:`vuart_config` for detailed vUART settings.</xs:documentation>
<xs:documentation>Enable nested virtualization for KVM.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="virtual_cat_number" type="xs:integer" default="0" minOccurs="0">
+ <xs:element name="virtual_cat_number" default="0" minOccurs="0">
<xs:annotation acrn:title="Maximum virtual CLOS" acrn:applicable-vms="pre-launched, post-launched" acrn:views="advanced">
<xs:documentation>Max number of virtual CLOS MASK</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>Integer value is not below zero.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="0" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:element>
<xs:element name="virtual_cat_support" type="Boolean" default="n" minOccurs="0">
<xs:annotation acrn:title="VM Virtual Cache Allocation Tech" acrn:applicable-vms="pre-launched, post-launched" acrn:views="advanced">
--
2.25.1


[PATCH 1/2] config_tools: hide tty and sock in UI

Kunhui Li
 

1. update schema_slicer.py to slice xs:sequence elements.
2. update backend type to "BasicVirtioConsoleBackendType" to call the
sliced value.

Tracked-On: #6691
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/scenario_config/schema_slicer.py | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index bf4943cdd..f75ff9bc0 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -96,7 +96,7 @@ export default {
data() {
return {
ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
- ConsoleBackendType: this.rootSchema.definitions['VirtioConsoleBackendType']['enum'],
+ ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
},
diff --git a/misc/config_tools/scenario_config/schema_slicer.py b/misc/config_tools/scenario_config/schema_slicer.py
index 26f29fed8..a7232b659 100755
--- a/misc/config_tools/scenario_config/schema_slicer.py
+++ b/misc/config_tools/scenario_config/schema_slicer.py
@@ -107,6 +107,10 @@ class SchemaTypeSlicer:
if element_list_node is not None:
sliced = self.slice_element_list(element_list_node, new_nodes)

+ element_list_node = self.get_node(new_type_node, "xs:sequence")
+ if element_list_node is not None:
+ sliced = self.slice_element_list(element_list_node, new_nodes)
+
restriction_node = self.get_node(new_type_node, "xs:restriction")
if restriction_node is not None:
sliced = self.slice_restriction(restriction_node)
--
2.25.1


Re: [PATCH v1] dm: vdisplay: add modes supported by Windows virtio-gpu driver

Sun, Peng
 

On Fri, 2022-05-20 at 15:32 +0800, Yu Wang wrote:
On Wed, May 18, 2022 at 04:31:18PM +0800,
peng.p.sun@... wrote:
From: Sun Peng <peng.p.sun@...>

Add 1280x1024@75, 1024x768@75, 1600x1200@60, 1600x900@60 modes.
Also you have removed 720p and changed the default one, right?

Please update the commit message.
[Sun, Peng] Correct, I remove it. I will update the commit message in
next version.


Tracked-On: #7507
Signed-off-by: Sun Peng <peng.p.sun@...>
---
 devicemodel/hw/vdisplay_sdl.c | 48 +++++++++++++++++--------------
----
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/devicemodel/hw/vdisplay_sdl.c
b/devicemodel/hw/vdisplay_sdl.c
index 1e83bc7ba..5944ac73a 100644
--- a/devicemodel/hw/vdisplay_sdl.c
+++ b/devicemodel/hw/vdisplay_sdl.c
@@ -27,13 +27,13 @@
 
 #define VDPY_MAX_WIDTH 1920
 #define VDPY_MAX_HEIGHT 1080
-#define VDPY_DEFAULT_WIDTH 1280
-#define VDPY_DEFAULT_HEIGHT 720
+#define VDPY_DEFAULT_WIDTH 1024
+#define VDPY_DEFAULT_HEIGHT 768
 #define VDPY_MIN_WIDTH 640
 #define VDPY_MIN_HEIGHT 480
 #define transto_10bits(color) (uint16_t)(color * 1024 + 0.5)
 
-static unsigned char default_raw_argb[640 * 480 * 4];
+static unsigned char default_raw_argb[VDPY_DEFAULT_WIDTH *
VDPY_DEFAULT_HEIGHT * 4];
 
 struct state {
        bool is_ui_realized;
@@ -108,15 +108,18 @@ static const struct timing_entry {
        bool    is_std; // the flag of standard mode
 } timings[] = {
        /* Established Timings I & II (all @ 60Hz) */
+       { .hpixel = 1280, .vpixel = 1024, .byte  = 36, .bit = 0,
.hz = 75},
+       { .hpixel = 1024, .vpixel =  768, .byte  = 36, .bit = 1,
.hz = 75},
        { .hpixel = 1024, .vpixel =  768, .byte  = 36, .bit = 3,
.hz = 60},
        { .hpixel =  800, .vpixel =  600, .byte  = 35, .bit = 0,
.hz = 60 },
        { .hpixel =  640, .vpixel =  480, .byte  = 35, .bit = 5,
.hz = 60 },
 
        /* Standard Timings */
        { .hpixel = 1920, .vpixel = 1080, .hz = 60,  .is_std = true
},
-       { .hpixel = 1280, .vpixel =  720, .hz = 60,  .is_std = true
},
+       { .hpixel = 1680, .vpixel = 1050, .hz = 60,  .is_std = true
},
+       { .hpixel = 1600, .vpixel = 1200, .hz = 60,  .is_std = true
},
+       { .hpixel = 1600, .vpixel =  900, .hz = 60,  .is_std = true
},
        { .hpixel = 1440, .vpixel =  900, .hz = 60,  .is_std = true
},
-       { .hpixel = 1680, .vpixel =  1050, .hz = 60, .is_std = true
},
 };
 
 typedef struct frame_param{
@@ -161,8 +164,8 @@ vdpy_edid_set_baseparam(base_param *b_param,
uint32_t width, uint32_t height)
 {
        b_param->h_pixel = width;
        b_param->v_pixel = height;
-       b_param->h_pixelmax = 0;
-       b_param->v_pixelmax = 0;
+       b_param->h_pixelmax = width;
+       b_param->v_pixelmax = height;
        b_param->rate = 60;
        b_param->width = width;
        b_param->height = height;
@@ -252,24 +255,21 @@ vdpy_edid_set_timing(uint8_t *addr, const
base_param *b_param, TIMING_MODE mode)
        size = sizeof(timings) / sizeof(timings[0]);
        for(; idx < size; idx++){
                timing = timings + idx;
-               if ((b_param->h_pixelmax && b_param->h_pixelmax <
timing->hpixel) ||
-                   (b_param->v_pixelmax && b_param->v_pixelmax <
timing->vpixel)) {
-                       continue;
After remove these 3 lines, the h_pixelmax, v_pixelmax and b_param
are
meaningless, right?
[Sun, Peng] Yes.

BTW, what is this logic for? If it is another logic, please submit
another patch.
[Sun, Peng] We don't want user use the resolutions which bigger than
window size for simple. But HSPE's UMD driver allow this behavior. Our
limitation will be meanless. So, I remove these lines.

-               }
+
                switch(mode){
                case ESTT: // Established Timings I & II
                        if(timing->byte) {
                                addr[timing->byte] |= (1 << timing-
bit);
                                break;
                        } else {
-                               return;
+                               continue;
                        }
                case ESTT3: // Established Timings III
                        if(timing->byte_t3){
                                addr[timing->byte_t3] |= (1 <<
timing->bit);
                                break;
                        } else {
-                               return;
+                               continue;
                        }
                case STDT: // Standard Timings
                        if(stdcnt < 8 && timing->is_std) {
@@ -311,7 +311,7 @@ vdpy_edid_set_timing(uint8_t *addr, const
base_param *b_param, TIMING_MODE mode)
                        }
                        break;
                default:
-                       return;
+                       continue;
                }
        }
        while(mode == STDT && stdcnt < 8){
@@ -429,7 +429,7 @@ vdpy_edid_generate(uint8_t *edid, size_t size,
struct edid_info *info)
        uint16_t id_product;
        uint32_t serial;
        uint8_t *desc;
-       base_param b_param, c_param;
+       base_param b_param;
 
        vdpy_edid_set_baseparam(&b_param, info->prefx, info-
prefy);
@@ -493,14 +493,12 @@ vdpy_edid_generate(uint8_t *edid, size_t
size, struct edid_info *info)
        vdpy_edid_set_timing(edid, &b_param, STDT);
 
        /* edid[125:54], Detailed Timing Descriptor - 18 bytes x 4
*/
-       // Detailed Timing Descriptor 1
+       // Preferred Timing Mode
        desc = edid + 54;
-       vdpy_edid_set_baseparam(&c_param, VDPY_MAX_WIDTH,
VDPY_MAX_HEIGHT);
-       vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
-       // Detailed Timing Descriptor 2
+       vdpy_edid_set_descripter(desc, 0x1, 0, &b_param);
+       // iDisplay Range Limits & Additional Timing Descriptor
(tag #FDh)
        desc += 18;
-       vdpy_edid_set_baseparam(&c_param, VDPY_DEFAULT_WIDTH,
VDPY_DEFAULT_HEIGHT);
-       vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
+       vdpy_edid_set_descripter(desc, 0, 0xfd, &b_param);
        // Display Product Name (ASCII) String Descriptor (tag
#FCh)
        desc += 18;
        vdpy_edid_set_descripter(desc, 0, 0xfc, &b_param);
@@ -526,10 +524,10 @@ vdpy_get_edid(int handle, uint8_t *edid,
size_t size)
                edid_info.maxx = VDPY_MAX_WIDTH;
                edid_info.maxy = VDPY_MAX_HEIGHT;
        } else {
-               edid_info.prefx = 0;
-               edid_info.prefy = 0;
-               edid_info.maxx = 0;
-               edid_info.maxy = 0;
+               edid_info.prefx = VDPY_DEFAULT_WIDTH;
+               edid_info.prefy = VDPY_DEFAULT_HEIGHT;
+               edid_info.maxx = VDPY_MAX_WIDTH;
+               edid_info.maxy = VDPY_MAX_HEIGHT;
        }
        edid_info.refresh_rate = 0;
        edid_info.vendor = NULL;
--
2.25.1



--
Sun Peng <peng.p.sun@...>
SSE/ACRN Upstream


Re: [PATCH v1] dm: vdisplay: add modes supported by Windows virtio-gpu driver

Yu Wang
 

On Wed, May 18, 2022 at 04:31:18PM +0800, peng.p.sun@... wrote:
From: Sun Peng <peng.p.sun@...>

Add 1280x1024@75, 1024x768@75, 1600x1200@60, 1600x900@60 modes.
Also you have removed 720p and changed the default one, right?

Please update the commit message.


Tracked-On: #7507
Signed-off-by: Sun Peng <peng.p.sun@...>
---
devicemodel/hw/vdisplay_sdl.c | 48 +++++++++++++++++------------------
1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/devicemodel/hw/vdisplay_sdl.c b/devicemodel/hw/vdisplay_sdl.c
index 1e83bc7ba..5944ac73a 100644
--- a/devicemodel/hw/vdisplay_sdl.c
+++ b/devicemodel/hw/vdisplay_sdl.c
@@ -27,13 +27,13 @@

#define VDPY_MAX_WIDTH 1920
#define VDPY_MAX_HEIGHT 1080
-#define VDPY_DEFAULT_WIDTH 1280
-#define VDPY_DEFAULT_HEIGHT 720
+#define VDPY_DEFAULT_WIDTH 1024
+#define VDPY_DEFAULT_HEIGHT 768
#define VDPY_MIN_WIDTH 640
#define VDPY_MIN_HEIGHT 480
#define transto_10bits(color) (uint16_t)(color * 1024 + 0.5)

-static unsigned char default_raw_argb[640 * 480 * 4];
+static unsigned char default_raw_argb[VDPY_DEFAULT_WIDTH * VDPY_DEFAULT_HEIGHT * 4];

struct state {
bool is_ui_realized;
@@ -108,15 +108,18 @@ static const struct timing_entry {
bool is_std; // the flag of standard mode
} timings[] = {
/* Established Timings I & II (all @ 60Hz) */
+ { .hpixel = 1280, .vpixel = 1024, .byte = 36, .bit = 0, .hz = 75},
+ { .hpixel = 1024, .vpixel = 768, .byte = 36, .bit = 1, .hz = 75},
{ .hpixel = 1024, .vpixel = 768, .byte = 36, .bit = 3, .hz = 60},
{ .hpixel = 800, .vpixel = 600, .byte = 35, .bit = 0, .hz = 60 },
{ .hpixel = 640, .vpixel = 480, .byte = 35, .bit = 5, .hz = 60 },

/* Standard Timings */
{ .hpixel = 1920, .vpixel = 1080, .hz = 60, .is_std = true },
- { .hpixel = 1280, .vpixel = 720, .hz = 60, .is_std = true },
+ { .hpixel = 1680, .vpixel = 1050, .hz = 60, .is_std = true },
+ { .hpixel = 1600, .vpixel = 1200, .hz = 60, .is_std = true },
+ { .hpixel = 1600, .vpixel = 900, .hz = 60, .is_std = true },
{ .hpixel = 1440, .vpixel = 900, .hz = 60, .is_std = true },
- { .hpixel = 1680, .vpixel = 1050, .hz = 60, .is_std = true },
};

typedef struct frame_param{
@@ -161,8 +164,8 @@ vdpy_edid_set_baseparam(base_param *b_param, uint32_t width, uint32_t height)
{
b_param->h_pixel = width;
b_param->v_pixel = height;
- b_param->h_pixelmax = 0;
- b_param->v_pixelmax = 0;
+ b_param->h_pixelmax = width;
+ b_param->v_pixelmax = height;
b_param->rate = 60;
b_param->width = width;
b_param->height = height;
@@ -252,24 +255,21 @@ vdpy_edid_set_timing(uint8_t *addr, const base_param *b_param, TIMING_MODE mode)
size = sizeof(timings) / sizeof(timings[0]);
for(; idx < size; idx++){
timing = timings + idx;
- if ((b_param->h_pixelmax && b_param->h_pixelmax < timing->hpixel) ||
- (b_param->v_pixelmax && b_param->v_pixelmax < timing->vpixel)) {
- continue;
After remove these 3 lines, the h_pixelmax, v_pixelmax and b_param are
meaningless, right?

BTW, what is this logic for? If it is another logic, please submit
another patch.

- }
+
switch(mode){
case ESTT: // Established Timings I & II
if(timing->byte) {
addr[timing->byte] |= (1 << timing->bit);
break;
} else {
- return;
+ continue;
}
case ESTT3: // Established Timings III
if(timing->byte_t3){
addr[timing->byte_t3] |= (1 << timing->bit);
break;
} else {
- return;
+ continue;
}
case STDT: // Standard Timings
if(stdcnt < 8 && timing->is_std) {
@@ -311,7 +311,7 @@ vdpy_edid_set_timing(uint8_t *addr, const base_param *b_param, TIMING_MODE mode)
}
break;
default:
- return;
+ continue;
}
}
while(mode == STDT && stdcnt < 8){
@@ -429,7 +429,7 @@ vdpy_edid_generate(uint8_t *edid, size_t size, struct edid_info *info)
uint16_t id_product;
uint32_t serial;
uint8_t *desc;
- base_param b_param, c_param;
+ base_param b_param;

vdpy_edid_set_baseparam(&b_param, info->prefx, info->prefy);

@@ -493,14 +493,12 @@ vdpy_edid_generate(uint8_t *edid, size_t size, struct edid_info *info)
vdpy_edid_set_timing(edid, &b_param, STDT);

/* edid[125:54], Detailed Timing Descriptor - 18 bytes x 4 */
- // Detailed Timing Descriptor 1
+ // Preferred Timing Mode
desc = edid + 54;
- vdpy_edid_set_baseparam(&c_param, VDPY_MAX_WIDTH, VDPY_MAX_HEIGHT);
- vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
- // Detailed Timing Descriptor 2
+ vdpy_edid_set_descripter(desc, 0x1, 0, &b_param);
+ // iDisplay Range Limits & Additional Timing Descriptor (tag #FDh)
desc += 18;
- vdpy_edid_set_baseparam(&c_param, VDPY_DEFAULT_WIDTH, VDPY_DEFAULT_HEIGHT);
- vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
+ vdpy_edid_set_descripter(desc, 0, 0xfd, &b_param);
// Display Product Name (ASCII) String Descriptor (tag #FCh)
desc += 18;
vdpy_edid_set_descripter(desc, 0, 0xfc, &b_param);
@@ -526,10 +524,10 @@ vdpy_get_edid(int handle, uint8_t *edid, size_t size)
edid_info.maxx = VDPY_MAX_WIDTH;
edid_info.maxy = VDPY_MAX_HEIGHT;
} else {
- edid_info.prefx = 0;
- edid_info.prefy = 0;
- edid_info.maxx = 0;
- edid_info.maxy = 0;
+ edid_info.prefx = VDPY_DEFAULT_WIDTH;
+ edid_info.prefy = VDPY_DEFAULT_HEIGHT;
+ edid_info.maxx = VDPY_MAX_WIDTH;
+ edid_info.maxy = VDPY_MAX_HEIGHT;
}
edid_info.refresh_rate = 0;
edid_info.vendor = NULL;
--
2.25.1


[PATCH] config_tools: fix option passing to device model in launch scripts

Junjie Mao
 

Generated launch scripts tracks the options to ACRN device model in an
array `dm_params`. Those scripts use `${dm_params[*]}` to join all
elements in the array and pass the joined string to acrn-dm.

One tricky thing about `${dm_params[*]}` is that it joins the array
elements as one single unquoted string. This means an option as a string
with whitespaces will be split by the shell and passed to acrn-dm as
multiple options. This does not happen to the options generated today, but
prevents users from using, e.g., the -B option to pass the full command
line options for the guest kernel.

Rather than joining all elements as an unquoted string, it is more
preferrable to treat each element in `dm_params` as a quoted string. This
patch does this by:

1. replacing `${dm_params[*]}` with `"{dm_params[@]}"`, and

2. removing the quotes around plaintext options in `dm_params`.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@...>
---
misc/config_tools/launch_config/launch_cfg_gen.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py
index 18767936d..9c9a3372f 100755
--- a/misc/config_tools/launch_config/launch_cfg_gen.py
+++ b/misc/config_tools/launch_config/launch_cfg_gen.py
@@ -98,7 +98,7 @@ class LaunchScript:
self._deinit_commands.append(command)

def add_plain_dm_parameter(self, opt):
- full_opt = f"\"{opt}\""
+ full_opt = f"{opt}"
if full_opt not in self._dm_parameters:
self._dm_parameters.append(full_opt)

@@ -145,8 +145,8 @@ class LaunchScript:
s += f" {param}\n"
s += ")\n\n"

- s += "echo \"Launch device model with parameters: ${dm_params[*]}\"\n"
- s += "acrn-dm ${dm_params[*]}\n\n"
+ s += "echo \"Launch device model with parameters: ${dm_params[@]}\"\n"
+ s += "acrn-dm \"${dm_params[@]}\"\n\n"

s += "# Deinitializing\n"
for command in self._deinit_commands:
--
2.30.2


Re: [PATCH] virt: acrn: support EPT unmapping for RAM

Li, Fei1
 

On Wed, May 18, 2022 at 04:02:16PM +0300, Yonghua Huang wrote:
acrn_vm_memseg_unmap can't do EPT unmapping for memory
type of ACRN_MEMMAP_RAM, while such kind of unmapping
is required for case that user memory pages are taggeg
with VM_PFNMAP flag.

This patch fixes logic to support EPT unmapping for memory
region with type of ACRN_MEMMAP_RAM.
Hi Yonghua

IMHO, you could only unmap the ACRN_MEMMAP_RAM memory region which
Page-ranges managed without "struct page", just pure PFN (VM_PFNMAP
set in vm_flags).

Thanks.


Signed-off-by: Yonghua Huang <yonghua.huang@...>
---
drivers/virt/acrn/mm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/virt/acrn/mm.c b/drivers/virt/acrn/mm.c
index 3b1b1e7a844b..1d0b15933e1d 100644
--- a/drivers/virt/acrn/mm.c
+++ b/drivers/virt/acrn/mm.c
@@ -131,7 +131,8 @@ int acrn_vm_memseg_unmap(struct acrn_vm *vm, struct acrn_vm_memmap *memmap)
{
int ret;

- if (memmap->type != ACRN_MEMMAP_MMIO) {
+ if ((memmap->type != ACRN_MEMMAP_RAM)
+ && (memmap->type != ACRN_MEMMAP_MMIO)) {
dev_dbg(acrn_dev.this_device,
"Invalid memmap type: %u\n", memmap->type);
return -EINVAL;
--
2.25.1






[PATCH] virt: acrn: support EPT unmapping for RAM

Yonghua Huang
 

acrn_vm_memseg_unmap can't do EPT unmapping for memory
type of ACRN_MEMMAP_RAM, while such kind of unmapping
is required for case that user memory pages are taggeg
with VM_PFNMAP flag.

This patch fixes logic to support EPT unmapping for memory
region with type of ACRN_MEMMAP_RAM.

Signed-off-by: Yonghua Huang <yonghua.huang@...>
---
drivers/virt/acrn/mm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/virt/acrn/mm.c b/drivers/virt/acrn/mm.c
index 3b1b1e7a844b..1d0b15933e1d 100644
--- a/drivers/virt/acrn/mm.c
+++ b/drivers/virt/acrn/mm.c
@@ -131,7 +131,8 @@ int acrn_vm_memseg_unmap(struct acrn_vm *vm, struct acrn_vm_memmap *memmap)
{
int ret;

- if (memmap->type != ACRN_MEMMAP_MMIO) {
+ if ((memmap->type != ACRN_MEMMAP_RAM)
+ && (memmap->type != ACRN_MEMMAP_MMIO)) {
dev_dbg(acrn_dev.this_device,
"Invalid memmap type: %u\n", memmap->type);
return -EINVAL;
--
2.25.1


[PATCH v1] dm: vdisplay: add modes supported by Windows virtio-gpu driver

Sun, Peng
 

From: Sun Peng <peng.p.sun@...>

Add 1280x1024@75, 1024x768@75, 1600x1200@60, 1600x900@60 modes.

Tracked-On: #7507
Signed-off-by: Sun Peng <peng.p.sun@...>
---
devicemodel/hw/vdisplay_sdl.c | 48 +++++++++++++++++------------------
1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/devicemodel/hw/vdisplay_sdl.c b/devicemodel/hw/vdisplay_sdl.c
index 1e83bc7ba..5944ac73a 100644
--- a/devicemodel/hw/vdisplay_sdl.c
+++ b/devicemodel/hw/vdisplay_sdl.c
@@ -27,13 +27,13 @@

#define VDPY_MAX_WIDTH 1920
#define VDPY_MAX_HEIGHT 1080
-#define VDPY_DEFAULT_WIDTH 1280
-#define VDPY_DEFAULT_HEIGHT 720
+#define VDPY_DEFAULT_WIDTH 1024
+#define VDPY_DEFAULT_HEIGHT 768
#define VDPY_MIN_WIDTH 640
#define VDPY_MIN_HEIGHT 480
#define transto_10bits(color) (uint16_t)(color * 1024 + 0.5)

-static unsigned char default_raw_argb[640 * 480 * 4];
+static unsigned char default_raw_argb[VDPY_DEFAULT_WIDTH * VDPY_DEFAULT_HEIGHT * 4];

struct state {
bool is_ui_realized;
@@ -108,15 +108,18 @@ static const struct timing_entry {
bool is_std; // the flag of standard mode
} timings[] = {
/* Established Timings I & II (all @ 60Hz) */
+ { .hpixel = 1280, .vpixel = 1024, .byte = 36, .bit = 0, .hz = 75},
+ { .hpixel = 1024, .vpixel = 768, .byte = 36, .bit = 1, .hz = 75},
{ .hpixel = 1024, .vpixel = 768, .byte = 36, .bit = 3, .hz = 60},
{ .hpixel = 800, .vpixel = 600, .byte = 35, .bit = 0, .hz = 60 },
{ .hpixel = 640, .vpixel = 480, .byte = 35, .bit = 5, .hz = 60 },

/* Standard Timings */
{ .hpixel = 1920, .vpixel = 1080, .hz = 60, .is_std = true },
- { .hpixel = 1280, .vpixel = 720, .hz = 60, .is_std = true },
+ { .hpixel = 1680, .vpixel = 1050, .hz = 60, .is_std = true },
+ { .hpixel = 1600, .vpixel = 1200, .hz = 60, .is_std = true },
+ { .hpixel = 1600, .vpixel = 900, .hz = 60, .is_std = true },
{ .hpixel = 1440, .vpixel = 900, .hz = 60, .is_std = true },
- { .hpixel = 1680, .vpixel = 1050, .hz = 60, .is_std = true },
};

typedef struct frame_param{
@@ -161,8 +164,8 @@ vdpy_edid_set_baseparam(base_param *b_param, uint32_t width, uint32_t height)
{
b_param->h_pixel = width;
b_param->v_pixel = height;
- b_param->h_pixelmax = 0;
- b_param->v_pixelmax = 0;
+ b_param->h_pixelmax = width;
+ b_param->v_pixelmax = height;
b_param->rate = 60;
b_param->width = width;
b_param->height = height;
@@ -252,24 +255,21 @@ vdpy_edid_set_timing(uint8_t *addr, const base_param *b_param, TIMING_MODE mode)
size = sizeof(timings) / sizeof(timings[0]);
for(; idx < size; idx++){
timing = timings + idx;
- if ((b_param->h_pixelmax && b_param->h_pixelmax < timing->hpixel) ||
- (b_param->v_pixelmax && b_param->v_pixelmax < timing->vpixel)) {
- continue;
- }
+
switch(mode){
case ESTT: // Established Timings I & II
if(timing->byte) {
addr[timing->byte] |= (1 << timing->bit);
break;
} else {
- return;
+ continue;
}
case ESTT3: // Established Timings III
if(timing->byte_t3){
addr[timing->byte_t3] |= (1 << timing->bit);
break;
} else {
- return;
+ continue;
}
case STDT: // Standard Timings
if(stdcnt < 8 && timing->is_std) {
@@ -311,7 +311,7 @@ vdpy_edid_set_timing(uint8_t *addr, const base_param *b_param, TIMING_MODE mode)
}
break;
default:
- return;
+ continue;
}
}
while(mode == STDT && stdcnt < 8){
@@ -429,7 +429,7 @@ vdpy_edid_generate(uint8_t *edid, size_t size, struct edid_info *info)
uint16_t id_product;
uint32_t serial;
uint8_t *desc;
- base_param b_param, c_param;
+ base_param b_param;

vdpy_edid_set_baseparam(&b_param, info->prefx, info->prefy);

@@ -493,14 +493,12 @@ vdpy_edid_generate(uint8_t *edid, size_t size, struct edid_info *info)
vdpy_edid_set_timing(edid, &b_param, STDT);

/* edid[125:54], Detailed Timing Descriptor - 18 bytes x 4 */
- // Detailed Timing Descriptor 1
+ // Preferred Timing Mode
desc = edid + 54;
- vdpy_edid_set_baseparam(&c_param, VDPY_MAX_WIDTH, VDPY_MAX_HEIGHT);
- vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
- // Detailed Timing Descriptor 2
+ vdpy_edid_set_descripter(desc, 0x1, 0, &b_param);
+ // iDisplay Range Limits & Additional Timing Descriptor (tag #FDh)
desc += 18;
- vdpy_edid_set_baseparam(&c_param, VDPY_DEFAULT_WIDTH, VDPY_DEFAULT_HEIGHT);
- vdpy_edid_set_descripter(desc, 0x1, 0, &c_param);
+ vdpy_edid_set_descripter(desc, 0, 0xfd, &b_param);
// Display Product Name (ASCII) String Descriptor (tag #FCh)
desc += 18;
vdpy_edid_set_descripter(desc, 0, 0xfc, &b_param);
@@ -526,10 +524,10 @@ vdpy_get_edid(int handle, uint8_t *edid, size_t size)
edid_info.maxx = VDPY_MAX_WIDTH;
edid_info.maxy = VDPY_MAX_HEIGHT;
} else {
- edid_info.prefx = 0;
- edid_info.prefy = 0;
- edid_info.maxx = 0;
- edid_info.maxy = 0;
+ edid_info.prefx = VDPY_DEFAULT_WIDTH;
+ edid_info.prefy = VDPY_DEFAULT_HEIGHT;
+ edid_info.maxx = VDPY_MAX_WIDTH;
+ edid_info.maxy = VDPY_MAX_HEIGHT;
}
edid_info.refresh_rate = 0;
edid_info.vendor = NULL;
--
2.25.1

1001 - 1020 of 37092