mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 06:50:11 +01:00
* Added options for disabling the fast path (render stage) and vertex DMA
* Fixed disabling of the render stage * Added debug output for per-primitive fallbacks * Bumped driver date
This commit is contained in:
parent
14dee36fa7
commit
677d1d07c4
5 changed files with 42 additions and 15 deletions
|
|
@ -57,6 +57,19 @@
|
|||
|
||||
#include "xmlpool.h"
|
||||
|
||||
/* Driver-specific options
|
||||
*/
|
||||
#define SAVAGE_ENABLE_VDMA(def) \
|
||||
DRI_CONF_OPT_BEGIN(enable_vdma,bool,def) \
|
||||
DRI_CONF_DESC(en,"Use DMA for vertex transfers") \
|
||||
DRI_CONF_DESC(de,"Benutze DMA für Vertextransfers") \
|
||||
DRI_CONF_OPT_END
|
||||
#define SAVAGE_ENABLE_FASTPATH(def) \
|
||||
DRI_CONF_OPT_BEGIN(enable_fastpath,bool,def) \
|
||||
DRI_CONF_DESC(en,"Use fast path for unclipped primitives") \
|
||||
DRI_CONF_DESC(de,"Schneller Codepfad für ungeschnittene Polygone") \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
/* Configuration
|
||||
*/
|
||||
PUBLIC const char __driConfigOptions[] =
|
||||
|
|
@ -68,12 +81,14 @@ DRI_CONF_BEGIN
|
|||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_SECTION_PERFORMANCE
|
||||
DRI_CONF_MAX_TEXTURE_UNITS(2,1,2)
|
||||
SAVAGE_ENABLE_VDMA(true)
|
||||
SAVAGE_ENABLE_FASTPATH(true)
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_NO_RAST(false)
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_END;
|
||||
static const GLuint __driNConfigOptions = 5;
|
||||
static const GLuint __driNConfigOptions = 7;
|
||||
|
||||
#ifdef USE_NEW_INTERFACE
|
||||
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
|
||||
|
|
@ -470,13 +485,15 @@ savageCreateContext( const __GLcontextModes *mesaVis,
|
|||
/* DRM versions before 2.1.3 would only render triangle lists. ELTS
|
||||
* support was added in 2.2.0. */
|
||||
if (sPriv->drmMinor < 2) {
|
||||
_savage_render_stage.active = GL_FALSE;
|
||||
imesa->enable_fastpath = GL_FALSE;
|
||||
fprintf (stderr,
|
||||
"*** Disabling fast path because your DRM version is buggy "
|
||||
"or doesn't\n*** support ELTS. You need at least Savage DRM "
|
||||
"version 2.2.\n");
|
||||
}
|
||||
|
||||
} else
|
||||
imesa->enable_fastpath = driQueryOptionb(&imesa->optionCache,
|
||||
"enable_fastpath");
|
||||
imesa->enable_vdma = driQueryOptionb(&imesa->optionCache, "enable_vdma");
|
||||
|
||||
/* Configure swrast to match hardware characteristics:
|
||||
*/
|
||||
|
|
@ -520,6 +537,7 @@ savageDestroyContext(__DRIcontextPrivate *driContextPriv)
|
|||
savageFlushVertices(imesa);
|
||||
savageReleaseIndexedVerts(imesa);
|
||||
savageFlushCmdBuf(imesa, GL_TRUE); /* release DMA buffer */
|
||||
WAIT_IDLE_EMPTY;
|
||||
|
||||
/* update for multi-tex*/
|
||||
{
|
||||
|
|
|
|||
|
|
@ -304,6 +304,8 @@ struct savage_context_t {
|
|||
GLint texture_depth;
|
||||
GLboolean no_rast;
|
||||
GLboolean float_depth;
|
||||
GLboolean enable_fastpath;
|
||||
GLboolean enable_vdma;
|
||||
};
|
||||
|
||||
#define SAVAGE_CONTEXT(ctx) ((savageContextPtr)(ctx->DriverCtx))
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#include "utils.h"
|
||||
|
||||
|
||||
#define DRIVER_DATE "20050110"
|
||||
#define DRIVER_DATE "20050120"
|
||||
|
||||
/***************************************
|
||||
* Mesa's Driver Functions
|
||||
|
|
|
|||
|
|
@ -215,6 +215,7 @@ static void savage_check_render( GLcontext *ctx,
|
|||
struct tnl_pipeline_stage *stage )
|
||||
{
|
||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
||||
stage->active = SAVAGE_CONTEXT(ctx)->enable_fastpath;
|
||||
}
|
||||
|
||||
static void dtr( struct tnl_pipeline_stage *stage )
|
||||
|
|
|
|||
|
|
@ -738,6 +738,10 @@ static void savageChooseRenderState(GLcontext *ctx)
|
|||
if (flags & LINE_FALLBACK) imesa->draw_line = savage_fallback_line;
|
||||
if (flags & TRI_FALLBACK) imesa->draw_tri = savage_fallback_tri;
|
||||
index |= SAVAGE_FALLBACK_BIT;
|
||||
if (SAVAGE_DEBUG & DEBUG_FALLBACKS) {
|
||||
fprintf (stderr, "Per-primitive fallback, TriangleCaps=0x%x\n",
|
||||
ctx->_TriangleCaps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1032,17 +1036,19 @@ static __inline__ GLuint savageChooseVertexFormat_s4( GLcontext *ctx )
|
|||
if (setupIndex == imesa->SetupIndex && imesa->vertex_size != 0)
|
||||
return setupIndex;
|
||||
|
||||
mask = SAVAGE_SKIP_W;
|
||||
size = 10 - (skip & 1) - (skip >> 1 & 1) -
|
||||
(skip >> 2 & 1) - (skip >> 3 & 1) - (skip >> 4 & 1) -
|
||||
(skip >> 5 & 1) - (skip >> 6 & 1) - (skip >> 7 & 1);
|
||||
if (imesa->enable_vdma) {
|
||||
mask = SAVAGE_SKIP_W;
|
||||
size = 10 - (skip & 1) - (skip >> 1 & 1) -
|
||||
(skip >> 2 & 1) - (skip >> 3 & 1) - (skip >> 4 & 1) -
|
||||
(skip >> 5 & 1) - (skip >> 6 & 1) - (skip >> 7 & 1);
|
||||
|
||||
while (size < 8) {
|
||||
if (skip & mask) {
|
||||
skip &= ~mask;
|
||||
size++;
|
||||
while (size < 8) {
|
||||
if (skip & mask) {
|
||||
skip &= ~mask;
|
||||
size++;
|
||||
}
|
||||
mask <<= 1;
|
||||
}
|
||||
mask <<= 1;
|
||||
}
|
||||
|
||||
imesa->vertex_attr_count = 0;
|
||||
|
|
@ -1167,7 +1173,7 @@ static void savageRenderStart( GLcontext *ctx )
|
|||
* discard the DMA buffer, if we were using one. */
|
||||
savageFlushVertices(imesa);
|
||||
savageFlushCmdBuf(imesa, GL_TRUE);
|
||||
if (hwVertexSize == 8) {
|
||||
if (hwVertexSize == 8 && imesa->enable_vdma) {
|
||||
if (SAVAGE_DEBUG & DEBUG_DMA)
|
||||
fprintf (stderr, "Using DMA, skip=0x%02x\n", imesa->skip);
|
||||
/* we can use vertex dma */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue