dri: Don't pretend we can lower NV15/NV20 when we can't
If the plane formats are __DRI_IMAGE_FORMAT_NONE (AKA PIPE_FORMAT_NONE),
we can't lower the planar-YUV. I guess this code relies on
::is_format_supported(PIPE_FORMAT_NONE, PIPE_BIND_SAMPLER_VIEW)
returning false, but it's not obvious to me that it should, and panfrost
has been returning true on this one for quite a long time. It could be
that panfrost is wrong, and this case should be rejected, but it's just
as simple to reject the lowering if the plane format is
__DRI_IMAGE_FORMAT_NONE instead of deferring this check to the driver,
because ultimately we can't lower NV15/NV20 unless the driver supports
NV15/NV20 or R10_G10B10_{420,422}.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35761>
This commit is contained in:
committed by
Marge Bot
parent
0cdb7f91b9
commit
6c0e72ba5a
@@ -762,8 +762,13 @@ dri2_yuv_dma_buf_supported(struct dri_screen *screen,
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < map->nplanes; i++) {
|
||||
if (!pscreen->is_format_supported(pscreen, map->planes[i].dri_format,
|
||||
screen->target, 0, 0, PIPE_BIND_SAMPLER_VIEW))
|
||||
/* Some planar-YUV formats can't be lowered unless the HW supports
|
||||
* specific YUV-as-RGB formats. Those have their plane format set
|
||||
* to __DRI_IMAGE_FORMAT_NONE. */
|
||||
if (map->planes[i].dri_format == __DRI_IMAGE_FORMAT_NONE ||
|
||||
!pscreen->is_format_supported(pscreen, map->planes[i].dri_format,
|
||||
screen->target, 0, 0,
|
||||
PIPE_BIND_SAMPLER_VIEW))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user