Commit 06a709f7 authored by Alexander Larsson's avatar Alexander Larsson
Browse files

Add initial mesa version

This is a regular build of mesa but its put inside
/usr/lib/GL, with symlinks from /usr/lib so that it can easily be
switched out.
parent b36e9b24
......@@ -36,6 +36,7 @@ PACKAGES = \
libXfixes libXext libXft libXi libXinerama libICE libSM libXpm libXrandr libXtst \
libXv libXvMC libXxf86vm libXdamage libXcursor libXcomposite libxkbfile libxshmfence \
dbus cairo dbus-glib \
libpciaccess libdrm mesa \
graphite2 harfbuzz libdatrie libthai pango atk at-spi2-core at-spi2-atk gdk-pixbuf2 gtk3 \
itstool yelp-xsl yelp-tools \
hicolor-icon-theme libcroco vala librsvg2 adwaita-icon-theme \
......
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 8c3cf67..2ea78c1 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -227,6 +227,7 @@ pci_device_linux_sysfs_probe( struct pci_device * dev )
pciaddr_t bytes;
unsigned i;
int err;
+ struct stat st;
err = pci_device_linux_sysfs_read( dev, config, 0, 256, & bytes );
@@ -293,11 +294,28 @@ pci_device_linux_sysfs_probe( struct pci_device * dev )
flags = strtoull( next, & next, 16 );
if ( low_addr != 0 ) {
priv->rom_base = low_addr;
- dev->rom_size = (high_addr - low_addr) + 1;
}
}
}
+ snprintf( name, 255, "%s/%04x:%02x:%02x.%1u/rom",
+ SYS_BUS_PCI,
+ dev->domain,
+ dev->bus,
+ dev->dev,
+ dev->func );
+
+ fd = open( name, O_RDWR );
+ if ( fd == -1 ) {
+ dev->rom_size = 0x10000;
+ } else if ( fstat( fd, & st ) == -1 ) {
+ close( fd );
+ dev->rom_size = 0x10000;
+ } else {
+ close( fd );
+ dev->rom_size = st.st_size == 0 ? 0x10000 : st.st_size;
+ }
+
return err;
}
@@ -309,7 +327,6 @@ pci_device_linux_sysfs_read_rom( struct pci_device * dev, void * buffer )
int fd;
struct stat st;
int err = 0;
- size_t rom_size;
size_t total_bytes;
@@ -334,10 +351,6 @@ pci_device_linux_sysfs_read_rom( struct pci_device * dev, void * buffer )
return errno;
}
- rom_size = st.st_size;
- if ( rom_size == 0 )
- rom_size = 0x10000;
-
/* This is a quirky thing on Linux. Even though the ROM and the file
* for the ROM in sysfs are read-only, the string "1" must be written to
* the file to enable the ROM. After the data has been read, "0" must be
@@ -346,9 +359,9 @@ pci_device_linux_sysfs_read_rom( struct pci_device * dev, void * buffer )
write( fd, "1", 1 );
lseek( fd, 0, SEEK_SET );
- for ( total_bytes = 0 ; total_bytes < rom_size ; /* empty */ ) {
+ for ( total_bytes = 0 ; total_bytes < dev->rom_size ; /* empty */ ) {
const int bytes = read( fd, (char *) buffer + total_bytes,
- rom_size - total_bytes );
+ dev->rom_size - total_bytes );
if ( bytes == -1 ) {
err = errno;
break;
From b9c068896914b4132a24839c9ef7f9fcd6282d88 Mon Sep 17 00:00:00 2001
From: Marcin Ko?cielnicki <koriakin@0x04.net>
Date: Wed, 5 Feb 2014 09:01:25 +0100
Subject: Fix IO access functions on linux+sysfs.
The offsets on the resourceX files are relative to BAR base - don't add
the base address ourselves.
Reviewed-by: Adam Jackson <ajax@redhat.com>
diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index 14ec3bc..7f5f56b 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -579,6 +579,7 @@ pci_device_freebsd_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
#elif defined(PCI_MAGIC_IO_RANGE)
ret->memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
@@ -588,6 +589,7 @@ pci_device_freebsd_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
#else
return NULL;
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 97fcf36..8fca65e 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -759,6 +759,7 @@ pci_device_linux_sysfs_open_device_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 0;
return ret;
}
@@ -796,6 +797,7 @@ pci_device_linux_sysfs_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
}
@@ -813,10 +815,14 @@ pci_device_linux_sysfs_read32(struct pci_io_handle *handle, uint32_t port)
{
uint32_t ret;
- if (handle->fd > -1)
- pread(handle->fd, &ret, 4, port + handle->base);
- else
+ if (handle->fd > -1) {
+ if (handle->is_legacy)
+ pread(handle->fd, &ret, 4, port + handle->base);
+ else
+ pread(handle->fd, &ret, 4, port);
+ } else {
ret = inl(port + handle->base);
+ }
return ret;
}
@@ -826,10 +832,14 @@ pci_device_linux_sysfs_read16(struct pci_io_handle *handle, uint32_t port)
{
uint16_t ret;
- if (handle->fd > -1)
- pread(handle->fd, &ret, 2, port + handle->base);
- else
+ if (handle->fd > -1) {
+ if (handle->is_legacy)
+ pread(handle->fd, &ret, 2, port + handle->base);
+ else
+ pread(handle->fd, &ret, 2, port);
+ } else {
ret = inw(port + handle->base);
+ }
return ret;
}
@@ -839,10 +849,14 @@ pci_device_linux_sysfs_read8(struct pci_io_handle *handle, uint32_t port)
{
uint8_t ret;
- if (handle->fd > -1)
- pread(handle->fd, &ret, 1, port + handle->base);
- else
+ if (handle->fd > -1) {
+ if (handle->is_legacy)
+ pread(handle->fd, &ret, 1, port + handle->base);
+ else
+ pread(handle->fd, &ret, 1, port);
+ } else {
ret = inb(port + handle->base);
+ }
return ret;
}
@@ -851,30 +865,42 @@ static void
pci_device_linux_sysfs_write32(struct pci_io_handle *handle, uint32_t port,
uint32_t data)
{
- if (handle->fd > -1)
- pwrite(handle->fd, &data, 4, port + handle->base);
- else
+ if (handle->fd > -1) {
+ if (handle->is_legacy)
+ pwrite(handle->fd, &data, 4, port + handle->base);
+ else
+ pwrite(handle->fd, &data, 4, port);
+ } else {
outl(data, port + handle->base);
+ }
}
static void
pci_device_linux_sysfs_write16(struct pci_io_handle *handle, uint32_t port,
uint16_t data)
{
- if (handle->fd > -1)
- pwrite(handle->fd, &data, 2, port + handle->base);
- else
+ if (handle->fd > -1) {
+ if (handle->is_legacy)
+ pwrite(handle->fd, &data, 2, port + handle->base);
+ else
+ pwrite(handle->fd, &data, 2, port);
+ } else {
outw(data, port + handle->base);
+ }
}
static void
pci_device_linux_sysfs_write8(struct pci_io_handle *handle, uint32_t port,
uint8_t data)
{
- if (handle->fd > -1)
- pwrite(handle->fd, &data, 1, port + handle->base);
- else
+ if (handle->fd > -1) {
+ if (handle->is_legacy)
+ pwrite(handle->fd, &data, 1, port + handle->base);
+ else
+ pwrite(handle->fd, &data, 1, port);
+ } else {
outb(data, port + handle->base);
+ }
}
static int
diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
index b3f7f2d..e6dae4c 100644
--- a/src/netbsd_pci.c
+++ b/src/netbsd_pci.c
@@ -733,6 +733,7 @@ pci_device_netbsd_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
#elif defined(__amd64__)
struct x86_64_iopl_args ia;
@@ -743,6 +744,7 @@ pci_device_netbsd_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
#else
return NULL;
diff --git a/src/openbsd_pci.c b/src/openbsd_pci.c
index 73c68f4..fe034f3 100644
--- a/src/openbsd_pci.c
+++ b/src/openbsd_pci.c
@@ -412,6 +412,7 @@ pci_device_openbsd_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
#elif defined(__amd64__)
struct amd64_iopl_args ia;
@@ -422,6 +423,7 @@ pci_device_openbsd_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
#elif defined(PCI_MAGIC_IO_RANGE)
ret->memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
@@ -431,6 +433,7 @@ pci_device_openbsd_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
#else
return NULL;
diff --git a/src/pciaccess_private.h b/src/pciaccess_private.h
index 339ec0f..9f4e8f9 100644
--- a/src/pciaccess_private.h
+++ b/src/pciaccess_private.h
@@ -109,6 +109,7 @@ struct pci_io_handle {
pciaddr_t size;
void *memory;
int fd;
+ int is_legacy;
};
struct pci_device_private {
diff --git a/src/solx_devfs.c b/src/solx_devfs.c
index 41f5c19..8e7ea9b 100644
--- a/src/solx_devfs.c
+++ b/src/solx_devfs.c
@@ -911,6 +911,7 @@ pci_device_solx_devfs_open_legacy_io(struct pci_io_handle *ret,
if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) == 0) {
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
}
#endif
diff --git a/src/x86_pci.c b/src/x86_pci.c
index 1075367..49c1cab 100644
--- a/src/x86_pci.c
+++ b/src/x86_pci.c
@@ -729,6 +729,7 @@ pci_device_x86_open_legacy_io(struct pci_io_handle *ret,
ret->base = base;
ret->size = size;
+ ret->is_legacy = 1;
return ret;
}
--
cgit v0.10.2
diff -uNr mesa-20131201.orig/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp mesa-20131201/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
--- mesa-20131201.orig/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp 2013-12-01 11:29:21.000000000 +0400
+++ mesa-20131201/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp 2013-12-01 16:05:06.488417551 +0400
@@ -739,7 +739,7 @@
if (!i)
i = new_Instruction(pol.context(), op, dType);
#ifndef NDEBUG // non-conformant assert, so this is required
- assert(typeid(*i) == typeid(*this));
+ //assert(typeid(*i) == typeid(*this));
#endif
pol.set<Instruction>(this, i);
......@@ -31,6 +31,9 @@ Requires: libnotify
Requires: vte
Requires: gjs
Requires: zenity
Requires: mesa-libGL
Requires: mesa-libEGL
Requires: mesa-dri-drivers
%description
Meta package for Gnome SDK dependencies
......
......@@ -28,6 +28,9 @@ BuildRequires: libnotify-devel
BuildRequires: vte-devel
BuildRequires: gjs-devel
BuildRequires: zenity
BuildRequires: mesa-libGL
BuildRequires: libICE-devel
BuildRequires: libXxf86vm-devel
Requires: gtk2-devel gtk2-immodules
Requires: gtk3-devel gtk3-immodules
......@@ -86,6 +89,11 @@ Requires: libproxy-devel
Requires: gsettings-desktop-schemas-devel
Requires: gjs-devel mozjs24-devel
Requires: zenity
Requires: mesa-libGL-devel
Requires: mesa-libEGL-devel
Requires: mesa-dri-drivers
Requires: libICE-devel
Requires: libXxf86vm-devel
%description
Meta package for Gnome SDK dependencies
......
Summary: Direct Rendering Manager runtime library
Name: libdrm
Version: 2.4.58
Release: 1%{?dist}
License: MIT
Group: System Environment/Libraries
URL: http://dri.sourceforge.net
Source0: http://dri.freedesktop.org/libdrm/%{name}-%{version}.tar.bz2
BuildRequires: gnome-sdk-base
BuildRequires: libxcb-devel
BuildRequires: libpciaccess-devel
%description
Direct Rendering Manager runtime library
%package devel
Summary: Direct Rendering Manager development package
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Direct Rendering Manager development package
%prep
%setup -q
%build
autoreconf -v --install || exit 1
%configure \
--disable-udev
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
# SUBDIRS=libdrm
# NOTE: We intentionally don't ship *.la files
find $RPM_BUILD_ROOT -type f -name '*.la' | xargs rm -f -- || :
for i in r300_reg.h via_3d_reg.h
do
rm -f $RPM_BUILD_ROOT/usr/include/libdrm/$i
done
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc README
%{_libdir}/libdrm.so.2
%{_libdir}/libdrm.so.2.4.0
%ifarch %{ix86} x86_64 ia64
%{_libdir}/libdrm_intel.so.1
%{_libdir}/libdrm_intel.so.1.0.0
%endif
%{_libdir}/libdrm_radeon.so.1
%{_libdir}/libdrm_radeon.so.1.0.1
%{_libdir}/libdrm_nouveau.so.2
%{_libdir}/libdrm_nouveau.so.2.0.0
%{_libdir}/libkms.so.1
%{_libdir}/libkms.so.1.0.0
%files devel
%defattr(-,root,root,-)
# FIXME should be in drm/ too
%{_includedir}/xf86drm.h
%{_includedir}/xf86drmMode.h
%dir %{_includedir}/libdrm
%{_includedir}/libdrm/drm.h
%{_includedir}/libdrm/drm_fourcc.h
%{_includedir}/libdrm/drm_mode.h
%{_includedir}/libdrm/drm_sarea.h
%ifarch %{ix86} x86_64 ia64
%{_includedir}/libdrm/intel_aub.h
%{_includedir}/libdrm/intel_bufmgr.h
%{_includedir}/libdrm/intel_debug.h
%endif
%{_includedir}/libdrm/radeon_bo.h
%{_includedir}/libdrm/radeon_bo_gem.h
%{_includedir}/libdrm/radeon_bo_int.h
%{_includedir}/libdrm/radeon_cs.h
%{_includedir}/libdrm/radeon_cs_gem.h
%{_includedir}/libdrm/radeon_cs_int.h
%{_includedir}/libdrm/radeon_surface.h
%{_includedir}/libdrm/r600_pci_ids.h
%{_includedir}/libdrm/nouveau.h
%{_includedir}/libdrm/*_drm.h
%{_includedir}/libkms
%{_libdir}/libdrm.so
%ifarch %{ix86} x86_64 ia64
%{_libdir}/libdrm_intel.so
%endif
%{_libdir}/libdrm_radeon.so
%{_libdir}/libdrm_nouveau.so
%{_libdir}/libkms.so
%{_libdir}/pkgconfig/libdrm.pc
%ifarch %{ix86} x86_64 ia64
%{_libdir}/pkgconfig/libdrm_intel.pc
%endif
%{_libdir}/pkgconfig/libdrm_radeon.pc
%{_libdir}/pkgconfig/libdrm_nouveau.pc
%{_libdir}/pkgconfig/libkms.pc
%changelog
* Tue Dec 9 2014 Alexander Larsson <alexl@redhat.com> - 2.4.58-1
- Initial version, based on F21
Name: libpciaccess
Version: 0.13.2
Release: 1%{?dist}
Summary: PCI access library
Group: System Environment/Libraries
License: MIT
URL: http://gitweb.freedesktop.org/?p=xorg/lib/libpciaccess.git
Source0: http://xorg.freedesktop.org/archive/individual/lib/%{name}-%{version}.tar.bz2
Patch1: libpciaccess-sysfs.patch
Patch2: libpciaccess-rom-size.patch
BuildRequires: gnome-sdk-base xorg-x11-util-macros
%description
libpciaccess is a library for portable PCI access routines across multiple
operating systems.
%package devel
Summary: PCI access library development package
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Development package for libpciaccess.
%prep
%setup -q -n %{name}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
%patch2 -p1 -b .rom-size
%build
autoreconf -v --install
%configure --disable-static
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc COPYING AUTHORS
%{_libdir}/libpciaccess.so.0
%{_libdir}/libpciaccess.so.0.11.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/pciaccess.h
%{_libdir}/libpciaccess.so
%{_libdir}/pkgconfig/pciaccess.pc
%changelog
* Tue Dec 9 2014 Alexander Larsson <alexl@redhat.com> - 0.13.2-1
- Initial version
%define base_drivers swrast,nouveau
#,radeon,r200
%ifarch %{ix86} x86_64
%define platform_drivers ,i915,i965
%endif
%define _default_patch_fuzz 2
Summary: Mesa graphics libraries
Name: mesa
Version: 10.3.5
Release: 1%{?dist}
License: MIT
Group: System Environment/Libraries
URL: http://www.mesa3d.org
Source0: ftp://ftp.freedesktop.org/pub/mesa/10.3.5/MesaLib-%{version}.tar.bz2
Patch1: mesa-no-typeid.patch
BuildRequires: gnome-sdk-base
BuildRequires: libdrm-devel
BuildRequires: libXxf86vm-devel
BuildRequires: xorg-x11-proto-devel
BuildRequires: libXext-devel
BuildRequires: libXfixes-devel
BuildRequires: libXdamage-devel
BuildRequires: libXi-devel
BuildRequires: libxshmfence-devel
%description
Mesa
%package libGL
Summary: Mesa libGL runtime libraries and DRI drivers
Group: System Environment/Libraries
Provides: libGL
%description libGL
Mesa libGL runtime library.
%package libEGL
Summary: Mesa libEGL runtime libraries
Group: System Environment/Libraries
%description libEGL
Mesa libEGL runtime libraries
%package libGLES
Summary: Mesa libGLES runtime libraries
Group: System Environment/Libraries
%description libGLES
Mesa GLES runtime libraries
%package filesystem
Summary: Mesa driver filesystem
Group: User Interface/X Hardware Support
%description filesystem
Mesa driver filesystem
%package dri-drivers
Summary: Mesa-based DRI drivers
Group: User Interface/X Hardware Support
Requires: mesa-filesystem%{?_isa}
%description dri-drivers
Mesa-based DRI drivers.
%package libGL-devel
Summary: Mesa libGL development package
Group: Development/Libraries
Requires: mesa-libGL = %{version}-%{release}
%description libGL-devel
Mesa libGL development package
%package libEGL-devel
Summary: Mesa libEGL development package
Group: Development/Libraries
Requires: mesa-libEGL = %{version}-%{release}
%description libEGL-devel
Mesa libEGL development package
%package libGLES-devel
Summary: Mesa libGLES development package
Group: Development/Libraries
Requires: mesa-libGLES = %{version}-%{release}
%description libGLES-devel
Mesa libGLES development package
%package libgbm
Summary: Mesa gbm library
Group: System Environment/Libraries
%description libgbm
Mesa gbm runtime library.