diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-03-14 04:16:07 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-03-14 22:43:06 +0000 |
commit | dd12142e3424fc2fb9b3e9b9d103b9e5bb9b03e5 (patch) | |
tree | c82aaa520c69dbfe4f7ef7b0bcc3b4915ef9fe27 /src/gallium | |
parent | cca270bb035a4dd8c7e94a56c9ca42068c66acb9 (diff) |
vc4: Use shared drm_find_modifier util
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_resource.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c index c12187d7872..93688cde998 100644 --- a/src/gallium/drivers/vc4/vc4_resource.c +++ b/src/gallium/drivers/vc4/vc4_resource.c @@ -30,6 +30,7 @@ #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" @@ -478,19 +479,6 @@ get_resource_texture_format(struct pipe_resource *prsc) 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, @@ -500,7 +488,7 @@ vc4_resource_create_with_modifiers(struct pipe_screen *pscreen, 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; @@ -541,7 +529,7 @@ vc4_resource_create_with_modifiers(struct pipe_screen *pscreen, 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) { |