diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-03-14 04:14:37 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-03-14 22:43:08 +0000 |
commit | 4d1a356a570dfcec1dbde6790bcb9a3e7598c53e (patch) | |
tree | 877d54c0eb2c4ce1627a7db54659fc8ac33675ad /src/gallium/drivers/freedreno | |
parent | dd12142e3424fc2fb9b3e9b9d103b9e5bb9b03e5 (diff) |
freedreno: Use shared drm_find_modifier util
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 36d61d715ef..620ed4cad41 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -32,6 +32,7 @@ #include "util/u_string.h" #include "util/u_surface.h" #include "util/set.h" +#include "util/u_drm.h" #include "freedreno_resource.h" #include "freedreno_batch_cache.h" @@ -830,19 +831,6 @@ has_depth(enum pipe_format 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; -} - /** * Create a new texture object, using the given template info. */ @@ -906,7 +894,7 @@ fd_resource_create_with_modifiers(struct pipe_screen *pscreen, PIPE_BIND_LINEAR | \ PIPE_BIND_DISPLAY_TARGET) - bool linear = find_modifier(DRM_FORMAT_MOD_LINEAR, modifiers, count); + bool linear = drm_find_modifier(DRM_FORMAT_MOD_LINEAR, modifiers, count); if (tmpl->bind & LINEAR) linear = true; @@ -918,9 +906,9 @@ fd_resource_create_with_modifiers(struct pipe_screen *pscreen, * except we don't have a format modifier for tiled. (We probably * should.) */ - bool allow_ubwc = find_modifier(DRM_FORMAT_MOD_INVALID, modifiers, count); + bool allow_ubwc = drm_find_modifier(DRM_FORMAT_MOD_INVALID, modifiers, count); if (tmpl->bind & PIPE_BIND_SHARED) - allow_ubwc = find_modifier(DRM_FORMAT_MOD_QCOM_COMPRESSED, modifiers, count); + allow_ubwc = drm_find_modifier(DRM_FORMAT_MOD_QCOM_COMPRESSED, modifiers, count); /* TODO turn on UBWC for all internal buffers * Manhattan benchmark shows artifacts when enabled. Once this |