RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1791804 - Windows 10 guest with QXL WDDM driver shows a flipped screen content
Summary: Windows 10 guest with QXL WDDM driver shows a flipped screen content
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: spice-qxl-wddm-dod
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.3
Assignee: ybendito
QA Contact: SPICE QE bug list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-16 13:59 UTC by Giuseppe
Modified: 2023-03-31 12:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-04 05:00:02 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Trial driver 2 (341.03 KB, application/zip)
2020-02-05 09:16 UTC, ybendito
no flags Details
Image 1 (4.48 MB, image/jpeg)
2020-02-06 10:41 UTC, ybendito
no flags Details
Trial driver 3 (19003) (341.78 KB, application/zip)
2020-02-07 10:55 UTC, ybendito
no flags Details
Touchscreen info (193.49 KB, application/octet-stream)
2020-02-17 13:24 UTC, Giuseppe
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-33634 0 None None None 2023-03-31 12:51:40 UTC

Description Giuseppe 2020-01-16 13:59:05 UTC
Description of problem:
In some machines with the monitor in portrait position, the QXL driver doesn't support the "Portrait (flipped)" and the "Landscape (flipped)" configuration.


Version-Release number of selected component (if applicable):
RHEL 8.0 using a Win 10 VM


Actual results:
The content of the screen is flipped

Expected results:
As for the default Windows 10 drivers, should be possible to select the "Portrait (flipped)" configuration to have a correct visualization of the screen.

Comment 1 Kit Patterson 2020-01-29 13:20:11 UTC
For reference, we've also tried flipping the display on the Linux side of the system. The problem is that the hardware has a linked touch screen which takes the orientation from the Windows driver, so if the config on Linux doesn't hatch the Windows config then the touch screen isn't correctly aligned. This means we don't have any workaround for the issue without a QXL change. 

Thanks

Comment 2 ybendito 2020-02-05 09:16:35 UTC
Created attachment 1657831 [details]
Trial driver 2

Comment 3 ybendito 2020-02-05 09:19:38 UTC
Please try attached driver (comment #2)
Question: which mouse you use on VM? (command-line/profile)

Comment 4 Giuseppe 2020-02-05 13:37:11 UTC
Hi,
After a first test the Landscape/Portrait (flipped) configuration are available, but the mouse and the touchscreen are not mapped with the new flipped screen configuration.
I have tested either with a generic usb mouse and the touchpad. The mouse cursor is not flipped too.

Thanks,
Giuseppe

Comment 5 ybendito 2020-02-05 14:00:50 UTC
Is it correct that also with previous test where only 'Portrait' configuration present, the mouse/touch also do not function correctly in it?

Comment 6 Giuseppe 2020-02-05 14:53:59 UTC
Hi,
Yes in the previous test there were only the portrait and landscape configuration, but the mouse/touch worked correctly in accord with the used resolution.

Comment 7 ybendito 2020-02-06 06:49:56 UTC
In my experiments the pointing device never works correctly in any configuration except of plain Landscape.
Can you please specify which Spice client you use and which resolutions?

Comment 8 Giuseppe 2020-02-06 08:59:18 UTC
Hi,
These are the package version of the spice client/server:
spice-glib-0.35-7.el08.x86_64
spice-gtk3-0.35-7.el08.x86_64
spice-server-0.14.2-1.el08.x86_64
virt-viewer-7.0-3.el08.x86_64

My laptop has a 4K screen resolution but I have tested the VM using the 1024x768 screen resolution too and there is the same result.


Another test on the machine we need this functionality that has two displays there is another behavior: the touch on the second screen is acted on the first one.
To enable the two display we add two display adapters to the VM: 
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='32768' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='32768' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </video>


is this a possible cause of this strange touchscreen behavior?

Comment 9 ybendito 2020-02-06 10:41:06 UTC
Created attachment 1658137 [details]
Image 1

Comment 10 ybendito 2020-02-06 10:47:07 UTC
Let's try to get synchronized. In comment #9 I attach typical picture of the screen (with qxldod driver) after the Portrait setting applied (using keyboard, as it is impossible to click the button with the mouse). Look at the pointer, its orientation (pointer shape is for 'Landscape', i.e. wrong) and highlighted 'Sound' captions (where the logical cursor is).
Do you have the same behavior on your system?

Comment 11 Giuseppe 2020-02-06 11:45:47 UTC
Yes, this is the current behavior on the laptop, but only if I use the touchpad, with the usb mouse the cursor is never shown. I'm using a full-screen kiosk mode config for the virt-viewer so the expected result is to do a click on the screen and act on the correct position.
On the other pc where there is a rotated screen the mouse cursor is never shown

Comment 12 ybendito 2020-02-07 10:55:33 UTC
Created attachment 1661663 [details]
Trial driver 3 (19003)

Comment 14 ybendito 2020-02-07 11:19:10 UTC
I've created additional build of the qxl-wddm-dod driver (not sure it will be useful).
It remaps the pointer for rotated screen (when the input device in VM is usb-mouse).
As far as I understand the case relevant for the product is when the input comes from the touch screen.
In this case the display driver is not in the game as it does not participate in the input path. In the best case (not always) it can only define where to draw the pointer.
Several questions (for this relevant case):
1. How the touch screen is defined on host side? (sudo evtest -> respective device)
2. How the input device is defined on VM side (command line / profile).

Comment 15 Giuseppe 2020-02-17 13:24:01 UTC
Created attachment 1663514 [details]
Touchscreen info

evtest logs and Windows system info

Comment 16 Giuseppe 2020-02-17 13:24:58 UTC
Hi,
The pointer is still with the original landscape orientation, so when I try to rotate the screen the cursor doesn't map the screen orientation, but this is not the priority for the moment.
In my laptop with a single monitor, the position of the touch seems to reflect the screen position, but not the click of the mouse: with landscape flipped configuration, a click on the bottom left is acted on the top right even if the mouse cursor is on the bottom left.
In general, there is a strange behavior with the touchscreen with some devices like my laptop: using the QXL drivers after a while the touchscreen stop to work, but using the Microsoft standard video drivers this never happens.


On the kiosk machine, the touch on the second monitor is acted on the first monitor, could be this related to video driver?

On Comment 15 I have attached the evtest logs, on Windows side what do you mean with "profile"? I have attached the system information

Comment 17 ybendito 2020-02-17 14:44:07 UTC
(In reply to Giuseppe from comment #16)
> Hi,
> The pointer is still with the original landscape orientation, so when I try
> to rotate the screen the cursor doesn't map the screen orientation, but this
> is not the priority for the moment.
> In my laptop with a single monitor, the position of the touch seems to
> reflect the screen position, but not the click of the mouse: with landscape
> flipped configuration, a click on the bottom left is acted on the top right
> even if the mouse cursor is on the bottom left.
> In general, there is a strange behavior with the touchscreen with some
> devices like my laptop: using the QXL drivers after a while the touchscreen
> stop to work, but using the Microsoft standard video drivers this never
> happens.
> 
> 
> On the kiosk machine, the touch on the second monitor is acted on the first
> monitor, could be this related to video driver?
> 

Please just confirm this is with Trial driver 2 or 3?

> On Comment 15 I have attached the evtest logs, on Windows side what do you
> mean with "profile"? I have attached the system information

The question was how the input device(s) appear in the machine XML or qemu command line.

Comment 18 ybendito 2020-02-17 14:50:30 UTC
Can you please also explain a little more about 2 displays configuration?
Are they duplicated or extended?
Additional question: do you use Spice agent (usually 'sc query vdservice') on the Guest?

Comment 19 Giuseppe 2020-02-17 15:26:44 UTC
> Please just confirm this is with Trial driver 2 or 3?

It's Trial driver 3 (Version 10.0.0.19003)


> The question was how the input device(s) appear in the machine XML or qemu command line.

The touchscreen is passed through to the VM like a normal USB device:
<hostdev mode='subsystem' type='usb'><source><vendor id='XXX'/><address bus='YYY' device='ZZZ'/><product id='TTT'/></source></hostdev>
I have added also this:
<input type='tablet' bus='usb'><address type='usb' bus='0' port='1'/></input>
to the domain xml definition


> Can you please also explain a little more about 2 displays configuration?
> Are they duplicated or extended?

They are extended. 
The VM is defined with two graphic cards:
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='32768' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='32768' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </video>


> Additional question: do you use Spice agent (usually 'sc query vdservice') on the Guest?

No, I haven't used the spice agent on the VM

Comment 20 ybendito 2020-02-17 19:37:20 UTC
1. About USB mouse: I suggest to try <input type='mouse' ...> instead of 'tablet' - then the graphics driver is in the game.
2. About touch: If you just redirect the USB touch from the host, I'm afraid Spice components are not involved, this is IMO between the OS and the device.

Comment 21 ybendito 2020-02-19 06:57:06 UTC
Another note about touch screen: if you just redirect it from the host as USB device and have 2 displays, how can the guest OS decide to which display it is attached?
On the host this is probably described somehow in the ACPI or, for example, one screen is defined in the ACPI as integrated display panel.
If you change the 'main' screen or swap their placement - does it change?

Comment 22 ybendito 2020-02-21 14:40:00 UTC
Some news?

Comment 23 Giuseppe 2020-02-21 15:30:22 UTC
Hi,
Sorry for the delay, unfortunately changing tablet in mouse and switching the primary with secondary there is no change.
I have also tried to use two heads on the video device but the Windows VM can see only one monitor
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='32768' heads='2' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>

also using a type='vga' the VM can see only one monitor

Comment 24 ybendito 2020-02-21 16:49:12 UTC
Trying to summarize:
Notes: Multiple heads on single adapter are not supported by current driver under Windows.
AFAIK it is impossible to have multiple VGA adapters.
  
1. Problems with touch screen when 2 adapters defined: touch screen action is reflected on wrong display. The problem is clear, I do not see a simple solution, but I'm not an expert in this specific are (probably need to define somehow the binding between touch screen to specific device).
2. Problem with the mouse pointers: clicks in some of orientations take effect in wrong place. The problem is unclear, in case when the mouse is driven by host mouse and the VM input device is usb-mouse, the VM receives delta of mouse moves, sends the positions to the graphics driver and the driver 'Trial 3' should remap the mouse coordinates and request to draw the pointer at proper location (in case the VM input device is usb-tablet, the VM _receives the position_ of the pointer and the client draws the cursor where it thinks it is, the client is not aware of screen orientation). If solution for this problem required, we can cooperate and try to debug it.

Please correct me if I'm wrong.

Comment 25 ybendito 2020-03-17 07:11:33 UTC
Fixed in 0.20


Note You need to log in before you can comment on or make changes to this bug.