[Mesa-dev] [PATCH 1/2] nouveau: allow NV3x's to be used with nouveau_vieux
Ilia Mirkin
imirkin at alum.mit.edu
Sun Aug 28 00:01:15 UTC 2016
NV34 and possibly other NV3x hardware has the capability of exposing the
NV25 graph class. This allows forcing nouveau_vieux to be used instead
of the gallium driver, primarily for testing purposes. (Among other
things, NV2x only ever came as AGP or inside an Xbox, never PCI/PCIe).
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/loader/pci_id_driver_map.c | 4 +++-
src/mesa/drivers/dri/nouveau/nouveau_screen.c | 1 +
src/mesa/drivers/dri/nouveau/nv04_surface.c | 4 +++-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/loader/pci_id_driver_map.c b/src/loader/pci_id_driver_map.c
index 3c4657f..8b2079e 100644
--- a/src/loader/pci_id_driver_map.c
+++ b/src/loader/pci_id_driver_map.c
@@ -25,6 +25,7 @@ int is_nouveau_vieux(int fd);
#ifdef HAVE_LIBDRM
+#include <stdlib.h>
#include <xf86drm.h>
#include <nouveau_drm.h>
@@ -45,7 +46,8 @@ int
is_nouveau_vieux(int fd)
{
int chipset = nouveau_chipset(fd);
- return chipset > 0 && chipset < 0x30;
+ return (chipset > 0 && chipset < 0x30) ||
+ (chipset < 0x40 && getenv("NOUVEAU_VIEUX") != NULL);
}
#else
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 0545e68..de578a5 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -130,6 +130,7 @@ nouveau_init_screen2(__DRIscreen *dri_screen)
dri_screen->max_gl_es1_version = 10;
break;
case 0x20:
+ case 0x30:
screen->driver = &nv20_driver;
dri_screen->max_gl_compat_version = 13;
dri_screen->max_gl_es1_version = 10;
diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c
index 968c05f..b1f0ea0 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c
@@ -577,8 +577,10 @@ nv04_surface_init(struct gl_context *ctx)
/* Swizzled surface. */
if (context_chipset(ctx) < 0x20)
class = NV04_SURFACE_SWZ_CLASS;
- else
+ else if (context_chipset (ctx) < 0x30)
class = NV20_SURFACE_SWZ_CLASS;
+ else
+ class = NV30_SURFACE_SWZ_CLASS;
ret = nouveau_object_new(chan, handle++, class, NULL, 0, &hw->swzsurf);
if (ret)
--
2.7.3
More information about the mesa-dev
mailing list