#include "util/u_surface.h"
#include "util/u_transfer_helper.h"
#include "util/u_upload_mgr.h"
+#include "util/u_drm.h"
#include "drm-uapi/drm_fourcc.h"
#include "drm-uapi/vc4_drm.h"
return format;
}
-static bool
-find_modifier(uint64_t needle, const uint64_t *haystack, int count)
-{
- int i;
-
- for (i = 0; i < count; i++) {
- if (haystack[i] == needle)
- return true;
- }
-
- return false;
-}
-
static struct pipe_resource *
vc4_resource_create_with_modifiers(struct pipe_screen *pscreen,
const struct pipe_resource *tmpl,
struct vc4_screen *screen = vc4_screen(pscreen);
struct vc4_resource *rsc = vc4_resource_setup(pscreen, tmpl);
struct pipe_resource *prsc = &rsc->base;
- bool linear_ok = find_modifier(DRM_FORMAT_MOD_LINEAR, modifiers, count);
+ bool linear_ok = drm_find_modifier(DRM_FORMAT_MOD_LINEAR, modifiers, count);
/* Use a tiled layout if we can, for better 3D performance. */
bool should_tile = true;
linear_ok = true;
rsc->tiled = should_tile;
} else if (should_tile &&
- find_modifier(DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
+ drm_find_modifier(DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
modifiers, count)) {
rsc->tiled = true;
} else if (linear_ok) {