[Spice-devel,PATCHv2,qxl-win] miniport: fix broken support for revision 2

Submitted by Alon Levy on Aug. 3, 2011, 10:20 p.m.

Details

Message ID 1312384846-14965-1-git-send-email-alevy@redhat.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy Aug. 3, 2011, 10:20 p.m.
RHBZ: 727886

The io port range test was too large, requiring support for the
new io ports introduced in revision 3. The purpose was just the opposite,
to only require the revision 2 range, and use the revision 3 range only
if the device claims revision 3.

Fix by checking that either
 rev == 2 && io range contains 2
 rev > 2 && io range contains 3
---
 miniport/qxl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/miniport/qxl.c b/miniport/qxl.c
index 4271104..40e8379 100644
--- a/miniport/qxl.c
+++ b/miniport/qxl.c
@@ -180,7 +180,10 @@  VP_STATUS InitIO(QXLExtension *dev, PVIDEO_ACCESS_RANGE range)
     PAGED_CODE();
     DEBUG_PRINT((dev, 0, "%s\n", __FUNCTION__));
 
-    if (range->RangeLength < QXL_IO_RANGE_SIZE
+    if ((dev->pci_revision == QXL_REVISION_STABLE_V06 &&
+         range->RangeLength < QXL_IO_DESTROY_ALL_SURFACES + 1)
+        || (dev->pci_revision > QXL_REVISION_STABLE_V06 &&
+         range->RangeLength < QXL_IO_FLUSH_RELEASE + 1)
         || !range->RangeInIoSpace) {
         DEBUG_PRINT((dev, 0, "%s: bad io range\n", __FUNCTION__));
         return ERROR_INVALID_DATA;

Comments

On 08/03/2011 06:20 PM, Alon Levy wrote:
> RHBZ: 727886
>
> The io port range test was too large, requiring support for the
> new io ports introduced in revision 3. The purpose was just the opposite,
> to only require the revision 2 range, and use the revision 3 range only
> if the device claims revision 3.
>
> Fix by checking that either
>   rev == 2&&  io range contains 2
>   rev>  2&&  io range contains 3
> ---
>   miniport/qxl.c |    5 ++++-
>   1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/miniport/qxl.c b/miniport/qxl.c
> index 4271104..40e8379 100644
> --- a/miniport/qxl.c
> +++ b/miniport/qxl.c
> @@ -180,7 +180,10 @@ VP_STATUS InitIO(QXLExtension *dev, PVIDEO_ACCESS_RANGE range)
>       PAGED_CODE();
>       DEBUG_PRINT((dev, 0, "%s\n", __FUNCTION__));
>
> -    if (range->RangeLength<  QXL_IO_RANGE_SIZE
> +    if ((dev->pci_revision == QXL_REVISION_STABLE_V06&&
> +         range->RangeLength<  QXL_IO_DESTROY_ALL_SURFACES + 1)
> +        || (dev->pci_revision>  QXL_REVISION_STABLE_V06&&
> +         range->RangeLength<  QXL_IO_FLUSH_RELEASE + 1)
>           || !range->RangeInIoSpace) {
>           DEBUG_PRINT((dev, 0, "%s: bad io range\n", __FUNCTION__));
>           return ERROR_INVALID_DATA;
ack