rpms/vbetool/devel vbetool.spec,1.12,1.13 vgaarbpost.patch,1.1,1.2

Dave Airlie airlied at fedoraproject.org
Fri Jul 31 03:57:45 UTC 2009


Author: airlied

Update of /cvs/pkgs/rpms/vbetool/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17107

Modified Files:
	vbetool.spec vgaarbpost.patch 
Log Message:
* Fri Jul 31 2009 Dave Airlie <airlied at redhat.com> 1.1-5.1
- pciacccess.patch: post to use libpciaccess
- vgaarbpost.patch: use vga arb to post secondaries



Index: vbetool.spec
===================================================================
RCS file: /cvs/pkgs/rpms/vbetool/devel/vbetool.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- vbetool.spec	31 Jul 2009 01:54:39 -0000	1.12
+++ vbetool.spec	31 Jul 2009 03:57:44 -0000	1.13
@@ -1,6 +1,6 @@
 Name:           vbetool
-Version:        1.2
-Release:        0.1%{?dist}
+Version:        1.1
+Release:        5.1%{?dist}
 Summary:        Run real-mode video BIOS code to alter hardware state
 
 Group:          System Environment/Base
@@ -9,9 +9,10 @@ URL:            http://www.codon.org.uk/
 Source0:        http://www.codon.org.uk/~mjg59/vbetool/download/vbetool-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-Requires: libpciaccess > 0.10.6-2
-BuildRequires:  zlib-devel pciutils-devel libx86-devel
-BuildRequires:  libpciaccess-devel >= 0.10.6-2
+Requires: libpciaccess > 0.10.6-3
+BuildRequires:  zlib-devel libx86-devel
+BuildRequires:  libpciaccess-devel >= 0.10.6-3
+BuildRequires: autoconf automake libtool pkgconfig
 # does not build on ppc, ppc64 and sparc arches, see #285361 (RedHat Bugzilla)
 # on ppc sys/io.h is missing, on ppc64 there are more complaints
 # build.logs are attached in the bug report
@@ -34,6 +35,7 @@ initialize the video card from scratch.
 %patch1 -p1 -b .vga
 
 %build
+autoreconf -v --install
 %configure --with-x86emu
 make %{?_smp_mflags}
 
@@ -55,7 +57,7 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
-* Fri Jul 31 2009 Dave Airlie <airlied at redhat.com> 1.2-0.1
+* Fri Jul 31 2009 Dave Airlie <airlied at redhat.com> 1.1-5.1
 - pciacccess.patch: post to use libpciaccess
 - vgaarbpost.patch: use vga arb to post secondaries
 

vgaarbpost.patch:
 vbetool.c |  103 +++++++++++++++++++++++++++++++++++++++++++++++++++++---------
 vbetool.h |    2 -
 2 files changed, 90 insertions(+), 15 deletions(-)

Index: vgaarbpost.patch
===================================================================
RCS file: /cvs/pkgs/rpms/vbetool/devel/vgaarbpost.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- vgaarbpost.patch	31 Jul 2009 01:54:39 -0000	1.1
+++ vgaarbpost.patch	31 Jul 2009 03:57:44 -0000	1.2
@@ -1,7 +1,15 @@
-diff -up vbetool-1.1/vbetool.c.da vbetool-1.1/vbetool.c
---- vbetool-1.1/vbetool.c.da	2009-07-31 11:14:18.000000000 +1000
-+++ vbetool-1.1/vbetool.c	2009-07-31 11:45:39.000000000 +1000
-@@ -119,7 +119,14 @@ int main(int argc, char *argv[])
+diff -up vbetool-1.1/vbetool.c.vga vbetool-1.1/vbetool.c
+--- vbetool-1.1/vbetool.c.vga	2009-07-31 13:46:35.000000000 +1000
++++ vbetool-1.1/vbetool.c	2009-07-31 13:53:35.000000000 +1000
+@@ -113,13 +113,20 @@ int main(int argc, char *argv[])
+ 			void *rc;
+ 			int romfd = open (argv[2], O_RDWR);
+ 
+-			munmap(0xc0000, 64*1024);
+-			rc = mmap(0xc0000, 64*1024,
++			munmap((void*)0xc0000, 64*1024);
++			rc = mmap((void *)0xc0000, 64*1024,
+ 				  PROT_READ|PROT_WRITE|PROT_EXEC,
  				  MAP_FIXED|MAP_PRIVATE, romfd, 0);
  		}
  
@@ -26,7 +34,7 @@ diff -up vbetool-1.1/vbetool.c.da vbetoo
  			argv[0], argv[0]);
  		return 1;
  	}
-@@ -214,7 +221,48 @@ int do_real_post(unsigned pci_device)
+@@ -214,32 +221,100 @@ int do_real_post(unsigned pci_device)
  	return error;
  }
  
@@ -35,55 +43,67 @@ diff -up vbetool-1.1/vbetool.c.da vbetoo
 +void *rom_cseg;
 +unsigned char romfile[MAX_ROMSIZE];
 +
-+void setup_rom_section(void)
++int setup_rom_section(void)
 +{
 +  munmap((void *)0xc0000, MAX_ROMSIZE);
 +  rom_cseg = mmap((void *)0xc0000, MAX_ROMSIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
 +		  MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
 +  if (!rom_cseg) {
-+    fprintf(stdrer,"unable to setup fake rom\n");
-+    return -1
++    fprintf(stderr,"unable to setup fake rom\n");
++    return -1;
 +  }
 +  return 0;
 +}
 +
-+int do_device_post(struct pci_device *dev)
++int do_device_post(struct pci_device *dev, int has_arb)
 +{
 +	int error = 0;
 +	/* need to pull the ROM file */
 +	unsigned int pci_id;
 +	int ret;	
 +
-+	pci_device_vgaarb_set_target(dev);
-+	pci_device_vgaarb_lock(dev);
-+	ret = pci_device_read_rom(dev, romfile);
-+	if (ret) {
-+		pci_device_vgaarb_unlock(dev);
-+		fprintf(stderr,"rom read returned %d\n");
-+		return 0;
-+	}
-+
-+	memcpy(rom_cseg, romfile, MAX_ROMSIZE);
++	if (has_arb) {
++		pci_device_vgaarb_set_target(dev);
++		pci_device_vgaarb_lock(dev);
++	
++		ret = pci_device_read_rom(dev, romfile);
++		if (ret) {
++			pci_device_vgaarb_unlock(dev);
++			fprintf(stderr,"rom read returned %d\n", ret);
++			return 0;
++		}
 +
++		memcpy(rom_cseg, romfile, MAX_ROMSIZE);
++	}
 +	pci_id = (dev->bus << 8) + (dev->dev << 3) +
 +		    (dev->func & 0x7);
 +	error = do_real_post(pci_id);
-+	pci_device_vgaarb_unlock(dev);
++	if (has_arb)
++		pci_device_vgaarb_unlock(dev);
 +	return error;
 +}
 +
 +int do_post(int boot_flag)
  {
- 	unsigned int c;
+-	unsigned int c;
  	int error;
-@@ -225,21 +273,35 @@ int do_post(void)
+ 	struct pci_id_match dev_match = {
+ 	PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
+ 	(0x03 << 16), 0xff000, 0 };
+ 	struct pci_device *dev, *first_dev = NULL;
  	struct pci_device_iterator *iter;
- 	unsigned pci_id;
+-	unsigned pci_id;
++	int has_arb = 1;
++	int ret;
++
++	ret = pci_device_vgaarb_init();
++	if (ret)
++		has_arb = 0;
++
++	if (has_arb)
++		if (setup_rom_section())
++	  		return -1;
  
-+	if (setup_rom_section())
-+	  return -1;
-+
-+	pci_device_vgaarb_init();
  	iter = pci_id_match_iterator_create(&dev_match);
  	if (iter == NULL) {
  		return 1;
@@ -97,25 +117,43 @@ diff -up vbetool-1.1/vbetool.c.da vbetoo
 -		error = do_real_post(dev);
 -		if (error != 0) {
 -			return error;
++		int is_boot = pci_device_is_boot_vga(dev);
 +		if (!first_dev)
 +			first_dev = dev;
 +
-+		if (pci_device_is_boot_vga(dev) && (boot_flag == 1)) {
++		if (!is_boot && !has_arb)
++			continue;
++
++		if (is_boot && boot_flag) {
 +			continue;
 +		}
 +		if (pci_device_has_kernel_driver(dev)) {
 +			continue;
  		}
-+		error = do_device_post(dev);
++		error = do_device_post(dev, has_arb);
 +		if (error)
 +			return error;
  	}
 +
  	pci_iterator_destroy(iter);
-+	pci_device_vgaarb_set_target(first_dev);
-+	pci_device_vgaarb_lock(first_dev);
-+	pci_device_vgaarb_unlock(first_dev);
-+	pci_device_vgaarb_fini();
++	if (has_arb) {
++		pci_device_vgaarb_set_target(first_dev);
++		pci_device_vgaarb_lock(first_dev);
++		pci_device_vgaarb_unlock(first_dev);
++		pci_device_vgaarb_fini();
++	}
  	return 0;
  }
  
+diff -up vbetool-1.1/vbetool.h.vga vbetool-1.1/vbetool.h
+--- vbetool-1.1/vbetool.h.vga	2007-03-03 11:50:00.000000000 +1000
++++ vbetool-1.1/vbetool.h	2009-07-31 13:46:35.000000000 +1000
+@@ -8,7 +8,7 @@ int do_get_mode(void);
+ int do_get_panel_brightness(void);
+ int do_set_panel_brightness(int brightness);
+ int do_invert_panel(void);
+-int do_post(void);
++int do_post(int boot_flag);
+ void restore_state(void);
+ void save_state(void);
+ void text_mode(void);




More information about the fedora-extras-commits mailing list