OSDN Git Service

vgaarb: read back vga count when setting new decoding
authorTiago Vignatti <tiago.vignatti@nokia.com>
Sat, 22 May 2010 15:23:33 +0000 (18:23 +0300)
committerTiago Vignatti <tiago.vignatti@nokia.com>
Wed, 16 Jun 2010 15:57:28 +0000 (18:57 +0300)
Decode kernel operation can also change vga refcount, so we need to read back
the information when calling it.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
src/common_vgaarb.c

index f09d513..c94b362 100644 (file)
@@ -263,6 +263,13 @@ pci_device_vgaarb_decodes(int new_vgaarb_rsrc)
     ret = vgaarb_write(pci_sys->vgaarb_fd, buf, len);
     if (ret == 0)
         dev->vgaarb_rsrc = new_vgaarb_rsrc;
     ret = vgaarb_write(pci_sys->vgaarb_fd, buf, len);
     if (ret == 0)
         dev->vgaarb_rsrc = new_vgaarb_rsrc;
+
+    ret = read(pci_sys->vgaarb_fd, buf, BUFSIZE);
+    if (ret <= 0)
+        return -1;
+
+    parse_string_to_decodes_rsrc(buf, &pci_sys->vga_count, NULL);
+
     return ret;
 }
 
     return ret;
 }