[Mesa-dev] [PATCH 26/27] dri: Remove a few unused dri helper functions

Kristian Høgsberg krh at bitplanet.net
Fri Oct 28 15:11:56 PDT 2011


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

diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 54156d3..d8656a7 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -138,124 +138,6 @@ driGetRendererString( char * buffer, const char * hardware_name,
 
 
 /**
- * Utility function used by drivers to test the verions of other components.
- *
- * \param driver_name  Name of the driver.  Used in error messages.
- * \param driActual    Actual DRI version supplied __driCreateNewScreen.
- * \param driExpected  Minimum DRI version required by the driver.
- * \param ddxActual    Actual DDX version supplied __driCreateNewScreen.
- * \param ddxExpected  Minimum DDX minor and range of DDX major version required by the driver.
- * \param drmActual    Actual DRM version supplied __driCreateNewScreen.
- * \param drmExpected  Minimum DRM version required by the driver.
- * 
- * \returns \c GL_TRUE if all version requirements are met.  Otherwise,
- *          \c GL_FALSE is returned.
- * 
- * \sa __driCreateNewScreen, driCheckDriDdxDrmVersions2
- *
- * \todo
- * Now that the old \c driCheckDriDdxDrmVersions function is gone, this
- * function and \c driCheckDriDdxDrmVersions2 should be renamed.
- */
-GLboolean
-driCheckDriDdxDrmVersions3(const char * driver_name,
-			   const __DRIversion * driActual,
-			   const __DRIversion * driExpected,
-			   const __DRIversion * ddxActual,
-			   const __DRIutilversion2 * ddxExpected,
-			   const __DRIversion * drmActual,
-			   const __DRIversion * drmExpected)
-{
-   static const char format[] = "%s DRI driver expected %s version %d.%d.x "
-       "but got version %d.%d.%d\n";
-   static const char format2[] = "%s DRI driver expected %s version %d-%d.%d.x "
-       "but got version %d.%d.%d\n";
-
-
-   /* Check the DRI version */
-   if ( (driActual->major != driExpected->major)
-	|| (driActual->minor < driExpected->minor) ) {
-      fprintf(stderr, format, driver_name, "DRI",
-		       driExpected->major, driExpected->minor,
-		       driActual->major, driActual->minor, driActual->patch);
-      return GL_FALSE;
-   }
-
-   /* Check that the DDX driver version is compatible */
-   if ( (ddxActual->major < ddxExpected->major_min)
-	|| (ddxActual->major > ddxExpected->major_max)
-	|| (ddxActual->minor < ddxExpected->minor) ) {
-      fprintf(stderr, format2, driver_name, "DDX",
-		       ddxExpected->major_min, ddxExpected->major_max, ddxExpected->minor,
-		       ddxActual->major, ddxActual->minor, ddxActual->patch);
-      return GL_FALSE;
-   }
-   
-   /* Check that the DRM driver version is compatible */
-   if ( (drmActual->major != drmExpected->major)
-	|| (drmActual->minor < drmExpected->minor) ) {
-      fprintf(stderr, format, driver_name, "DRM",
-		       drmExpected->major, drmExpected->minor,
-		       drmActual->major, drmActual->minor, drmActual->patch);
-      return GL_FALSE;
-   }
-
-   return GL_TRUE;
-}
-
-GLboolean
-driCheckDriDdxDrmVersions2(const char * driver_name,
-			   const __DRIversion * driActual,
-			   const __DRIversion * driExpected,
-			   const __DRIversion * ddxActual,
-			   const __DRIversion * ddxExpected,
-			   const __DRIversion * drmActual,
-			   const __DRIversion * drmExpected)
-{
-   __DRIutilversion2 ddx_expected;
-   ddx_expected.major_min = ddxExpected->major;
-   ddx_expected.major_max = ddxExpected->major;
-   ddx_expected.minor = ddxExpected->minor;
-   ddx_expected.patch = ddxExpected->patch;
-   return driCheckDriDdxDrmVersions3(driver_name, driActual,
-				driExpected, ddxActual, & ddx_expected,
-				drmActual, drmExpected);
-}
-
-GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer,
-				    GLint *x, GLint *y,
-				    GLsizei *width, GLsizei *height )
-{
-   /* left clipping */
-   if (*x < buffer->_Xmin) {
-      *width -= (buffer->_Xmin - *x);
-      *x = buffer->_Xmin;
-   }
-
-   /* right clipping */
-   if (*x + *width > buffer->_Xmax)
-      *width -= (*x + *width - buffer->_Xmax - 1);
-
-   if (*width <= 0)
-      return GL_FALSE;
-
-   /* bottom clipping */
-   if (*y < buffer->_Ymin) {
-      *height -= (buffer->_Ymin - *y);
-      *y = buffer->_Ymin;
-   }
-
-   /* top clipping */
-   if (*y + *height > buffer->_Ymax)
-      *height -= (*y + *height - buffer->_Ymax - 1);
-
-   if (*height <= 0)
-      return GL_FALSE;
-
-   return GL_TRUE;
-}
-
-/**
  * Creates a set of \c struct gl_config that a driver will expose.
  * 
  * A set of \c struct gl_config will be created based on the supplied
-- 
1.7.7



More information about the mesa-dev mailing list