summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-09-14 00:02:51 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2010-02-18 15:39:22 +0100
commit75208fd96b6dcdffd55569d549cdebb4d1218c8d (patch)
tree9c99321e54f63afa64b8bf465b7c2ab9c6188ff8 /src
parent499aa86d7c75943fe18b6e42994dc8ef67c6140e (diff)
Tidy up
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/glamo/glamo_context.c149
-rw-r--r--src/mesa/drivers/dri/glamo/glamo_state.c4
2 files changed, 74 insertions, 79 deletions
diff --git a/src/mesa/drivers/dri/glamo/glamo_context.c b/src/mesa/drivers/dri/glamo/glamo_context.c
index 3a6c0ff797..ee181da4ef 100644
--- a/src/mesa/drivers/dri/glamo/glamo_context.c
+++ b/src/mesa/drivers/dri/glamo/glamo_context.c
@@ -72,7 +72,7 @@ static const GLubyte *glamoGetString(GLcontext *ctx, GLenum name)
case GL_VENDOR:
return (GLubyte *)"Thomas White";
case GL_RENDERER: {
- driGetRendererString(buffer, "glamo", DRIVER_DATE, 0);
+ driGetRendererString(buffer, "Glamo", DRIVER_DATE, 0);
return (GLubyte *) buffer;
}
default:
@@ -188,9 +188,6 @@ static void glamo_update_renderbuffers(__DRIcontext *context,
glamoContextPtr glamo;
char *regname;
struct glamo_bo *bo;
- struct glamo_bo *depth_bo;
-
- fprintf(stderr, "Enter %s, drawable %p\n", __func__, drawable);
draw = drawable->driverPrivate;
screen = context->driScreenPriv;
@@ -201,16 +198,13 @@ static void glamo_update_renderbuffers(__DRIcontext *context,
if ( draw->color_rb[1] )
attachments[i++] = __DRI_BUFFER_BACK_LEFT;
- buffers = (*screen->dri2.loader->getBuffers)(drawable,
- &drawable->w,
- &drawable->h,
- attachments, i,
- &count,
- drawable->loaderPrivate);
-
- if (buffers == NULL) return;
-
- printf("%i, %i\n", drawable->w, drawable->h);
+ buffers = screen->dri2.loader->getBuffers(drawable,
+ &drawable->w,
+ &drawable->h,
+ attachments, i,
+ &count,
+ drawable->loaderPrivate);
+ if ( buffers == NULL ) return;
/* Set one cliprect to cover the whole drawable */
drawable->x = 0;
@@ -231,70 +225,71 @@ static void glamo_update_renderbuffers(__DRIcontext *context,
/* For each attachment */
for ( i=0; i<count; i++ ) {
- struct glamo_renderbuffer *grb;
-
- switch ( buffers[i].attachment ) {
- case __DRI_BUFFER_FRONT_LEFT:
- grb = draw->color_rb[0];
- regname = "dri2 front buffer";
- break;
- case __DRI_BUFFER_BACK_LEFT:
- grb = draw->color_rb[1];
- regname = "dri2 back buffer";
- break;
- case __DRI_BUFFER_DEPTH:
- grb = glamo_get_renderbuffer(&draw->base, BUFFER_DEPTH);
- regname = "dri2 depth buffer";
- break;
- case __DRI_BUFFER_STENCIL:
- grb = glamo_get_renderbuffer(&draw->base, BUFFER_STENCIL);
- regname = "dri2 stencil buffer";
- break;
- case __DRI_BUFFER_FAKE_FRONT_LEFT:
- grb = glamo_get_renderbuffer(&draw->base, BUFFER_STENCIL);
- regname = "dri2 fake front buffer";
- break;
- case __DRI_BUFFER_ACCUM:
- default:
- fprintf(stderr,
- "unhandled buffer attach event, attachment type %d\n",
- buffers[i].attachment);
- return;
- }
- if ( grb == NULL ) continue;
-
- if ( grb->bo ) {
- uint32_t name = glamo_gem_get_name(grb->bo);
- if ( name == buffers[i].name ) continue;
- }
-
- fprintf(stderr, "Attaching buffer %s, %d, at %d, cpp %d, pitch %d\n",
- regname, buffers[i].name, buffers[i].attachment,
- buffers[i].cpp, buffers[i].pitch);
-
- grb->cpp = buffers[i].cpp;
- grb->pitch = buffers[i].pitch;
- grb->width = drawable->w;
- grb->height = drawable->h;
-
- bo = glamo_bo_open(glamo->glamoScreen->bom,
- buffers[i].name,
- 0,
- 0,
- GLAMO_GEM_DOMAIN_VRAM,
- buffers[i].flags);
- if ( bo == NULL ) {
- fprintf(stderr, "Failed to attach %s %d\n",
- regname, buffers[i].name);
- }
-
- if ( buffers[i].attachment == __DRI_BUFFER_DEPTH ) {
- if ( draw->base.Visual.depthBits == 16 ) grb->cpp = 2;
- depth_bo = bo;
- }
+ struct glamo_renderbuffer *grb;
+
+ switch ( buffers[i].attachment ) {
+ case __DRI_BUFFER_FRONT_LEFT:
+ grb = draw->color_rb[0];
+ regname = "DRI2 front buffer";
+ break;
+ case __DRI_BUFFER_BACK_LEFT:
+ grb = draw->color_rb[1];
+ regname = "DRI2 back buffer";
+ break;
+ case __DRI_BUFFER_DEPTH:
+ grb = glamo_get_renderbuffer(&draw->base, BUFFER_DEPTH);
+ regname = "DRI2 depth buffer";
+ break;
+ case __DRI_BUFFER_STENCIL:
+ grb = glamo_get_renderbuffer(&draw->base,
+ BUFFER_STENCIL);
+ regname = "DRI2 stencil buffer";
+ break;
+ case __DRI_BUFFER_FAKE_FRONT_LEFT:
+ grb = draw->color_rb[0];
+ regname = "DRI2 fake front buffer";
+ break;
+ case __DRI_BUFFER_ACCUM:
+ default:
+ fprintf(stderr,
+ "Unhandled buffer attach event,"
+ " attachment type %d\n", buffers[i].attachment);
+ return;
+ }
+
+ if ( grb == NULL ) {
+ /* Don't know how to handle this type of buffer */
+ continue;
+ }
+
+ if ( grb->bo ) {
+ uint32_t name = glamo_gem_get_name(grb->bo);
+ if ( name == buffers[i].name ) {
+ /* Buffer already attached. No action needed */
+ continue;
+ }
+ }
+
+ fprintf(stderr, "Attaching buffer %s, %d, at %d, cpp %d,"
+ " pitch %d\n", regname, buffers[i].name,
+ buffers[i].attachment, buffers[i].cpp,
+ buffers[i].pitch);
+ grb->cpp = buffers[i].cpp;
+ grb->pitch = buffers[i].pitch;
+ grb->width = drawable->w;
+ grb->height = drawable->h;
+
+ bo = glamo_bo_open(glamo->glamoScreen->bom, buffers[i].name,
+ 0, 0, GLAMO_GEM_DOMAIN_VRAM,
+ buffers[i].flags);
+ if ( bo == NULL ) {
+ fprintf(stderr, "Failed to attach %s %d\n",
+ regname, buffers[i].name);
+ }
+
+ glamo_renderbuffer_set_bo(grb, bo);
+ glamo_bo_unref(bo);
- glamo_renderbuffer_set_bo(grb, bo);
- glamo_bo_unref(bo);
}
driUpdateFramebufferSize(glamo->glCtx, drawable);
diff --git a/src/mesa/drivers/dri/glamo/glamo_state.c b/src/mesa/drivers/dri/glamo/glamo_state.c
index 47149e5b4f..93d458120d 100644
--- a/src/mesa/drivers/dri/glamo/glamo_state.c
+++ b/src/mesa/drivers/dri/glamo/glamo_state.c
@@ -26,13 +26,13 @@
#include "main/context.h"
-void glamoClear(GLcontext *ctx, GLbitfield mask)
+static void glamoClear(GLcontext *ctx, GLbitfield mask)
{
printf("glamoClear\n"); fflush(stdout);
}
-void glamoClearColor(GLcontext *ctx, const GLfloat color[4])
+static void glamoClearColor(GLcontext *ctx, const GLfloat color[4])
{
printf("glamoClearColor\n"); fflush(stdout);
}