summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/common/driverfuncs.c2
-rw-r--r--src/mesa/drivers/common/meta.c1
-rw-r--r--src/mesa/drivers/dri/common/dri_metaops.c8
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c21
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h16
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.c1
-rw-r--r--src/mesa/drivers/dri/common/xmlconfig.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_cache.c8
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c13
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c24
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.h3
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c23
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.h1
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bo_state.c8
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c33
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_screen.c12
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_draw.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertprog.c2
-rw-r--r--src/mesa/drivers/dri/r600/r700_assembler.c6
-rw-r--r--src/mesa/drivers/dri/r600/r700_chip.c13
-rw-r--r--src/mesa/drivers/dri/r600/r700_vertprog.c2
24 files changed, 139 insertions, 75 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 5c5e17820d..49d4aaedb0 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -26,7 +26,6 @@
#include "main/glheader.h"
#include "main/imports.h"
#include "main/arrayobj.h"
-#include "main/buffers.h"
#include "main/context.h"
#include "main/framebuffer.h"
#include "main/mipmap.h"
@@ -50,7 +49,6 @@
#endif
#include "shader/program.h"
-#include "shader/prog_execute.h"
#include "shader/shader_api.h"
#include "tnl/tnl.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index e500359bb7..7116d920f7 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -56,7 +56,6 @@
#include "main/stencil.h"
#include "main/texobj.h"
#include "main/texenv.h"
-#include "main/texformat.h"
#include "main/teximage.h"
#include "main/texparam.h"
#include "main/texstate.h"
diff --git a/src/mesa/drivers/dri/common/dri_metaops.c b/src/mesa/drivers/dri/common/dri_metaops.c
index c7bea07dc9..dfb7d64040 100644
--- a/src/mesa/drivers/dri/common/dri_metaops.c
+++ b/src/mesa/drivers/dri/common/dri_metaops.c
@@ -27,17 +27,9 @@
**************************************************************************/
#include "main/arrayobj.h"
-#include "main/attrib.h"
-#include "main/blend.h"
#include "main/bufferobj.h"
-#include "main/buffers.h"
-#include "main/depth.h"
#include "main/enable.h"
#include "main/matrix.h"
-#include "main/macros.h"
-#include "main/polygon.h"
-#include "main/shaders.h"
-#include "main/stencil.h"
#include "main/texstate.h"
#include "main/varray.h"
#include "main/viewport.h"
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 3649c29666..b891fca2b1 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -454,7 +454,6 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
pdp->driScreenPriv = psp;
pdp->driContextPriv = &psp->dummyContextPriv;
- pdp->validBuffers = GL_FALSE;
if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes,
renderType == GLX_PIXMAP_BIT)) {
@@ -485,8 +484,11 @@ dri2CreateNewDrawable(__DRIscreen *screen,
if (!pdraw)
return NULL;
- pdraw->pClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects);
- pdraw->pBackClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects);
+ pdraw->pClipRects = &pdraw->dri2.clipRect;
+ pdraw->pBackClipRects = &pdraw->dri2.clipRect;
+
+ pdraw->pStamp = &pdraw->dri2.stamp;
+ *pdraw->pStamp = pdraw->lastStamp + 1;
return pdraw;
}
@@ -507,11 +509,11 @@ static void dri_put_drawable(__DRIdrawable *pdp)
psp = pdp->driScreenPriv;
(*psp->DriverAPI.DestroyBuffer)(pdp);
- if (pdp->pClipRects) {
+ if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
_mesa_free(pdp->pClipRects);
pdp->pClipRects = NULL;
}
- if (pdp->pBackClipRects) {
+ if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
_mesa_free(pdp->pBackClipRects);
pdp->pBackClipRects = NULL;
}
@@ -581,7 +583,8 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
pcp->driScreenPriv = psp;
pcp->driDrawablePriv = NULL;
-
+ pcp->loaderPrivate = data;
+
/* When the first context is created for a screen, initialize a "dummy"
* context.
*/
@@ -948,4 +951,10 @@ driCalculateSwapUsage( __DRIdrawable *dPriv, int64_t last_swap_ust,
return usage;
}
+void
+dri2InvalidateDrawable(__DRIdrawable *drawable)
+{
+ drawable->dri2.stamp++;
+}
+
/*@}*/
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index 95df702f1a..8f0cd4cf9d 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -295,7 +295,8 @@ struct __DRIdrawableRec {
unsigned int index;
/**
- * Pointer to the "drawable has changed ID" stamp in the SAREA.
+ * Pointer to the "drawable has changed ID" stamp in the SAREA (or
+ * to dri2.stamp if DRI2 is being used).
*/
unsigned int *pStamp;
@@ -377,7 +378,10 @@ struct __DRIdrawableRec {
*/
unsigned int swap_interval;
- GLboolean validBuffers;
+ struct {
+ unsigned int stamp;
+ drm_clip_rect_t clipRect;
+ } dri2;
};
/**
@@ -413,6 +417,11 @@ struct __DRIcontextRec {
* Pointer to screen on which this context was created.
*/
__DRIscreen *driScreenPriv;
+
+ /**
+ * The loaders's private context data. This structure is opaque.
+ */
+ void *loaderPrivate;
};
/**
@@ -550,4 +559,7 @@ driCalculateSwapUsage( __DRIdrawable *dPriv,
extern GLint
driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 );
+extern void
+dri2InvalidateDrawable(__DRIdrawable *drawable);
+
#endif /* _DRI_UTIL_H_ */
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c
index 3126ea8476..fe38f608a9 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.c
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.c
@@ -1,7 +1,6 @@
#include "main/mtypes.h"
#include "main/formats.h"
-#include "main/framebuffer.h"
#include "main/renderbuffer.h"
#include "main/imports.h"
#include "drirenderbuffer.h"
diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c
index 46ba2ffbfe..477259ea7e 100644
--- a/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/src/mesa/drivers/dri/common/xmlconfig.c
@@ -39,13 +39,6 @@
#include "dri_util.h"
#include "xmlconfig.h"
-/*
- * OS dependent ways of getting the name of the running program
- */
-#if (defined(__unix__) || defined(unix)) && !defined(USG)
-#include <sys/param.h>
-#endif
-
#undef GET_PROGRAM_NAME
#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index 5fc47b0420..1369d97e21 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -59,15 +59,7 @@
#include "main/imports.h"
#include "brw_state.h"
#include "intel_batchbuffer.h"
-
-/* XXX: Fixme - have to include these to get the sizes of the prog_key
- * structs:
- */
#include "brw_wm.h"
-#include "brw_vs.h"
-#include "brw_clip.h"
-#include "brw_sf.h"
-#include "brw_gs.h"
static GLuint
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index e9315a50fe..81d5a32476 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -195,7 +195,6 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
__DRIscreen *screen;
int i, count;
unsigned int attachments[10];
- uint32_t name;
const char *region_name;
if (INTEL_DEBUG & DEBUG_DRI)
@@ -324,11 +323,8 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
if (rb == NULL)
continue;
- if (rb->region) {
- dri_bo_flink(rb->region->buffer, &name);
- if (name == buffers[i].name)
+ if (rb->region && rb->region->name == buffers[i].name)
continue;
- }
if (INTEL_DEBUG & DEBUG_DRI)
fprintf(stderr,
@@ -360,11 +356,8 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
if (rb != NULL) {
struct intel_region *stencil_region = NULL;
- if (rb->region) {
- dri_bo_flink(rb->region->buffer, &name);
- if (name == buffers[i].name)
+ if (rb->region && rb->region->name == buffers[i].name)
continue;
- }
intel_region_reference(&stencil_region, region);
intel_renderbuffer_set_region(rb, stencil_region);
@@ -373,8 +366,8 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
}
}
- drawable->validBuffers = GL_TRUE;
driUpdateFramebufferSize(&intel->ctx, drawable);
+ drawable->lastStamp = drawable->dri2.stamp;
}
void
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index e2859e44f9..881653ff01 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -42,6 +42,7 @@
#include <sys/ioctl.h>
#include <errno.h>
+#include <main/hash.h>
#include "intel_context.h"
#include "intel_regions.h"
#include "intel_blit.h"
@@ -228,10 +229,24 @@ intel_region_alloc_for_handle(struct intel_context *intel,
GLuint width, GLuint height, GLuint pitch,
GLuint handle, const char *name)
{
- struct intel_region *region;
+ struct intel_region *region, *dummy;
dri_bo *buffer;
int ret;
+ region = _mesa_HashLookup(intel->intelScreen->named_regions, handle);
+ if (region != NULL) {
+ dummy = NULL;
+ if (region->width != width || region->height != height ||
+ region->cpp != cpp || region->pitch != pitch) {
+ fprintf(stderr,
+ "Region for name %d already exists but is not compatible\n",
+ handle);
+ return NULL;
+ }
+ intel_region_reference(&dummy, region);
+ return dummy;
+ }
+
buffer = intel_bo_gem_create_from_name(intel->bufmgr, name, handle);
region = intel_region_alloc_internal(intel, cpp,
@@ -248,6 +263,10 @@ intel_region_alloc_for_handle(struct intel_context *intel,
return NULL;
}
+ region->name = handle;
+ region->screen = intel->intelScreen;
+ _mesa_HashInsert(intel->intelScreen->named_regions, handle, region);
+
return region;
}
@@ -287,6 +306,9 @@ intel_region_release(struct intel_region **region_handle)
region->pbo = NULL;
dri_bo_unreference(region->buffer);
+ if (region->name > 0)
+ _mesa_HashRemove(region->screen->named_regions, region->name);
+
free(region);
}
*region_handle = NULL;
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index 860ae11bd2..6d36f3d88a 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.h
+++ b/src/mesa/drivers/dri/intel/intel_regions.h
@@ -67,6 +67,9 @@ struct intel_region
uint32_t tiling; /**< Which tiling mode the region is in */
uint32_t bit_6_swizzle; /**< GEM flag for address swizzling requirement */
struct intel_buffer_object *pbo; /* zero-copy uploads */
+
+ uint32_t name; /**< Global name for the bo */
+ struct intel_screen *screen;
};
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 6dc20d0fef..8eed8ee737 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -29,6 +29,7 @@
#include "main/context.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
+#include "main/hash.h"
#include "utils.h"
#include "xmlpool.h"
@@ -122,22 +123,19 @@ intelDRI2Flush(__DRIdrawable *drawable)
}
static void
-intelDRI2FlushInvalidate(__DRIdrawable *drawable)
+intelDRI2Invalidate(__DRIdrawable *drawable)
{
struct intel_context *intel = drawable->driContextPriv->driverPrivate;
intel->using_dri2_swapbuffers = GL_TRUE;
-
- intelDRI2Flush(drawable);
- drawable->validBuffers = GL_FALSE;
-
+ dri2InvalidateDrawable(drawable);
intel_update_renderbuffers(intel->driContext, drawable);
}
static const struct __DRI2flushExtensionRec intelFlushExtension = {
{ __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
intelDRI2Flush,
- intelDRI2FlushInvalidate,
+ intelDRI2Invalidate,
};
static const __DRIextension *intelScreenExtensions[] = {
@@ -167,6 +165,11 @@ intel_get_param(__DRIscreen *psp, int param, int *value)
}
static void
+nop_callback(GLuint key, void *data, void *userData)
+{
+}
+
+static void
intelDestroyScreen(__DRIscreen * sPriv)
{
struct intel_screen *intelScreen = sPriv->private;
@@ -174,6 +177,12 @@ intelDestroyScreen(__DRIscreen * sPriv)
dri_bufmgr_destroy(intelScreen->bufmgr);
driDestroyOptionInfo(&intelScreen->optionCache);
+ /* Some regions may still have references to them at this point, so
+ * flush the hash table to prevent _mesa_DeleteHashTable() from
+ * complaining about the hash not being empty; */
+ _mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL);
+ _mesa_DeleteHashTable(intelScreen->named_regions);
+
FREE(intelScreen);
sPriv->private = NULL;
}
@@ -324,6 +333,8 @@ intel_init_bufmgr(struct intel_screen *intelScreen)
else
intelScreen->kernel_exec_fencing = GL_FALSE;
+ intelScreen->named_regions = _mesa_NewHashTable();
+
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h
index c31b836552..1ce476daca 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.h
+++ b/src/mesa/drivers/dri/intel/intel_screen.h
@@ -47,6 +47,7 @@ struct intel_screen
GLboolean no_vbo;
dri_bufmgr *bufmgr;
GLboolean kernel_exec_fencing;
+ struct _mesa_HashTable *named_regions;
/**
* Configuration cache with default values for all contexts
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index d63292edd3..bc4e5c6136 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -748,7 +748,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (!intelObj)
return;
- if (!dPriv->validBuffers)
+ if (dPriv->lastStamp != *dPriv->pStamp)
intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
index 664632f407..fc5f77b46a 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
@@ -32,7 +32,6 @@ nouveau_bo_marker_emit(GLcontext *ctx, struct nouveau_bo_marker *m,
uint32_t flags)
{
struct nouveau_channel *chan = context_chan(ctx);
- struct nouveau_pushbuf *push = chan->pushbuf;
uint32_t packet;
if (m->gr->bound == NOUVEAU_GROBJ_UNBOUND)
@@ -41,11 +40,10 @@ nouveau_bo_marker_emit(GLcontext *ctx, struct nouveau_bo_marker *m,
if (MARK_RING(chan, 2, 2))
return GL_FALSE;
- push->remaining -= 2;
packet = (m->gr->subc << 13) | (1 << 18) | m->mthd;
if (flags) {
- if (nouveau_pushbuf_emit_reloc(chan, push->cur++, m->bo,
+ if (nouveau_pushbuf_emit_reloc(chan, chan->cur++, m->bo,
packet, 0, flags |
(m->flags & (NOUVEAU_BO_VRAM |
NOUVEAU_BO_GART |
@@ -53,10 +51,10 @@ nouveau_bo_marker_emit(GLcontext *ctx, struct nouveau_bo_marker *m,
0, 0))
goto fail;
} else {
- *(push->cur++) = packet;
+ *(chan->cur++) = packet;
}
- if (nouveau_pushbuf_emit_reloc(chan, push->cur++, m->bo, m->data,
+ if (nouveau_pushbuf_emit_reloc(chan, chan->cur++, m->bo, m->data,
m->data2, flags | m->flags,
m->vor, m->tor))
goto fail;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index b87b8dbdd0..6117f68bcf 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -140,6 +140,8 @@ nouveau_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable,
__DRIbuffer *buffers = NULL;
int i = 0, count, ret;
+ *stamp = *drawable->pStamp;
+
attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
if (fb->Visual.doubleBufferMode)
attachments[i++] = __DRI_BUFFER_BACK_LEFT;
@@ -218,10 +220,11 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw,
struct nouveau_context *nctx = dri_ctx->driverPrivate;
GLcontext *ctx = &nctx->base;
- if (nctx->screen->context != nctx) {
- nctx->screen->context = nctx;
- BITSET_ONES(nctx->dirty);
- }
+ if (nctx->screen->context == nctx)
+ return GL_TRUE;
+
+ nctx->screen->context = nctx;
+ BITSET_ONES(nctx->dirty);
/* Ask the X server for new renderbuffers. */
nouveau_update_renderbuffers(dri_ctx, dri_draw,
@@ -267,6 +270,28 @@ void
nouveau_validate_framebuffer(GLcontext *ctx)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
+ __DRIcontext *dri_ctx = to_nouveau_context(ctx)->dri_context;
+ __DRIdrawable *dri_draw = dri_ctx->driDrawablePriv;
+ __DRIdrawable *dri_read = dri_ctx->driReadablePriv;
+
+ if ((ctx->DrawBuffer->Name == 0 &&
+ nctx->drawable.d_stamp != *dri_draw->pStamp) ||
+ (dri_draw != dri_read &&
+ ctx->ReadBuffer->Name == 0 &&
+ nctx->drawable.r_stamp != *dri_read->pStamp)) {
+ if (nctx->drawable.dirty)
+ ctx->Driver.Flush(ctx);
+
+ /* Ask the X server for new renderbuffers. */
+ nouveau_update_renderbuffers(dri_ctx, dri_draw,
+ &nctx->drawable.d_stamp);
+ if (dri_draw != dri_read)
+ nouveau_update_renderbuffers(dri_ctx, dri_read,
+ &nctx->drawable.r_stamp);
+
+ if (nouveau_next_dirty_state(ctx) >= 0)
+ FIRE_RING(context_chan(ctx));
+ }
/* Someone's planning to draw something really soon. */
nctx->drawable.dirty = GL_TRUE;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 6abab8c965..3f9f3a3567 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -247,7 +247,19 @@ nouveau_destroy_buffer(__DRIdrawable *drawable)
(struct gl_framebuffer **)&drawable->driverPrivate, NULL);
}
+static void
+nouveau_drawable_flush(__DRIdrawable *draw)
+{
+}
+
+static const struct __DRI2flushExtensionRec nouveau_flush_extension = {
+ { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+ nouveau_drawable_flush,
+ dri2InvalidateDrawable,
+};
+
static const __DRIextension *nouveau_screen_extensions[] = {
+ &nouveau_flush_extension.base,
NULL
};
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c b/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c
index 8fa922f422..a1609a0dd5 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c
@@ -210,7 +210,7 @@ swtnl_flush_vertices(GLcontext *ctx)
swtnl_bind_vertices(ctx);
while (count) {
- push = get_max_vertices(ctx, NULL, chan->pushbuf->remaining);
+ push = get_max_vertices(ctx, NULL, AVAIL_RING(chan));
push = MIN2(push / 12 * 12, count);
count -= push;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
index ba1192a170..02c8580760 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
@@ -319,7 +319,7 @@ vbo_draw_vbo(GLcontext *ctx, const struct gl_client_array **arrays,
min_index, max_index);
}
- if (count > get_max_vertices(ctx, ib, chan->pushbuf->remaining))
+ if (count > get_max_vertices(ctx, ib, AVAIL_RING(chan)))
WAIT_RING(chan, PUSHBUF_DWORDS);
BATCH_BEGIN(nvgl_primitive(prims[i].mode));
@@ -355,7 +355,7 @@ vbo_draw_imm(GLcontext *ctx, const struct gl_client_array **arrays,
end = start + prims[i].count;
if (prims[i].count > get_max_vertices(ctx, ib,
- chan->pushbuf->remaining))
+ AVAIL_RING(chan)))
WAIT_RING(chan, PUSHBUF_DWORDS);
BATCH_BEGIN(nvgl_primitive(prims[i].mode));
diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c
index 4ae0d6fe48..3efa0e3a16 100644
--- a/src/mesa/drivers/dri/r300/r300_draw.c
+++ b/src/mesa/drivers/dri/r300/r300_draw.c
@@ -332,7 +332,7 @@ static void r300TranslateAttrib(GLcontext *ctx, GLuint attr, int count, const st
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
struct r300_vertex_buffer *vbuf = &r300->vbuf;
- struct vertex_attribute r300_attr;
+ struct vertex_attribute r300_attr = { 0 };
GLenum type;
GLuint stride;
diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c
index e6fa57d439..3a8d5fb745 100644
--- a/src/mesa/drivers/dri/r300/r300_vertprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertprog.c
@@ -234,7 +234,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx,
struct r300_vertex_program_compiler compiler;
vp = _mesa_calloc(sizeof(*vp));
- vp->Base = (struct gl_vertex_program *) _mesa_clone_program(ctx, &mesa_vp->Base);
+ vp->Base = _mesa_clone_vertex_program(ctx, mesa_vp);
_mesa_memcpy(&vp->key, wanted_key, sizeof(vp->key));
rc_init(&compiler.Base);
diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c
index 89adb77bf5..d0059fad2e 100644
--- a/src/mesa/drivers/dri/r600/r700_assembler.c
+++ b/src/mesa/drivers/dri/r600/r700_assembler.c
@@ -830,6 +830,8 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm,
if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here
{
//TODO : mini fetch
+ mega_fetch_count = 0;
+ is_mega_fetch_flag = 0;
}
else
{
@@ -922,6 +924,8 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm,
if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here
{
//TODO : mini fetch
+ mega_fetch_count = 0;
+ is_mega_fetch_flag = 0;
}
else
{
@@ -2260,7 +2264,7 @@ GLboolean check_vector(r700_AssemblerBase* pAsm,
GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm)
{
- R700ALUInstruction * alu_instruction_ptr;
+ R700ALUInstruction * alu_instruction_ptr = NULL;
R700ALUInstructionHalfLiteral * alu_instruction_ptr_hl;
R700ALUInstructionFullLiteral * alu_instruction_ptr_fl;
diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c
index e0be74935b..a742dbcf12 100644
--- a/src/mesa/drivers/dri/r600/r700_chip.c
+++ b/src/mesa/drivers/dri/r600/r700_chip.c
@@ -200,7 +200,8 @@ static void r700SetupVTXConstants(GLcontext * ctx,
}
else
{
- nVBsize = paos->count * pStreamDesc->stride;
+ nVBsize = (paos->count - 1) * pStreamDesc->stride
+ + pStreamDesc->size * getTypeSize(pStreamDesc->type);
}
uSQ_VTX_CONSTANT_WORD0_0 = paos->offset;
@@ -218,11 +219,11 @@ static void r700SetupVTXConstants(GLcontext * ctx,
SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM,
SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);
}
- //else
- //{
- // SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_INT,
- // SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);
- //}
+ else
+ {
+ SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_SCALED,
+ SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask);
+ }
if(1 == pStreamDesc->_signed)
{
diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c
index 618f7e1be1..46481cdff4 100644
--- a/src/mesa/drivers/dri/r600/r700_vertprog.c
+++ b/src/mesa/drivers/dri/r600/r700_vertprog.c
@@ -308,7 +308,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx,
unsigned int i;
vp = _mesa_calloc(sizeof(*vp));
- vp->mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, &mesa_vp->Base);
+ vp->mesa_program = _mesa_clone_vertex_program(ctx, mesa_vp);
if (mesa_vp->IsPositionInvariant)
{