115b61e51f
Yet another iteration on the same YUV surfaces. The change from87ecfdfbf0has 2 odd things: * it's using MAX2(original value, new value) but the point of updating surf_slice_size / surf_size is to make it correct relative to the new value of surf_pitch * it's multiplying surf_pitch (= number of elements per row) by height (ok) by surf->bpe (= number of bytes per element) by surf->blk_w (= number of "horizontal" pixels in an element) so the end unit doesn't make sense. Fix this by computing a reasonnable value based on unit: the surf_slice_size is the number of elements per row (surf_pitch) x number of bytes per element (bpe) x number of rows. This makes the expected size correct and thus fixes users of eglCreateImageKHR, like the issue #6131. I tested a bunch of gst pipelines and ffmpeg scripts on various files I have and didn't notice any issues (on gfx10.3 and gfx9). Fixes:87ecfdfbf0("ac/surface: adapt surf_size when modifying surf_pitch") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6131 Acked-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26693>