>From 52a5c0e018fe5e461977984022938add887ae33f Mon Sep 17 00:00:00 2001
From: Christoph Brill <egore911@egore911.de>
Date: Wed, 9 May 2007 19:21:09 +0200
Subject: [PATCH] Add few doxygen comments to r300_context.h
Remove use r300PackColor() and use PACK_COLOR_8888 direct
---
 src/mesa/drivers/dri/r300/r300_context.h |   28 ++++++++++------------------
 src/mesa/drivers/dri/r300/r300_state.c   |    2 +-
 src/mesa/drivers/dri/r300/r300_tex.c     |    2 +-
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 9bda240..5556826 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -27,10 +27,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 **************************************************************************/
 
-/*
- * Authors:
- *   Keith Whitwell <keith@tungstengraphics.com>
- *   Nicolai Haehnle <prefect_@gmx.net>
+/*!
+ * \file
+ *
+ * \author Keith Whitwell <keith@tungstengraphics.com>
+ * \author Nicolai Haehnle <prefect_@gmx.net>
  */
 
 #ifndef __R300_CONTEXT_H__
@@ -88,6 +89,9 @@ typedef struct r300_context *r300ContextPtr;
 #include "r300_vertprog.h"
 #include "r300_fragprog.h"
 
+/*!
+ * This method takes a float and packs it into a uint32_t
+ */
 static __inline__ uint32_t r300PackFloat32(float fl)
 {
 	union {
@@ -104,7 +108,7 @@ static __inline__ uint32_t r300PackFloat32(float fl)
 /* Need refcounting on dma buffers:
  */
 struct r300_dma_buffer {
-	int refcount;		/* the number of retained regions in buf */
+	int refcount;		/*!< the number of retained regions in buf */
 	drmBufPtr buf;
 	int id;
 };
@@ -830,7 +834,7 @@ struct r300_state {
 #define R300_FALLBACK_TCL 1
 #define R300_FALLBACK_RAST 2
 
-/**
+/*!
  * R300 context structure.
  */
 struct r300_context {
@@ -878,18 +882,6 @@ struct r300_buffer_object {
 
 #define R300_CONTEXT(ctx)		((r300ContextPtr)(ctx->DriverCtx))
 
-static __inline GLuint r300PackColor(GLuint cpp,
-				     GLubyte r, GLubyte g, GLubyte b, GLubyte a)
-{
-	switch (cpp) {
-	case 2:
-		return PACK_COLOR_565(r, g, b);
-	case 4:
-		return PACK_COLOR_8888(r, g, b, a);
-	default:
-		return 0;
-	}
-}
 extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv);
 extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
 				   __DRIcontextPrivate * driContextPriv,
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 3b595d9..c4e5905 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -78,7 +78,7 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4])
 	CLAMPED_FLOAT_TO_UBYTE(color[2], cf[2]);
 	CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]);
 
-	rmesa->hw.blend_color.cmd[1] = r300PackColor(4, color[3], color[0],
+	rmesa->hw.blend_color.cmd[1] = PACK_COLOR_8888(color[3], color[0],
 						     color[1], color[2]);
 }
 
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c
index e800516..71673e8 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.c
+++ b/src/mesa/drivers/dri/r300/r300_tex.c
@@ -249,7 +249,7 @@ static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf)
 
 static void r300SetTexBorderColor(r300TexObjPtr t, GLubyte c[4])
 {
-	t->pp_border_color = r300PackColor(4, c[0], c[1], c[2], c[3]);
+	t->pp_border_color = PACK_COLOR_8888(c[0], c[1], c[2], c[3]);
 }
 
 /**
-- 
1.5.1.3

