1
0
forked from rpms/mesa

nouveau: nvc0 (fermi) support + nv10/nv20 g-s fixes

This commit is contained in:
Ben Skeggs 2011-01-18 15:49:38 +10:00
parent 55ddc6593b
commit 8f82e4b6be
6 changed files with 20126 additions and 134 deletions

View File

@ -0,0 +1,33 @@
From c43905b6c43ac34bbcb5a9e44414fa500e5cebeb Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Mon, 17 Jan 2011 12:54:27 +1000
Subject: [PATCH 3/3] mesa-7.10-nouveau-classic-libdrm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
src/mesa/drivers/dri/nouveau/nouveau_driver.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
index 8036b18..c5ac128 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
@@ -38,7 +38,6 @@
#include <assert.h>
#include "nouveau_device.h"
-#include "nouveau_pushbuf.h"
#include "nouveau_grobj.h"
#include "nouveau_channel.h"
#include "nouveau_bo.h"
@@ -46,6 +45,7 @@
#include "nouveau_screen.h"
#include "nouveau_state.h"
#include "nouveau_surface.h"
+#include "nv04_pushbuf.h"
#define DRIVER_DATE "20091015"
#define DRIVER_AUTHOR "Nouveau"
--
1.7.3.4

View File

@ -0,0 +1,114 @@
From 20f77c532547c7f8f1cb26f41357037821cf2a9f Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Mon, 17 Jan 2011 12:47:12 +1000
Subject: [PATCH 2/3] mesa-7.10-nouveau-revert.patch
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
src/gallium/drivers/nv50/nv50_context.c | 4 ----
src/gallium/drivers/nv50/nv50_shader_state.c | 2 +-
src/gallium/drivers/nv50/nv50_state.c | 5 ++---
src/gallium/drivers/nv50/nv50_vbo.c | 2 +-
src/gallium/drivers/nvc0/nvc0_screen.c | 2 +-
src/gallium/drivers/nvfx/nvfx_vbo.c | 14 +++++++++++---
6 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
index 4f97616..0874cb5 100644
--- a/src/gallium/drivers/nv50/nv50_context.c
+++ b/src/gallium/drivers/nv50/nv50_context.c
@@ -49,10 +49,6 @@ nv50_destroy(struct pipe_context *pipe)
struct nv50_context *nv50 = nv50_context(pipe);
int i;
- for (i = 0; i < nv50->vtxbuf_nr; i++) {
- pipe_resource_reference(&nv50->vtxbuf[i].buffer, NULL);
- }
-
for (i = 0; i < 64; i++) {
if (!nv50->state.hw[i])
continue;
diff --git a/src/gallium/drivers/nv50/nv50_shader_state.c b/src/gallium/drivers/nv50/nv50_shader_state.c
index 1c1b66d..306aa81 100644
--- a/src/gallium/drivers/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nv50/nv50_shader_state.c
@@ -71,7 +71,7 @@ nv50_transfer_constbuf(struct nv50_context *nv50,
map += nr;
}
- pipe_buffer_unmap(pipe, transfer);
+ pipe_buffer_unmap(pipe, buf, transfer);
}
static void
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c
index b4eda0f..04291e4 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -779,9 +779,8 @@ nv50_set_vertex_buffers(struct pipe_context *pipe, unsigned count,
{
struct nv50_context *nv50 = nv50_context(pipe);
- util_copy_vertex_buffers(nv50->vtxbuf,
- &nv50->vtxbuf_nr,
- vb, count);
+ memcpy(nv50->vtxbuf, vb, sizeof(*vb) * count);
+ nv50->vtxbuf_nr = count;
nv50->dirty |= NV50_NEW_ARRAYS;
}
diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c
index 53f319a..d41a59d 100644
--- a/src/gallium/drivers/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nv50/nv50_vbo.c
@@ -284,7 +284,7 @@ nv50_draw_elements_inline(struct pipe_context *pipe,
nzi = TRUE;
}
- pipe_buffer_unmap(pipe, transfer);
+ pipe_buffer_unmap(pipe, indexBuffer, transfer);
}
static void
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index f608b32..e14d4fd 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -110,7 +110,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_STENCIL_EXPORT:
return 0;
case PIPE_CAP_PRIMITIVE_RESTART:
- case PIPE_CAP_INSTANCED_DRAWING:
+// case PIPE_CAP_INSTANCED_DRAWING:
return 1;
default:
NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c
index 01dacb4..1c88f5f 100644
--- a/src/gallium/drivers/nvfx/nvfx_vbo.c
+++ b/src/gallium/drivers/nvfx/nvfx_vbo.c
@@ -591,10 +591,18 @@ nvfx_set_vertex_buffers(struct pipe_context *pipe, unsigned count,
{
struct nvfx_context *nvfx = nvfx_context(pipe);
- util_copy_vertex_buffers(nvfx->vtxbuf,
- &nvfx->vtxbuf_nr,
- vb, count);
+ for(unsigned i = 0; i < count; ++i)
+ {
+ pipe_resource_reference(&nvfx->vtxbuf[i].buffer, vb[i].buffer);
+ nvfx->vtxbuf[i].buffer_offset = vb[i].buffer_offset;
+ nvfx->vtxbuf[i].max_index = vb[i].max_index;
+ nvfx->vtxbuf[i].stride = vb[i].stride;
+ }
+
+ for(unsigned i = count; i < nvfx->vtxbuf_nr; ++i)
+ pipe_resource_reference(&nvfx->vtxbuf[i].buffer, 0);
+ nvfx->vtxbuf_nr = count;
nvfx->use_vertex_buffers = -1;
nvfx->draw_dirty |= NVFX_NEW_ARRAYS;
}
--
1.7.3.4

File diff suppressed because it is too large Load Diff

View File

@ -1,94 +0,0 @@
From 5c102dd94f435e97507213fbd128e50dd15f5f54 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Mon, 20 Dec 2010 13:39:36 +1000
Subject: [PATCH] nouveau: fix includes for latest libdrm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
src/gallium/drivers/nouveau/nouveau_winsys.h | 2 +-
src/gallium/drivers/nv50/nv50_surface.c | 2 +-
src/gallium/drivers/nvfx/nv04_2d.c | 2 +-
src/gallium/drivers/nvfx/nvfx_vbo.c | 3 +--
src/mesa/drivers/dri/nouveau/nouveau_driver.h | 2 +-
5 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
index ab480ca..747b084 100644
--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
@@ -10,7 +10,7 @@
#include "nouveau/nouveau_grobj.h"
#include "nouveau/nouveau_notifier.h"
#include "nouveau/nouveau_resource.h"
-#include "nouveau/nouveau_pushbuf.h"
+#include "nouveau/nv04_pushbuf.h"
#ifndef NV04_PFIFO_MAX_PACKET_LEN
#define NV04_PFIFO_MAX_PACKET_LEN 2047
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
index ce48022..a99df76 100644
--- a/src/gallium/drivers/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nv50/nv50_surface.c
@@ -22,7 +22,7 @@
#define __NOUVEAU_PUSH_H__
#include <stdint.h>
-#include "nouveau/nouveau_pushbuf.h"
+#include "nouveau/nv04_pushbuf.h"
#include "nv50_context.h"
#include "nv50_resource.h"
#include "pipe/p_defines.h"
diff --git a/src/gallium/drivers/nvfx/nv04_2d.c b/src/gallium/drivers/nvfx/nv04_2d.c
index e0e65e7..e2fadd3 100644
--- a/src/gallium/drivers/nvfx/nv04_2d.c
+++ b/src/gallium/drivers/nvfx/nv04_2d.c
@@ -34,11 +34,11 @@
#include <stdio.h>
#include <stdint.h>
#include <nouveau/nouveau_device.h>
-#include <nouveau/nouveau_pushbuf.h>
#include <nouveau/nouveau_channel.h>
#include <nouveau/nouveau_bo.h>
#include <nouveau/nouveau_notifier.h>
#include <nouveau/nouveau_grobj.h>
+#include <nouveau/nv04_pushbuf.h>
#include "nv04_2d.h"
#include "nouveau/nv_object.xml.h"
diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c
index 597664e..339b317 100644
--- a/src/gallium/drivers/nvfx/nvfx_vbo.c
+++ b/src/gallium/drivers/nvfx/nvfx_vbo.c
@@ -9,8 +9,7 @@
#include "nvfx_resource.h"
#include "nouveau/nouveau_channel.h"
-
-#include "nouveau/nouveau_pushbuf.h"
+#include "nouveau/nv04_pushbuf.h"
static inline unsigned
util_guess_unique_indices_count(unsigned mode, unsigned indices)
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
index 8036b18..c5ac128 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
@@ -38,7 +38,6 @@
#include <assert.h>
#include "nouveau_device.h"
-#include "nouveau_pushbuf.h"
#include "nouveau_grobj.h"
#include "nouveau_channel.h"
#include "nouveau_bo.h"
@@ -46,6 +45,7 @@
#include "nouveau_screen.h"
#include "nouveau_state.h"
#include "nouveau_surface.h"
+#include "nv04_pushbuf.h"
#define DRIVER_DATE "20091015"
#define DRIVER_AUTHOR "Nouveau"
--
1.7.3.4

View File

@ -15,7 +15,7 @@
Summary: Mesa graphics libraries Summary: Mesa graphics libraries
Name: mesa Name: mesa
Version: 7.10 Version: 7.10
Release: 0.22%{?dist} Release: 0.23%{?dist}
License: MIT License: MIT
Group: System Environment/Libraries Group: System Environment/Libraries
URL: http://www.mesa3d.org URL: http://www.mesa3d.org
@ -34,11 +34,18 @@ Patch4: legacy-drivers.patch
#Patch7: mesa-7.1-link-shared.patch #Patch7: mesa-7.1-link-shared.patch
Patch8: mesa-7.10-llvmcore.patch Patch8: mesa-7.10-llvmcore.patch
Patch10: mesa-nouveau-libdrm-2_4_24.patch
Patch30: mesa-7.6-hush-vblank-warning.patch Patch30: mesa-7.6-hush-vblank-warning.patch
Patch31: mesa-7.10-swrastg.patch Patch31: mesa-7.10-swrastg.patch
# nouveau patches
#
# update nouveau gallium drivers to git as of 20110117, nvc0 support
Patch50: mesa-7.10-nouveau-updates.patch
# revert various bits to be compatible with 7.10
Patch51: mesa-7.10-nouveau-revert.patch
# fixup classic drivers to new libdrm api
Patch52: mesa-7.10-nouveau-classic-libdrm.patch
BuildRequires: pkgconfig autoconf automake libtool BuildRequires: pkgconfig autoconf automake libtool
%if %{with_hardware} %if %{with_hardware}
BuildRequires: kernel-headers >= 2.6.27-0.305.rc5.git6 BuildRequires: kernel-headers >= 2.6.27-0.305.rc5.git6
@ -221,9 +228,11 @@ Requires: Xorg %(xserver-sdk-abi-requires ansic) %(xserver-sdk-abi-requires vide
%patch4 -p1 -b .classic %patch4 -p1 -b .classic
#patch7 -p1 -b .dricore #patch7 -p1 -b .dricore
%patch8 -p1 -b .llvmcore %patch8 -p1 -b .llvmcore
%patch10 -p1 -b .nv-libdrm
%patch30 -p1 -b .vblank-warning %patch30 -p1 -b .vblank-warning
#patch31 -p1 -b .swrastg #patch31 -p1 -b .swrastg
%patch50 -p1 -b .nv-update
%patch51 -p1 -b .nv-revert
%patch52 -p1 -b .nv-libdrm
%build %build
@ -477,6 +486,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libOSMesa.so %{_libdir}/libOSMesa.so
%changelog %changelog
* Thu Jan 20 2011 Ben Skeggs <bskeggs@redhat.com> 7.10-0.23
- nouveau: nvc0 (fermi) backport + nv10/nv20 gnome-shell fixes
* Tue Jan 18 2011 Adam Jackson <ajax@redhat.com> 7.10-0.22 * Tue Jan 18 2011 Adam Jackson <ajax@redhat.com> 7.10-0.22
- Add -dri-filesystem common subpackage for directory and COPYING - Add -dri-filesystem common subpackage for directory and COPYING
- Add -dri-llvmcore subpackage and buildsystem hack - Add -dri-llvmcore subpackage and buildsystem hack

View File

@ -1,36 +0,0 @@
diff -up mesa-20100529/configure.ac.nouveau mesa-20100529/configure.ac
--- mesa-20100529/configure.ac.nouveau 2010-05-29 18:57:30.000000000 +1000
+++ mesa-20100529/configure.ac 2010-05-29 18:58:24.000000000 +1000
@@ -820,20 +820,20 @@ if test "$mesa_driver" = dri; then
# x86-64 system where they could *ever* be used.
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i915 i965 mga r128 r200 r300 r600 radeon \
- savage tdfx unichrome swrast"
+ savage tdfx unichrome swrast nouveau"
fi
;;
powerpc*)
# Build only the drivers for cards that exist on PowerPC.
# At some point MGA will be added, but not yet.
if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="r128 r200 r300 r600 radeon tdfx swrast"
+ DRI_DIRS="r128 r200 r300 r600 radeon tdfx swrast nouveau"
fi
;;
sparc*)
# Build only the drivers for cards that exist on sparc`
if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="r128 r200 r300 r600 radeon swrast"
+ DRI_DIRS="r128 r200 r300 r600 radeon swrast nouveau"
fi
;;
esac
@@ -870,7 +870,7 @@ if test "$mesa_driver" = dri; then
# default drivers
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mga r128 r200 r300 r600 radeon \
- savage sis tdfx unichrome swrast"
+ savage sis tdfx unichrome swrast nouveau"
fi
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`