@@ -38,6 +38,7 @@
#include "xf86drm.h"
#include "radeon_drm.h"
#include "radeon_surface.h"
+#include "util_math.h"
#define CIK_TILE_MODE_COLOR_2D 14
#define CIK_TILE_MODE_COLOR_2D_SCANOUT 10
@@ -47,10 +48,6 @@
#define CIK_TILE_MODE_DEPTH_STENCIL_2D_TILESPLIT_512 3
#define CIK_TILE_MODE_DEPTH_STENCIL_2D_TILESPLIT_ROW_SIZE 4
-#define ALIGN(value, alignment) (((value) + alignment - 1) & ~(alignment - 1))
-#define MAX2(A, B) ((A) > (B) ? (A) : (B))
-#define MIN2(A, B) ((A) < (B) ? (A) : (B))
-
/* keep this private */
enum radeon_family {
CHIP_UNKNOWN,
@@ -887,21 +884,6 @@ static int eg_surface_init(struct radeon_surface_manager *surf_man,
return r;
}
-static unsigned log2_int(unsigned x)
-{
- unsigned l;
-
- if (x < 2) {
- return 0;
- }
- for (l = 2; ; l++) {
- if ((unsigned)(1 << l) > x) {
- return l - 1;
- }
- }
- return 0;
-}
-
/* compute best tile_split, bankw, bankh, mtilea
* depending on surface
*/
@@ -31,4 +31,18 @@
#define __align_mask(value, mask) (((value) + (mask)) & ~(mask))
#define ALIGN(value, alignment) __align_mask(value, (__typeof__(value))((alignment) - 1))
+static inline unsigned log2_int(unsigned x)
+{
+ unsigned l;
+
+ if (x < 2) {
+ return 0;
+ }
+ for (l = 2; ; l++) {
+ if ((unsigned)(1 << l) > x) {
+ return l - 1;
+ }
+ }
+ return 0;
+}
#endif /*_UTIL_MATH_H_*/
@@ -124,22 +124,6 @@ static drmServerInfoPtr drm_server_info;
static bool drmNodeIsDRM(int maj, int min);
static char *drmGetMinorNameForFD(int fd, int type);
-static unsigned log2_int(unsigned x)
-{
- unsigned l;
-
- if (x < 2) {
- return 0;
- }
- for (l = 2; ; l++) {
- if ((unsigned)(1 << l) > x) {
- return l - 1;
- }
- }
- return 0;
-}
-
-
drm_public void drmSetServerInfo(drmServerInfoPtr info)
{
drm_server_info = info;
Signed-off-by: Paul Gofman <pgofman@codeweavers.com> --- v2: - no changes. radeon/radeon_surface.c | 20 +------------------- util_math.h | 14 ++++++++++++++ xf86drm.c | 16 ---------------- 3 files changed, 15 insertions(+), 35 deletions(-)