Mesa (master): dri/util: add a bunch of comments

Brian Paul brianp at kemper.freedesktop.org
Tue Nov 2 16:06:52 UTC 2010


Module: Mesa
Branch: master
Commit: 670207e6d0f0c5a25a709a4b83987d379ee4b8fe
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=670207e6d0f0c5a25a709a4b83987d379ee4b8fe

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Nov  2 09:30:47 2010 -0600

dri/util: add a bunch of comments

---

 src/mesa/drivers/dri/common/utils.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index c195c4f..42be77f 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -738,12 +738,18 @@ static const struct { unsigned int attrib, offset; } attribMap[] = {
 
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
+
+/**
+ * Return the value of a configuration attribute.  The attribute is
+ * indicated by the index.
+ */
 static int
 driGetConfigAttribIndex(const __DRIconfig *config,
 			unsigned int index, unsigned int *value)
 {
     switch (attribMap[index].attrib) {
     case __DRI_ATTRIB_RENDER_TYPE:
+        /* no support for color index mode */
 	*value = __DRI_ATTRIB_RGBA_BIT;
 	break;
     case __DRI_ATTRIB_CONFIG_CAVEAT:
@@ -755,13 +761,16 @@ driGetConfigAttribIndex(const __DRIconfig *config,
 	    *value = 0;
 	break;
     case __DRI_ATTRIB_SWAP_METHOD:
+        /* XXX no return value??? */
 	break;
 
     case __DRI_ATTRIB_FLOAT_MODE:
+        /* this field is not int-sized */
         *value = config->modes.floatMode;
         break;
 
     default:
+        /* any other int-sized field */
 	*value = *(unsigned int *)
 	    ((char *) &config->modes + attribMap[index].offset);
 	
@@ -771,6 +780,13 @@ driGetConfigAttribIndex(const __DRIconfig *config,
     return GL_TRUE;
 }
 
+
+/**
+ * Get the value of a configuration attribute.
+ * \param attrib  the attribute (one of the _DRI_ATTRIB_x tokens)
+ * \param value  returns the attribute's value
+ * \return 1 for success, 0 for failure
+ */
 int
 driGetConfigAttrib(const __DRIconfig *config,
 		   unsigned int attrib, unsigned int *value)
@@ -784,6 +800,14 @@ driGetConfigAttrib(const __DRIconfig *config,
     return GL_FALSE;
 }
 
+
+/**
+ * Get a configuration attribute name and value, given an index.
+ * \param index  which field of the __DRIconfig to query
+ * \param attrib  returns the attribute name (one of the _DRI_ATTRIB_x tokens)
+ * \param value  returns the attribute's value
+ * \return 1 for success, 0 for failure
+ */
 int
 driIndexConfigAttrib(const __DRIconfig *config, int index,
 		     unsigned int *attrib, unsigned int *value)




More information about the mesa-commit mailing list