dri: use plane format directly

Since 7e10601786 we not longer need the table we can just use
the formats directly.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35814>
This commit is contained in:
Timothy Arceri 2025-06-29 11:14:59 +10:00 committed by Marge Bot
parent 3853f72f52
commit 3a51865faa
2 changed files with 2 additions and 14 deletions

View file

@ -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);

View file

@ -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;
}