summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/glx
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2018-08-21 09:46:46 -0700
committerDylan Baker <[email protected]>2018-09-07 10:21:26 -0700
commit8396043f304bb2a752130230055605c5c966e89f (patch)
treeee2e8a5494b88bff3b5e67ece8ffdba70d12c087 /src/gallium/state_trackers/glx
parent80825abb5d1a7491035880253ffd531c55acae6b (diff)
Replace uses of _mesa_bitcount with util_bitcount
and _mesa_bitcount_64 with util_bitcount_64. This fixes a build problem in nir for platforms that don't have popcount or popcountll, such as 32bit msvc. v2: - Fix additional uses of _mesa_bitcount added after this was originally written Acked-by: Eric Engestrom <[email protected]> (v1) Acked-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/glx')
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c7
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c11
2 files changed, 10 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index 1334b35e8c9..97c3913b5a4 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -41,6 +41,7 @@
#include "xm_api.h"
#include "main/imports.h"
#include "main/errors.h"
+#include "util/u_math.h"
/* An "Atrribs/Attribs" typo was fixed in glxproto.h in Nov 2014.
* This is in case we don't have the updated header.
@@ -419,9 +420,9 @@ get_visual( Display *dpy, int scr, unsigned int depth, int xclass )
* 10 bits per color channel. Mesa's limited to a max of 8 bits/channel.
*/
if (vis && depth > 24 && (xclass==TrueColor || xclass==DirectColor)) {
- if (_mesa_bitcount((GLuint) vis->red_mask ) <= 8 &&
- _mesa_bitcount((GLuint) vis->green_mask) <= 8 &&
- _mesa_bitcount((GLuint) vis->blue_mask ) <= 8) {
+ if (util_bitcount((GLuint) vis->red_mask ) <= 8 &&
+ util_bitcount((GLuint) vis->green_mask) <= 8 &&
+ util_bitcount((GLuint) vis->blue_mask ) <= 8) {
return vis;
}
else {
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index b560ffca9b6..86d27c42d6f 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -65,6 +65,7 @@
#include "util/u_atomic.h"
#include "util/u_inlines.h"
+#include "util/u_math.h"
#include "hud/hud_context.h"
@@ -825,9 +826,9 @@ XMesaVisual XMesaCreateVisual( Display *display,
{
const int xclass = v->visualType;
if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) {
- red_bits = _mesa_bitcount(GET_REDMASK(v));
- green_bits = _mesa_bitcount(GET_GREENMASK(v));
- blue_bits = _mesa_bitcount(GET_BLUEMASK(v));
+ red_bits = util_bitcount(GET_REDMASK(v));
+ green_bits = util_bitcount(GET_GREENMASK(v));
+ blue_bits = util_bitcount(GET_BLUEMASK(v));
}
else {
/* this is an approximation */
@@ -1180,8 +1181,8 @@ XMesaCreatePixmapTextureBuffer(XMesaVisual v, Pixmap p,
if (ctx->Extensions.ARB_texture_non_power_of_two) {
target = GLX_TEXTURE_2D_EXT;
}
- else if ( _mesa_bitcount(b->width) == 1
- && _mesa_bitcount(b->height) == 1) {
+ else if ( util_bitcount(b->width) == 1
+ && util_bitcount(b->height) == 1) {
/* power of two size */
if (b->height == 1) {
target = GLX_TEXTURE_1D_EXT;