From 0abf3937ce651d26b18a3ab93ed916f3e7bd04dd Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Thu, 23 Feb 2006 12:55:56 +0000 Subject: Initial revision --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 129 +++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 src/mesa/drivers/dri/nouveau/nouveau_context.h (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h new file mode 100644 index 0000000000..d287439fcf --- /dev/null +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -0,0 +1,129 @@ +/************************************************************************** + +Copyright 2006 Stephane Marchesin +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, and/or sell copies of the Software, and to permit persons to whom +the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + + + +#ifndef __NOUVEAU_CONTEXT_H__ +#define __NOUVEAU_CONTEXT_H__ + +#include "dri_util.h" +#include "drm.h" +#include "nouveau_drm.h" + +#include "mtypes.h" +#include "tnl/t_vertex.h" + +#include "nouveau_reg.h" +#include "nouveau_screen.h" + +#include "xmlconfig.h" + +typedef struct nouveau_fifo_t{ + u_int32_t* buffer; + u_int32_t current; + u_int32_t put; + u_int32_t free; + u_int32_t max; +} +nouveau_fifo; + +#define TAG(x) nouveau##x +#include "tnl_dd/t_dd_vertex.h" +#undef TAG + + +typedef void (*nouveau_tri_func)( struct nouveau_context*, + nouveauVertex *, + nouveauVertex *, + nouveauVertex * ); + +typedef void (*nouveau_line_func)( struct nouveau_context*, + nouveauVertex *, + nouveauVertex * ); + +typedef void (*nouveau_point_func)( struct nouveau_context*, + nouveauVertex * ); + + +typedef struct nouveau_context { + /* Mesa context */ + GLcontext *glCtx; + + /* The per-context fifo */ + nouveau_fifo fifo; + + /* The fifo control regs */ + volatile unsigned char* fifo_mmio; + + /* The read-only regs */ + volatile unsigned char* mmio; + + /* The drawing fallbacks */ + nouveau_tri_func* draw_tri; + nouveau_line_func* draw_line; + nouveau_point_func* draw_point; + + /* Cliprects information */ + GLuint numClipRects; + drm_clip_rect_t *pClipRects; + + /* The rendering context information */ + GLenum current_primitive; /* the current primitive enum */ + GLuint render_inputs; /* the current render inputs */ + + nouveauScreenRec *screen; + drm_nouveau_sarea_t *sarea; + + __DRIcontextPrivate *driContext; /* DRI context */ + __DRIscreenPrivate *driScreen; /* DRI screen */ + __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */ + + drm_context_t hHWContext; + drm_hw_lock_t *driHwLock; + int driFd; + + /* Configuration cache */ + driOptionCache optionCache; +}nouveauContextRec, *nouveauContextPtr; + +#define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) + + +extern GLboolean nouveauCreateContext( const __GLcontextModes *glVisual, + __DRIcontextPrivate *driContextPriv, + void *sharedContextPrivate ); + +extern void nouveauDestroyContext( __DRIcontextPrivate * ); + +extern GLboolean nouveauMakeCurrent( __DRIcontextPrivate *driContextPriv, + __DRIdrawablePrivate *driDrawPriv, + __DRIdrawablePrivate *driReadPriv ); + +extern GLboolean nouveauUnbindContext( __DRIcontextPrivate *driContextPriv ); + + +#endif /* __NOUVEAU_CONTEXT_H__ */ + -- cgit v1.2.3 From b9c4b7fc896f7ff3188065526b27707ff6e43c77 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Mon, 6 Mar 2006 01:46:24 +0000 Subject: More work on the nv30 software tcl code --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index d287439fcf..49e22f8074 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -54,6 +54,7 @@ nouveau_fifo; #include "tnl_dd/t_dd_vertex.h" #undef TAG +struct nouveau_context; typedef void (*nouveau_tri_func)( struct nouveau_context*, nouveauVertex *, @@ -81,6 +82,11 @@ typedef struct nouveau_context { /* The read-only regs */ volatile unsigned char* mmio; + /* State for tris */ + GLuint vertex_size; + GLuint color_offset; + GLuint specular_offset; + /* The drawing fallbacks */ nouveau_tri_func* draw_tri; nouveau_line_func* draw_line; -- cgit v1.2.3 From f799745f50ff2e61f535816d623e643cc1eac944 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Thu, 13 Apr 2006 17:03:51 +0000 Subject: Some compile fixes. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 49e22f8074..83ac2fd455 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -113,6 +113,8 @@ typedef struct nouveau_context { /* Configuration cache */ driOptionCache optionCache; + + uint32_t vblank_flags; }nouveauContextRec, *nouveauContextPtr; #define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) -- cgit v1.2.3 From 5fd11335f655e27515d9bf92fef5d9a8cd4f6bb5 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 14 Apr 2006 17:39:43 +0000 Subject: Added the beginnings of state (not much there yet). Fixed some includes. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 83ac2fd455..c2929a16a8 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -115,6 +115,9 @@ typedef struct nouveau_context { driOptionCache optionCache; uint32_t vblank_flags; + + GLfloat viewport[16]; + }nouveauContextRec, *nouveauContextPtr; #define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) -- cgit v1.2.3 From 199512968be28aa5a4f41c4f30e0e311e31b252a Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Fri, 14 Apr 2006 22:41:16 +0000 Subject: Cleaned stuff in the tcl code --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index c2929a16a8..93c6f1dfff 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -88,6 +88,7 @@ typedef struct nouveau_context { GLuint specular_offset; /* The drawing fallbacks */ + GLuint Fallback; nouveau_tri_func* draw_tri; nouveau_line_func* draw_line; nouveau_point_func* draw_point; @@ -122,6 +123,18 @@ typedef struct nouveau_context { #define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) +#define NOUVEAU_FALLBACK_TEXTURE 0x0001 +#define NOUVEAU_FALLBACK_DRAW_BUFFER 0x0002 +#define NOUVEAU_FALLBACK_READ_BUFFER 0x0004 +#define NOUVEAU_FALLBACK_STENCIL 0x0008 +#define NOUVEAU_FALLBACK_RENDER_MODE 0x0010 +#define NOUVEAU_FALLBACK_LOGICOP 0x0020 +#define NOUVEAU_FALLBACK_SEP_SPECULAR 0x0040 +#define NOUVEAU_FALLBACK_BLEND_EQ 0x0080 +#define NOUVEAU_FALLBACK_BLEND_FUNC 0x0100 +#define NOUVEAU_FALLBACK_PROJTEX 0x0200 +#define NOUVEAU_FALLBACK_DISABLE 0x0400 + extern GLboolean nouveauCreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, -- cgit v1.2.3 From b7d4314fe1619223caf2f59b1b28e05d7ff0e662 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Fri, 14 Apr 2006 22:43:44 +0000 Subject: Added vertex attributes to the context --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 93c6f1dfff..dcb1442033 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -83,10 +83,14 @@ typedef struct nouveau_context { volatile unsigned char* mmio; /* State for tris */ - GLuint vertex_size; GLuint color_offset; GLuint specular_offset; + /* Vertex state */ + GLuint vertex_size; + struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; + GLuint vertex_attr_count; + /* The drawing fallbacks */ GLuint Fallback; nouveau_tri_func* draw_tri; -- cgit v1.2.3 From 576b3433dacd1f36fe5bb33dcf6c1dbadfe152c9 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 14 Apr 2006 22:50:14 +0000 Subject: Cleaning --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index dcb1442033..442681cb7e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -54,6 +54,10 @@ nouveau_fifo; #include "tnl_dd/t_dd_vertex.h" #undef TAG +/* Subpixel offsets for window coordinates (triangles): */ +#define SUBPIXEL_X (0.0F) +#define SUBPIXEL_Y (0.125F) + struct nouveau_context; typedef void (*nouveau_tri_func)( struct nouveau_context*, @@ -121,7 +125,8 @@ typedef struct nouveau_context { uint32_t vblank_flags; - GLfloat viewport[16]; + GLmatrix viewport; + GLfloat depth_scale; }nouveauContextRec, *nouveauContextPtr; -- cgit v1.2.3 From 4c850f346bde46fef009e43ec46aaac709e8da5a Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Fri, 14 Apr 2006 22:58:30 +0000 Subject: Added render index field to the context --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 442681cb7e..e1b56e36f5 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -127,7 +127,8 @@ typedef struct nouveau_context { GLmatrix viewport; GLfloat depth_scale; - + GLfloat depth_scale; + GLuint render_index; }nouveauContextRec, *nouveauContextPtr; #define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) -- cgit v1.2.3 From 911ec211a5bb801ef3d445f75c705259e53c7597 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Fri, 14 Apr 2006 22:59:33 +0000 Subject: ooops --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index e1b56e36f5..207e446739 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -127,7 +127,6 @@ typedef struct nouveau_context { GLmatrix viewport; GLfloat depth_scale; - GLfloat depth_scale; GLuint render_index; }nouveauContextRec, *nouveauContextPtr; -- cgit v1.2.3 From 97d11ecd6c5d23f682db5c6ef7dfec89185ae307 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 14 Apr 2006 23:02:39 +0000 Subject: Add more feilds to context. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 207e446739..e09d804ccf 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -125,9 +125,12 @@ typedef struct nouveau_context { uint32_t vblank_flags; + GLuint new_state; + GLuint new_render_state; + GLuint render_index; GLmatrix viewport; GLfloat depth_scale; - GLuint render_index; + }nouveauContextRec, *nouveauContextPtr; #define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) -- cgit v1.2.3 From b0c4cfed608f21f255b8637ec5ff499fc36ee302 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Fri, 14 Apr 2006 23:47:45 +0000 Subject: More work on the tcl code... still have to make my mind on a number of things --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index e09d804ccf..c23b633bb9 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -92,6 +92,7 @@ typedef struct nouveau_context { /* Vertex state */ GLuint vertex_size; + char *verts; struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; GLuint vertex_attr_count; -- cgit v1.2.3 From a7d88857680d3d4d2a0788f18c49149dd2118b6f Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sat, 15 Apr 2006 00:21:44 +0000 Subject: State changes. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index c23b633bb9..7405bb4145 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -96,6 +96,9 @@ typedef struct nouveau_context { struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; GLuint vertex_attr_count; + /* Color state */ + GLuint clear_color; + /* The drawing fallbacks */ GLuint Fallback; nouveau_tri_func* draw_tri; @@ -134,8 +137,22 @@ typedef struct nouveau_context { }nouveauContextRec, *nouveauContextPtr; + #define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) +/* Flags for what context state needs to be updated: */ +#define NOUVEAU_NEW_ALPHA 0x0001 +#define NOUVEAU_NEW_DEPTH 0x0002 +#define NOUVEAU_NEW_FOG 0x0004 +#define NOUVEAU_NEW_CLIP 0x0008 +#define NOUVEAU_NEW_CULL 0x0010 +#define NOUVEAU_NEW_MASKS 0x0020 +#define NOUVEAU_NEW_RENDER_NOT 0x0040 +#define NOUVEAU_NEW_WINDOW 0x0080 +#define NOUVEAU_NEW_CONTEXT 0x0100 +#define NOUVEAU_NEW_ALL 0x01ff + +/* Flags for software fallback cases: */ #define NOUVEAU_FALLBACK_TEXTURE 0x0001 #define NOUVEAU_FALLBACK_DRAW_BUFFER 0x0002 #define NOUVEAU_FALLBACK_READ_BUFFER 0x0004 -- cgit v1.2.3 From 13a2d6698fce050732b421107a2a92b37a5e01f8 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Mon, 17 Apr 2006 15:20:29 +0000 Subject: More context. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 7405bb4145..e1c5d4d54e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -96,8 +96,10 @@ typedef struct nouveau_context { struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; GLuint vertex_attr_count; - /* Color state */ + /* Clear state */ GLuint clear_color; + GLuint clear_depth; + GLuint clear_stencil; /* The drawing fallbacks */ GLuint Fallback; -- cgit v1.2.3 From 908388b11841c50c94c1c746819276809a545a32 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sun, 17 Sep 2006 11:58:52 +0000 Subject: Some work towards making the nv10 swtcl compile --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index e1c5d4d54e..ad3d00f588 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -103,9 +103,9 @@ typedef struct nouveau_context { /* The drawing fallbacks */ GLuint Fallback; - nouveau_tri_func* draw_tri; - nouveau_line_func* draw_line; - nouveau_point_func* draw_point; + nouveau_tri_func draw_tri; + nouveau_line_func draw_line; + nouveau_point_func draw_point; /* Cliprects information */ GLuint numClipRects; -- cgit v1.2.3 From e324c52237fd1184a1f8436c8735cdd9ade5e067 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sun, 17 Sep 2006 12:09:11 +0000 Subject: Make nouveau actually compile --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index ad3d00f588..28fe944280 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -113,7 +113,7 @@ typedef struct nouveau_context { /* The rendering context information */ GLenum current_primitive; /* the current primitive enum */ - GLuint render_inputs; /* the current render inputs */ + GLuint render_inputs_bitset; /* the current render inputs */ nouveauScreenRec *screen; drm_nouveau_sarea_t *sarea; -- cgit v1.2.3 From c67f54552077b780df574cbcdea70b2cc37076ef Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sun, 17 Sep 2006 14:36:07 +0000 Subject: Small changes --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 28fe944280..c5783993c7 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -92,7 +92,7 @@ typedef struct nouveau_context { /* Vertex state */ GLuint vertex_size; - char *verts; + GLubyte *verts; struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; GLuint vertex_attr_count; -- cgit v1.2.3 From 2d2d617dbc17817f214e0b523f929de1f5d8f48a Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Wed, 1 Nov 2006 02:45:12 +0000 Subject: Oops. Forgot to check in the context change. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index c5783993c7..21aa1a6313 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -129,7 +129,9 @@ typedef struct nouveau_context { /* Configuration cache */ driOptionCache optionCache; + /* vblank stuff */ uint32_t vblank_flags; + uint32_t vblank_seq; GLuint new_state; GLuint new_render_state; -- cgit v1.2.3 From e2b4d9b317104ff3c56a9bf108aa79084d49eba5 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sun, 5 Nov 2006 13:46:48 +0000 Subject: Architect the DRI : - make use of the autogenerated nouveau_reg.h file - add object creation to the DRI - some work on screen and context creation --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 21aa1a6313..be0785f453 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -36,13 +36,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mtypes.h" #include "tnl/t_vertex.h" -#include "nouveau_reg.h" #include "nouveau_screen.h" #include "xmlconfig.h" typedef struct nouveau_fifo_t{ u_int32_t* buffer; + u_int32_t* mmio; u_int32_t current; u_int32_t put; u_int32_t free; @@ -80,9 +80,6 @@ typedef struct nouveau_context { /* The per-context fifo */ nouveau_fifo fifo; - /* The fifo control regs */ - volatile unsigned char* fifo_mmio; - /* The read-only regs */ volatile unsigned char* mmio; -- cgit v1.2.3 From f82bc9110b3b06f3313e584e860d0e41d11965f0 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sat, 11 Nov 2006 00:00:45 +0000 Subject: Some work on nv30 state, heavily based on jkolb's work --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index be0785f453..d1abde6856 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -83,6 +83,7 @@ typedef struct nouveau_context { /* The read-only regs */ volatile unsigned char* mmio; + /* FIXME : do we want to put all state into a separate struct ? */ /* State for tris */ GLuint color_offset; GLuint specular_offset; @@ -93,10 +94,11 @@ typedef struct nouveau_context { struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; GLuint vertex_attr_count; - /* Clear state */ - GLuint clear_color; - GLuint clear_depth; - GLuint clear_stencil; + /* Depth/stencil clear state */ + uint32_t clear_value; + + /* Light state */ + uint32_t enabled_lights; /* The drawing fallbacks */ GLuint Fallback; -- cgit v1.2.3 From 0850289d8c66f75ac72347b1bf4bf6d15fb60139 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sat, 11 Nov 2006 11:25:08 +0000 Subject: Add the GL_LIGHING enable --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index d1abde6856..257d09f8b2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -98,6 +98,7 @@ typedef struct nouveau_context { uint32_t clear_value; /* Light state */ + GLboolean lighting_enabled; uint32_t enabled_lights; /* The drawing fallbacks */ -- cgit v1.2.3 From 2af374716f351421b978050b113e93abae0e2dc8 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sun, 12 Nov 2006 08:38:44 +0000 Subject: Some more nouveau_screen.c setup, not sure how correct it is yet though.. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 257d09f8b2..1da5b6d61d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -182,6 +182,10 @@ extern GLboolean nouveauMakeCurrent( __DRIcontextPrivate *driContextPriv, extern GLboolean nouveauUnbindContext( __DRIcontextPrivate *driContextPriv ); +extern void nouveauSwapBuffers(__DRIdrawablePrivate *dPriv); + +extern void nouveauCopySubBuffer(__DRIdrawablePrivate *dPriv, + int x, int y, int w, int h); #endif /* __NOUVEAU_CONTEXT_H__ */ -- cgit v1.2.3 From 10172f7485367182a5745a2114ed7e90830682f8 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 17 Nov 2006 04:50:37 +0000 Subject: Adapt FIFO code to deal with cases where the base GET/PUT value isn't 0. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 1da5b6d61d..85d71cb04c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -43,6 +43,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. typedef struct nouveau_fifo_t{ u_int32_t* buffer; u_int32_t* mmio; + u_int32_t put_base; u_int32_t current; u_int32_t put; u_int32_t free; -- cgit v1.2.3 From 08020927e826068a1ebc208e63c6a0d53711e96e Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 17 Nov 2006 21:58:02 +0000 Subject: Use RENDERINPUTS macros to access render_inputs_bitset --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 85d71cb04c..09972bebac 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -114,7 +114,7 @@ typedef struct nouveau_context { /* The rendering context information */ GLenum current_primitive; /* the current primitive enum */ - GLuint render_inputs_bitset; /* the current render inputs */ + DECLARE_RENDERINPUTS(render_inputs_bitset); /* the current render inputs */ nouveauScreenRec *screen; drm_nouveau_sarea_t *sarea; -- cgit v1.2.3 From 0ea45b1ad822ebdce2af3faef77ed776ca32d46b Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Tue, 21 Nov 2006 12:43:16 +0000 Subject: Add the state caching mechanism. It seems to work, from what I can see. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 09972bebac..8ae7be015d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -37,6 +37,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_vertex.h" #include "nouveau_screen.h" +#include "nouveau_state_cache.h" #include "xmlconfig.h" @@ -73,7 +74,6 @@ typedef void (*nouveau_line_func)( struct nouveau_context*, typedef void (*nouveau_point_func)( struct nouveau_context*, nouveauVertex * ); - typedef struct nouveau_context { /* Mesa context */ GLcontext *glCtx; @@ -102,6 +102,9 @@ typedef struct nouveau_context { GLboolean lighting_enabled; uint32_t enabled_lights; + /* Cached state */ + nouveau_state_cache state_cache; + /* The drawing fallbacks */ GLuint Fallback; nouveau_tri_func draw_tri; -- cgit v1.2.3 From 9c9e6abbf82fbf591575a9c352f86721bc72aa90 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 25 Nov 2006 09:58:35 +0000 Subject: Incomplete shader stuff, should mostly work for NV40. Other cards, not so much.. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 8ae7be015d..e488f9d42d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -38,6 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "nouveau_screen.h" #include "nouveau_state_cache.h" +#include "nouveau_shader.h" #include "xmlconfig.h" @@ -119,6 +120,12 @@ typedef struct nouveau_context { GLenum current_primitive; /* the current primitive enum */ DECLARE_RENDERINPUTS(render_inputs_bitset); /* the current render inputs */ + /* Shader state */ + nvsFunc VPfunc; + nvsFunc FPfunc; + nouveauShader *current_fragprog; + nouveauShader *current_vertprog; + nouveauScreenRec *screen; drm_nouveau_sarea_t *sarea; -- cgit v1.2.3 From d88d895e5a642cffaaf6b654b27686f2eac901d2 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sun, 3 Dec 2006 09:08:26 +0000 Subject: Merge the pciid work. Use lock step versioning with the drm. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index e488f9d42d..947e95d18b 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -155,18 +155,6 @@ typedef struct nouveau_context { #define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx)) -/* Flags for what context state needs to be updated: */ -#define NOUVEAU_NEW_ALPHA 0x0001 -#define NOUVEAU_NEW_DEPTH 0x0002 -#define NOUVEAU_NEW_FOG 0x0004 -#define NOUVEAU_NEW_CLIP 0x0008 -#define NOUVEAU_NEW_CULL 0x0010 -#define NOUVEAU_NEW_MASKS 0x0020 -#define NOUVEAU_NEW_RENDER_NOT 0x0040 -#define NOUVEAU_NEW_WINDOW 0x0080 -#define NOUVEAU_NEW_CONTEXT 0x0100 -#define NOUVEAU_NEW_ALL 0x01ff - /* Flags for software fallback cases: */ #define NOUVEAU_FALLBACK_TEXTURE 0x0001 #define NOUVEAU_FALLBACK_DRAW_BUFFER 0x0002 -- cgit v1.2.3 From 4cfb762c3eb2ea9a764c7ba0811c338ef5fba8fe Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 8 Dec 2006 03:01:33 +0000 Subject: Some work on buffer handling, most likely not entirely correct and incomplete. But, it works well enough that windows can be moved/resized. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 947e95d18b..211d4e0a6d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -38,6 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "nouveau_screen.h" #include "nouveau_state_cache.h" +#include "nouveau_buffers.h" #include "nouveau_shader.h" #include "xmlconfig.h" @@ -75,6 +76,17 @@ typedef void (*nouveau_line_func)( struct nouveau_context*, typedef void (*nouveau_point_func)( struct nouveau_context*, nouveauVertex * ); +typedef struct nouveau_hw_func_t { + /* Initialise any card-specific non-GL related state */ + GLboolean (*InitCard)(struct nouveau_context *); + /* Update buffer offset/pitch/format */ + GLboolean (*BindBuffers)(struct nouveau_context *, int num_color, + nouveau_renderbuffer **color, + nouveau_renderbuffer *depth); + /* Update anything that depends on the window position/size */ + void (*WindowMoved)(struct nouveau_context *); +} nouveau_hw_func; + typedef struct nouveau_context { /* Mesa context */ GLcontext *glCtx; @@ -85,6 +97,13 @@ typedef struct nouveau_context { /* The read-only regs */ volatile unsigned char* mmio; + /* Physical addresses of AGP/VRAM apertures */ + uint64_t vram_phys; + uint64_t agp_phys; + + /* Additional hw-specific functions */ + nouveau_hw_func hw_func; + /* FIXME : do we want to put all state into a separate struct ? */ /* State for tris */ GLuint color_offset; @@ -132,6 +151,7 @@ typedef struct nouveau_context { __DRIcontextPrivate *driContext; /* DRI context */ __DRIscreenPrivate *driScreen; /* DRI screen */ __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */ + GLint lastStamp; drm_context_t hHWContext; drm_hw_lock_t *driHwLock; -- cgit v1.2.3 From de947e8a5b2f10eb3fd2bdeacc54209e55447e86 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 16 Dec 2006 12:32:11 +0000 Subject: Get nv10_swtcl.c working enough for glxgears on NV40. --- src/mesa/drivers/dri/nouveau/nouveau_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.h') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 211d4e0a6d..d7730bd796 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -144,6 +144,7 @@ typedef struct nouveau_context { nvsFunc FPfunc; nouveauShader *current_fragprog; nouveauShader *current_vertprog; + nouveauShader *passthrough_vp; nouveauScreenRec *screen; drm_nouveau_sarea_t *sarea; -- cgit v1.2.3