diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index 23509a9d304..d430694f8ad 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -1031,7 +1031,7 @@ dri_create_image_from_winsys(struct dri_screen *screen, templ.width0 = width >> map->planes[i].width_shift; templ.height0 = height >> map->planes[i].height_shift; if (use_lowered) - templ.format = dri2_get_pipe_format_for_dri_format(map->planes[i].dri_format); + templ.format = map->planes[i].dri_format; else templ.format = map->pipe_format; assert(templ.format != PIPE_FORMAT_NONE); diff --git a/src/gallium/frontends/dri/dri_helpers.c b/src/gallium/frontends/dri/dri_helpers.c index 0ff15c43628..47d2231f0fe 100644 --- a/src/gallium/frontends/dri/dri_helpers.c +++ b/src/gallium/frontends/dri/dri_helpers.c @@ -743,17 +743,6 @@ dri2_get_mapping_by_format(int format) return NULL; } -enum pipe_format -dri2_get_pipe_format_for_dri_format(int format) -{ - for (unsigned i = 0; i < ARRAY_SIZE(dri2_format_table); i++) { - if (dri2_format_table[i].dri_format == format) - return dri2_format_table[i].pipe_format; - } - - return PIPE_FORMAT_NONE; -} - static enum pipe_format alt_pipe_format(enum pipe_format yuv_fmt) { @@ -787,8 +776,7 @@ dri2_yuv_dma_buf_supported(struct dri_screen *screen, screen->target, 0, 0, PIPE_BIND_SAMPLER_VIEW)) return true; for (unsigned i = 0; i < map->nplanes; i++) { - if (!pscreen->is_format_supported(pscreen, - dri2_get_pipe_format_for_dri_format(map->planes[i].dri_format), + if (!pscreen->is_format_supported(pscreen, map->planes[i].dri_format, screen->target, 0, 0, PIPE_BIND_SAMPLER_VIEW)) return false; }